/**
 * Dashboard de Gestión de Tarjetas - Con Menú Lateral y Móvil-First
 * Versión: 2.0.0
 */

/* ==========================================
   VARIABLES CSS
   ========================================== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    --sidebar-width: 280px;
    --sidebar-width-mobile: 280px;
    --header-height: 70px;
    
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 5px 20px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.15);
    
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET Y BASE
   ========================================== */
* {
    box-sizing: border-box;
}

.dashboard-container {
    min-height: 100vh;
    background: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    position: relative;
}

/* ==========================================
   MENÚ LATERAL
   ========================================== */
.dashboard-sidebar {
    width: var(--sidebar-width);
    max-width: 280px;
    background: white;
    box-shadow: var(--shadow-medium);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height para móviles */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-gradient);
    color: white;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-logo i {
    font-size: 1.5rem;
}

.sidebar-toggle-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-toggle-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: #64748b;
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: #f1f5f9;
    color: #667eea;
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    border-left-color: #667eea;
}

.menu-item i {
    width: 20px;
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.user-info i {
    font-size: 1.5rem;
    color: #667eea;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: #64748b;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.logout-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ==========================================
   OVERLAY PARA MÓVIL
   ========================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

/* ==========================================
   CONTENIDO PRINCIPAL
   ========================================== */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

.dashboard-header {
    height: var(--header-height);
    background: white;
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Header responsive en móvil */
@media (max-width: 1024px) {
    .dashboard-header {
        padding: 0 15px;
        gap: 15px;
    }
}

.sidebar-toggle {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    font-size: 1.4rem;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
    position: relative;
}

.sidebar-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Pulso de atención en la primera carga (móvil) */
@media (max-width: 1024px) {
    .sidebar-toggle {
        animation: pulseSidebar 2s ease-in-out 3;
    }
}

@keyframes pulseSidebar {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8), 0 0 40px rgba(102, 126, 234, 0.4);
    }
}

.header-title {
    flex: 1;
}

.header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
}

.header-title p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: #f1f5f9;
    color: #667eea;
}

/* ==========================================
   SECCIONES DEL DASHBOARD
   ========================================== */
.dashboard-section {
    display: none;
    padding: 30px;
    flex: 1;
    animation: fadeIn 0.3s ease-out;
}

.dashboard-section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 700;
}

/* ==========================================
   ESTADÍSTICAS
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
}

.stat-total .stat-icon {
    background: var(--primary-gradient);
}

.stat-active .stat-icon {
    background: var(--success-gradient);
}

.stat-configured .stat-icon {
    background: var(--info-gradient);
}

.stat-pending .stat-icon {
    background: var(--warning-gradient);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* ==========================================
   TARJETAS RECIENTES
   ========================================== */
.recent-cards {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
}

.recent-cards h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    color: #1e293b;
}

.recent-cards-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recent-card-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.recent-card-item:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.card-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.card-info {
    flex: 1;
}

.card-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
}

.card-type {
    font-size: 0.85rem;
    color: #64748b;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #f1f5f9;
    color: #475569;
}

/* ==========================================
   ACCIONES RÁPIDAS
   ========================================== */
.quick-actions {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 30px;
}

.quick-actions h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    color: #1e293b;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.action-btn {
    padding: 20px 15px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #64748b;
}

.action-btn:hover {
    border-color: #667eea;
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 1.5rem;
}

/* ==========================================
   FILTROS Y BÚSQUEDA
   ========================================== */
.filters-container {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-medium);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.filter-search {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.filter-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
}

.filter-search input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
}

.filter-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--primary-gradient);
    border-color: #667eea;
    color: white;
}

/* ==========================================
   GRID DE TARJETAS
   ========================================== */
.tarjetas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.tarjeta-item {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.tarjeta-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

.tarjeta-status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.tarjeta-status-badge.activa {
    background: rgba(56, 239, 125, 0.9);
    color: white;
}

.tarjeta-status-badge.inactiva {
    background: rgba(148, 163, 184, 0.9);
    color: white;
}

.tarjeta-header {
    background: var(--primary-gradient);
    padding: 30px 20px 60px 20px;
    text-align: center;
    position: relative;
}

.tarjeta-photo {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.tarjeta-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow-medium);
}

.tarjeta-info {
    padding: 25px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tarjeta-tipo {
    background: var(--primary-gradient);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    align-self: flex-start;
}

.tarjeta-nombre {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

/* Contenedor de URL compartida */
.share-url-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03));
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-url-container:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.12);
}

.share-url-input {
    flex: 1;
    border: none;
    background: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #64748b;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.share-url-input:focus {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-copy-url {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    min-width: 50px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-copy-url::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-copy-url:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-copy-url:hover::before {
    left: 100%;
}

.btn-copy-url:active {
    transform: translateY(0) scale(0.98);
}

.btn-copy-url i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-copy-url:hover i {
    transform: scale(1.1);
}

/* Estado copiado */
.btn-copy-url.copied {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: copiedPulse 0.6s ease;
}

.btn-copy-url.copied i {
    animation: copiedCheck 0.6s ease;
}

@keyframes copiedPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    }
}

@keyframes copiedCheck {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.3) rotate(10deg);
    }
    50% {
        transform: scale(1.3) rotate(-10deg);
    }
    75% {
        transform: scale(1.3) rotate(10deg);
    }
}

/* Asegurar que el texto sea blanco cuando está copiado */
.btn-copy-url.copied {
    color: white !important;
}

.btn-copy-url.copied i {
    color: white !important;
}

.tarjeta-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 20px 20px 20px;
}

.btn-action {
    padding: 12px 15px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid;
}

.btn-edit {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-view {
    background: white;
    color: #667eea;
    border-color: #667eea;
}

.btn-view:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* ==========================================
   ESTADÍSTICAS DETALLADAS
   ========================================== */
.stats-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.chart-container, .usage-stats {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-medium);
}

.chart-container h4, .usage-stats h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
}

.chart-placeholder {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f8fafc;
    border-radius: var(--border-radius);
}

.chart-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.chart-color.activa {
    background: var(--success-gradient);
}

.chart-color.inactiva {
    background: var(--warning-gradient);
}

/* ==========================================
   PERFIL
   ========================================== */
.profile-info {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-medium);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.profile-details h3 {
    margin: 0 0 5px 0;
    color: #1e293b;
}

.profile-details p {
    margin: 2px 0;
    color: #64748b;
}

.profile-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.profile-btn {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* ==========================================
   CONTACTOS
   ========================================== */
.contacts-summary {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-medium);
}

.contact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.contact-stat-item {
    text-align: center;
    padding: 25px;
    background: #f8fafc;
    border-radius: var(--border-radius);
}

.contact-stat-item .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 5px;
}

.contact-stat-item .stat-label {
    color: #64748b;
    font-weight: 500;
}

/* ==========================================
   SIN RESULTADOS / SIN TARJETAS
   ========================================== */
.no-tarjetas, .no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
}

.no-tarjetas-icon, .no-results-icon {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.no-tarjetas h3, .no-results h3 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 10px;
}

.no-tarjetas p, .no-results p {
    color: #64748b;
    margin-bottom: 30px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* ==========================================
   ANIMACIONES
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ==========================================
   RESPONSIVE - MÓVIL FIRST
   ========================================== */

/* Tablet y Desktop */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .tarjetas-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* ==========================================
   TABLET (768px - 1024px)
   ========================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .dashboard-main {
        padding: 20px;
    }
    
    .tarjetas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .personalizacion-dos-columnas {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .preview-columna {
        order: -1;
    }
    
    .button-shape-selector,
    .button-style-selector {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Móvil y Tablet Pequeño */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px; /* Ancho fijo en móvil */
    }
    
    .dashboard-sidebar {
        width: 280px !important;
        max-width: 85vw; /* No más del 85% en pantallas muy pequeñas */
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .dashboard-main {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar-toggle {
        display: flex !important;
    }
    
    .sidebar-toggle-close {
        display: flex !important;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .dashboard-header {
        padding: 0 20px;
    }
    
    .dashboard-section {
        padding: 20px;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .filter-search {
        width: 100%;
        min-width: auto;
    }
    
    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tarjetas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .tarjeta-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* URL compartida en móvil */
    .share-url-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .share-url-input {
        font-size: 0.8rem;
        padding: 10px 12px;
        text-align: center;
    }
    
    .btn-copy-url {
        width: 100%;
        padding: 12px 18px;
        gap: 10px;
    }
    
    .btn-copy-url::after {
        content: 'Copiar enlace';
        font-size: 0.9rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .profile-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .contact-stats {
        grid-template-columns: 1fr;
    }
    
    /* Botones de acción más grandes en móvil */
    .btn-primary,
    .btn-secondary,
    .btn-action {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 0 15px;
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
    }
    
    .header-title h1 {
        font-size: 1.3rem;
    }
    
    .header-title p {
        font-size: 0.8rem;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .dashboard-section {
        padding: 15px;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px 15px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .recent-card-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
    
    .filter-btn {
        justify-content: center;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    /* Tarjetas en móvil */
    .tarjeta-card {
        padding: 15px;
    }
    
    .tarjeta-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* URL compartida en móvil pequeño */
    .share-url-container {
        padding: 8px;
        border-radius: 10px;
    }
    
    .share-url-input {
        font-size: 0.75rem;
        padding: 9px 10px;
    }
    
    .btn-copy-url {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
    
    .btn-copy-url::after {
        font-size: 0.85rem;
    }
    
    .tarjeta-qr img {
        max-width: 120px;
    }
    
    /* Edit tabs en móvil */
    .edit-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .edit-tab {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .edit-tab i {
        margin-right: 4px;
    }
    
    /* Modal en móvil */
    .modal-content {
        margin: 10px;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ==========================================
   MÓVILES MUY PEQUEÑOS (< 375px)
   ========================================== */
@media (max-width: 375px) {
    .dashboard-header {
        padding: 0 10px;
        height: auto;
    }
    
    .header-title h1 {
        font-size: 1.1rem;
    }
    
    .header-title p {
        display: none; /* Ocultar subtítulo en pantallas muy pequeñas */
    }
    
    .sidebar-toggle {
        width: 40px;
        height: 40px;
    }
    
    .dashboard-section {
        padding: 12px;
    }
    
    /* URL compartida en móvil muy pequeño */
    .share-url-container {
        padding: 6px;
        gap: 8px;
        border-radius: 8px;
    }
    
    .share-url-input {
        font-size: 0.7rem;
        padding: 8px;
    }
    
    .btn-copy-url {
        padding: 8px 12px;
        min-width: 45px;
    }
    
    .btn-copy-url::after {
        font-size: 0.8rem;
    }
    
    /* Personalización móvil muy pequeño */
    .personalizacion-dos-columnas {
        padding: 10px;
        gap: 12px;
    }
    
    .preview-card-container {
        padding: 10px;
    }
    
    .preview-card-container h4 {
        font-size: 1rem;
    }
    
    .preview-help {
        font-size: 0.75rem;
    }
    
    /* Vista previa móvil muy pequeño - ESTILO CIRCULAR CON PORTADA */
    .preview-perfil {
        border-radius: 16px;
    }
    
    .preview-profile-container {
        margin: 0 auto 0;
    }
    
    .preview-profile-cover {
        height: 130px;
    }
    
    .preview-profile-img {
        width: 95px;
        height: 95px;
        bottom: -47px;
    }
    
    .preview-profile-pic,
    .preview-img-perfil,
    .preview-profile-pic {
        border: 3px solid white;
    }
    
    .preview-company-badge {
        width: 45px;
        height: 45px;
        bottom: -52px;
        right: calc(50% - 57.5px);
        padding: 2px;
    }
    
    .preview-company-badge img {
        padding: 0;
        object-fit: cover;
    }
    
    .preview-contenido {
        padding: 55px 10px 15px 10px;
    }
    
    .preview-names h1 {
        font-size: 1.1rem;
        margin: 8px 0 4px 0;
    }
    
    .preview-contenido h2 {
        font-size: 0.9rem;
        margin: 0 0 10px 0;
    }
    
    .preview-items-buttons {
        gap: 8px;
        margin: 15px 0;
    }
    
    .preview-btn-vcard {
        padding: 10px 12px;
        font-size: 0.8rem;
        border-radius: 6px;
    }
    
    .preview-btn-vcard i {
        font-size: 0.9rem;
        margin-right: 5px;
    }
    
    .preview-btn-vcard span {
        font-size: 0.8rem;
    }
    
    .preview-items {
        gap: 6px;
        margin: 12px 0;
    }
    
    .preview-perfil-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .preview-section {
        margin: 20px 0 10px 0;
    }
    
    .preview-section h2 {
        font-size: 1.1rem;
    }
    
    .preview-img-icon {
        margin: 10px 0;
    }
    
    .preview-img-icon i {
        font-size: 0.95rem;
    }
    
    .preview-img-icon span {
        font-size: 0.85rem;
    }
    
    .controles-columna {
        padding: 12px 10px;
        gap: 12px;
    }
    
    .color-control {
        padding: 12px 10px;
    }
    
    .color-control label {
        font-size: 0.9rem;
    }
    
    .color-input-group input[type="color"] {
        width: 65px;
        height: 52px;
        border-radius: 10px;
    }
    
    .color-hex {
        font-size: 0.8rem;
        padding: 11px 8px;
        font-weight: 700;
    }
    
    .button-styles-section {
        padding: 12px 10px;
    }
    
    .subsection-title {
        font-size: 1.1rem;
    }
    
    .subsection-description {
        font-size: 0.8rem;
    }
    
    .button-shape-selector,
    .button-style-selector {
        gap: 6px;
    }
    
    .shape-option,
    .visual-option {
        padding: 10px 6px;
        font-size: 0.8rem;
    }
    
    .shape-option span,
    .visual-option span {
        font-size: 0.75rem;
    }
    
    .shape-demo {
        width: 30px;
        height: 30px;
    }
    
    .visual-demo {
        width: 35px;
        height: 35px;
    }
    
    .demo-btn-primary {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .demo-btn-social {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    
    .style-control select {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    /* Selectores de forma y estilo en grid 2x2 */
    .button-shape-selector,
    .button-style-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .shape-option,
    .visual-option {
        padding: 10px 6px;
    }
    
    .shape-demo,
    .visual-demo {
        width: 40px;
        height: 28px;
    }
    
    .shape-demo.circle,
    .visual-demo.circle {
        width: 32px;
        height: 32px;
    }
    
    .shape-option span,
    .visual-option span {
        font-size: 0.75rem;
    }
    
    /* Botones demo más pequeños */
    .demo-btn-primary {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .demo-btn-social {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* Inputs más táctiles */
    .field-container input,
    .field-container textarea,
    .field-container select {
        font-size: 16px !important; /* Evitar zoom en iOS */
        padding: 12px 14px;
    }
    
    .color-input-group input[type="color"] {
        width: 55px;
        height: 42px;
    }
}

/* ==========================================
   LANDSCAPE MÓVIL (altura pequeña)
   ========================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .dashboard-sidebar {
        padding-top: 10px;
    }
    
    .sidebar-header {
        padding: 10px 15px;
    }
    
    .nav-item {
        padding: 10px 20px;
    }
    
    .preview-card-container {
        padding: 15px;
    }
    
    .vista-previa-frame {
        height: 400px;
    }
}

/* ==========================================
   TOUCH DEVICES - Mejoras táctiles
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    /* Botones más grandes para dedos */
    .btn,
    .upload-btn,
    .delete-btn,
    .filter-btn,
    .edit-tab,
    .gradient-option,
    .shape-option,
    .visual-option {
        min-height: 44px; /* Tamaño mínimo recomendado por Apple */
        min-width: 44px;
    }
    
    /* Espaciado adicional para evitar toques accidentales */
    .header-actions {
        gap: 12px;
    }
    
    .edit-tabs {
        gap: 8px;
    }
    
    /* Scroll suave en iOS */
    .edit-tabs,
    .button-shape-selector,
    .button-style-selector {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Evitar selección de texto en botones */
    .btn,
    .edit-tab,
    .filter-btn,
    .shape-option,
    .visual-option,
    .gradient-option {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
}

/* ==========================================
   TABLAS RESPONSIVE
   ========================================== */
.shop_table,
.contact-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.shop_table thead tr {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.shop_table th,
.shop_table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.shop_table tbody tr:hover {
    background: #f8fafc;
}

/* Tablas responsive en móvil */
@media (max-width: 768px) {
    .shop_table,
    .shop_table_responsive {
        border: 0;
    }
    
    .shop_table thead {
        display: none; /* Ocultar headers en móvil */
    }
    
    .shop_table tbody,
    .shop_table tr,
    .shop_table td {
        display: block;
        width: 100%;
    }
    
    .shop_table tr {
        margin-bottom: 15px;
        background: white;
        border-radius: var(--border-radius);
        padding: 15px;
        box-shadow: var(--shadow-light);
    }
    
    .shop_table td {
        text-align: right;
        padding: 10px 0;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .shop_table td:last-child {
        border-bottom: none;
    }
    
    .shop_table td::before {
        content: attr(data-title);
        font-weight: 600;
        color: #475569;
        text-align: left;
    }
}

/* ==========================================
   MODO OSCURO (Futuro)
   ========================================== */
@media (prefers-color-scheme: dark) {
    /* Preparado para modo oscuro futuro */
}

/* ==========================================
   PESTAÑAS DE EDICIÓN
   ========================================== */
.edit-tabs {
    display: flex;
    gap: 10px;
    padding: 0 30px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.edit-tabs::-webkit-scrollbar {
    height: 4px;
}

.edit-tabs::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.edit-tabs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.edit-tab {
    padding: 15px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-bottom: -2px;
    flex-shrink: 0;
}

.edit-tab i {
    font-size: 1.1rem;
}

.edit-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 8px 8px 0 0;
}

.edit-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 8px 8px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================
   SECCIÓN DE EDICIÓN
   ========================================== */
.edit-section-menu {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.edit-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.edit-menu-header h4 {
    color: #1e293b;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-back-to-cards {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-back-to-cards:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.edit-header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-back {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-back:hover {
    background: #e2e8f0;
    color: #475569;
}

/* ==========================================
   FORMULARIO DE EDICIÓN
   ========================================== */
.dashboard-edit-form {
    max-width: 100%;
    margin: 0 auto;
}

.edit-photos-section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-medium);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.photo-upload-container {
    text-align: center;
}

.photo-upload-container h4 {
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.photo-preview {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #e2e8f0;
    position: relative;
    transition: var(--transition);
}

.photo-preview:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Estilo específico para imagen de portada */
.photo-upload-container.full-width-cover {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

.photo-preview.cover-preview {
    width: 100%;
    max-width: 500px;
    height: 180px;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
}

.photo-preview.cover-preview img {
    object-fit: cover;
    object-position: center;
}

.photo-preview.cover-preview:hover {
    border-color: #667eea;
    transform: scale(1.01);
}

.upload-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.upload-btn {
    background: var(--primary-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.delete-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.delete-btn:hover {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.delete-btn i {
    font-size: 0.95rem;
}

.edit-section-group {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-medium);
}

.section-title {
    color: #1e293b;
    font-size: 1.3rem;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #667eea;
    font-size: 1.2rem;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.field-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-container.full-width {
    grid-column: 1 / -1;
}

.field-container label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-container label i {
    color: #667eea;
    width: 16px;
    text-align: center;
}

.field-container input,
.field-container textarea {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background: #fafafa;
}

.field-container input:focus,
.field-container textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field-container textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.form-actions {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-medium);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    position: sticky;
    bottom: 20px;
}

.form-actions .btn {
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.form-actions .btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.form-actions .btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.form-actions .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #d1d5db;
}

/* ==========================================
   PERSONALIZACIÓN DE APARIENCIA
   ========================================== */
.section-description {
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ==========================================
   PERSONALIZACIÓN: DOS COLUMNAS (Desktop)
   ========================================== */

.personalizacion-dos-columnas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Desktop: dos columnas */
@media (min-width: 993px) {
    .personalizacion-dos-columnas {
        grid-template-columns: 1fr 1fr;
    }
    
    .preview-columna {
        position: sticky;
        top: 20px;
        height: fit-content;
    }
}

/* Tablet y móvil: una columna, vista previa primero */
@media (max-width: 992px) {
    .personalizacion-dos-columnas {
        grid-template-columns: 1fr;
    }
    
    .preview-columna {
        order: -1; /* Vista previa arriba en móvil */
    }
}

.controles-columna {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-card-container {
    background: #f8fafc;
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 0; /* Sin margen porque el gap lo maneja */
    text-align: center;
}

.preview-card-container h4 {
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
}

.preview-help {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 25px;
    font-style: italic;
}

/* ==========================================
   PREVIEW ESTILO TARJETA REAL
   ========================================== */
/* ===== VISTA PREVIA - IDÉNTICA A LA PÁGINA FINAL ===== */
.preview-perfil {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.preview-perfil.updating {
    transform: scale(0.99);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.25);
}

/* Contenedor de imágenes (igual que page_vcard.css) */
.preview-profile-container {
    position: relative;
    margin: 0 auto 0;
    max-width: 100%;
    z-index: auto;
}

/* Imagen de portada BANNER */
.preview-profile-cover {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.preview-profile-cover img,
.preview-profile-cover .preview-cover-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Imagen de perfil CIRCULAR */
.preview-profile-img {
    width: 140px;
    height: 140px;
    position: absolute;
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.preview-pic,
.preview-img-perfil,
.preview-profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: block;
    border: 5px solid white;
    background: white;
}

.preview-profile-img:hover .preview-pic,
.preview-profile-img:hover .preview-img-perfil,
.preview-profile-img:hover .preview-profile-pic {
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
    transform: scale(1.05);
}

/* Logo de empresa (IDÉNTICO a page_vcard.css) */
.preview-company-badge {
    position: absolute;
    bottom: -75px;
    right: calc(50% - 80px);
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
    z-index: 3;
    transition: all 0.3s ease;
    border: 1px solid white;
    overflow: visible;
}

.preview-company-badge::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.preview-company-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2), 0 3px 10px rgba(0,0,0,0.12);
}

.preview-company-badge:hover::before {
    opacity: 1;
}

.preview-company-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: white;
    padding: 4px;
}

/* Contenido (idéntico a page_vcard.css) */
.preview-contenido {
    padding: 85px 25px 25px 25px;
    text-align: center;
    position: relative;
    z-index: auto;
    transition: background-color 0.3s ease;
}

.preview-header {
    padding: 40px 20px 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: background-color 0.3s ease;
}

.preview-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    margin-top: -50px;
    z-index: 10;
}

.preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-body {
    padding: 60px 25px 30px 25px;
    background: white;
    margin-top: -40px;
    transition: background-color 0.3s ease;
}

/* Nombres (idéntico a page_vcard.css) */
.preview-names {
    text-align: center;
    margin-bottom: 8px;
}

.preview-names h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.preview-contenido > p {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 20px 0;
    transition: color 0.3s ease;
}

.preview-contenido h2 {
    text-align: center;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 30px 0 15px 0 !important;
    display: block;
    transition: color 0.3s ease;
}

/* Email/Contacto (idéntico a page_vcard.css) */
.preview-img-icon.mail {
    margin: 20px 0;
}

.preview-img-icon.mail a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 14px;
}

.preview-img-icon.mail a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.preview-img-icon.mail i {
    font-size: 18px;
    transition: color 0.3s ease;
}

/* Botones principales (idéntico a page_vcard.css) */
.preview-items-buttons {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
    position: relative;
    z-index: 10;
}

.preview-btn-vcard {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    line-height: 1.2;
    position: relative;
    z-index: 10;
}

.preview-btn-vcard:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0.9;
}

.preview-btn-vcard i {
    font-size: 16px;
    color: inherit !important;
}

.preview-btn-vcard span {
    white-space: nowrap;
    color: inherit !important;
}

/* Botones de contacto rápido (idéntico a page_vcard.css) */
.preview-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    justify-content: center;
    align-items: center;
    justify-items: center;
    margin: 20px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.preview-items:has(.preview-img-icon.cell) {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    gap: 12px;
}

.preview-items .preview-img-icon.cell {
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    min-height: 45px !important;
    max-width: 45px !important;
    max-height: 45px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.preview-perfil-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    min-height: 45px !important;
    max-width: 45px !important;
    max-height: 45px !important;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50% !important;
    text-decoration: none;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.preview-perfil-button:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.preview-perfil-button i {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: inherit !important;
}

/* Sección títulos */
.preview-section {
    margin: 30px 0 15px 0;
    text-align: center;
}

.preview-section h2 {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 30px 0 15px 0 !important;
}

/* Redes sociales (idéntico a page_vcard.css) */
.preview-redes-sociales {
    display: grid;
    grid-template-columns: repeat(auto-fit, 44px);
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 15px 0 25px 0;
    width: 100%;
}

.preview-redes-sociales > a,
.preview-redes-sociales > .preview-perfil-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    border-radius: 50% !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border: 2px solid #e2e8f0;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    flex-shrink: 0 !important;
    position: relative;
    overflow: hidden;
}

.preview-redes-sociales > a:hover,
.preview-redes-sociales > .preview-perfil-button:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.preview-redes-sociales > a i,
.preview-redes-sociales > .preview-perfil-button i {
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Sobre mí (idéntico a page_vcard.css) */
.preview-sobre-mi {
    margin: 25px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.preview-sobre-mi h2 {
    font-size: 18px;
    font-weight: 700;
    text-align: left;
    margin: 0 0 12px 0;
}

.preview-sobre-mi div,
.preview-sobre-mi p {
    line-height: 1.6;
    text-align: left;
    font-size: 14px;
    transition: color 0.3s ease;
}

.preview-contact {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.preview-info-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.preview-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
}

.preview-button {
    width: 100%;
    padding: 14px 25px;
    border-radius: 12px;
    border: 2px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
}

.preview-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.preview-button i {
    font-size: 1.1rem;
}

/* Estilos dinámicos para botones de vista previa */
.preview-btn-vcard,
.preview-perfil-button {
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.preview-items-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
}

.preview-items {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-img-icon.cell {
    display: inline-block;
}

.preview-redes-sociales {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 15px 0;
}

.preview-social {
    margin: 25px 0;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.preview-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    transition: color 0.3s ease;
}

.preview-social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.preview-social-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.preview-social-icon i {
    font-size: 1.2rem;
}

.preview-social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.preview-info-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border-left: 3px solid;
    transition: all 0.3s ease;
}

.preview-about {
    line-height: 1.6;
    margin: 0;
}

.preview-text {
    transition: color 0.3s ease;
}

.color-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.color-control {
    background: linear-gradient(to bottom, #ffffff, #fafbfc);
    padding: 22px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.color-control::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-control:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.12),
                0 0 0 1px rgba(102, 126, 234, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.color-control:hover::before {
    opacity: 1;
}

.color-control.full-width {
    grid-column: 1 / -1;
}

/* ==========================================
   ESTILOS DE BOTONES PRO
   ========================================== */

.button-styles-section {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 2px solid #667eea30;
    margin-top: 30px;
}

.subsection-title {
    font-size: 1.4rem;
    color: #1e293b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.subsection-title i {
    color: #667eea;
    font-size: 1.3rem;
}

.subsection-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.button-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.style-control {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    border: 2px solid #e2e8f0;
    transition: var(--transition);
}

.style-control:hover {
    border-color: #667eea;
    box-shadow: var(--shadow-light);
}

.style-control.full-width {
    grid-column: 1 / -1;
}

.style-control label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 15px;
    font-size: 1rem;
}

.style-control label i {
    color: #667eea;
}

.style-control select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.style-control select:hover {
    border-color: #667eea;
}

.style-control select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Selectores de Forma */
.button-shape-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.shape-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.shape-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.shape-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.shape-demo {
    width: 50px;
    height: 35px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: all 0.3s ease;
}

.shape-demo.rounded {
    border-radius: 8px;
}

.shape-demo.square {
    border-radius: 0;
}

.shape-demo.pill {
    border-radius: 50px;
}

.shape-demo.circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.shape-option span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.shape-option.active span {
    color: #667eea;
}

/* Selectores de Estilo Visual */
.button-style-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 1024px) {
    .button-style-selector {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .button-style-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

.visual-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.visual-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.visual-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.visual-demo {
    width: 50px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.visual-demo.solid {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
}

.visual-demo.outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
}

.visual-demo.shadow {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.visual-demo.glass {
    background: rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #667eea;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.visual-demo.gradient {
    background: linear-gradient(135deg, #667eea 0%, #4f5fd1 100%);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.visual-demo.neon {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5), 
                0 0 20px rgba(102, 126, 234, 0.4), 
                inset 0 0 10px rgba(102, 126, 234, 0.3);
    text-shadow: 0 0 8px #667eea;
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.5), 
                    0 0 20px rgba(102, 126, 234, 0.4), 
                    inset 0 0 10px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(102, 126, 234, 0.7), 
                    0 0 30px rgba(102, 126, 234, 0.6), 
                    inset 0 0 15px rgba(102, 126, 234, 0.5);
    }
}

.visual-demo.style-3d {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 0 #4f5fd1, 0 6px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.visual-demo.soft {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
    box-shadow: 8px 8px 16px rgba(102, 126, 234, 0.2), 
                -8px -8px 16px rgba(255, 255, 255, 0.8);
}

/* Efectos hover para los demos */
.visual-option:hover .visual-demo.neon {
    animation: neonPulse 1s ease-in-out infinite;
}

.visual-option:hover .visual-demo.gradient {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.visual-option:hover .visual-demo.style-3d {
    transform: translateY(-1px);
    box-shadow: 0 2px 0 #4f5fd1, 0 4px 8px rgba(102, 126, 234, 0.4);
}

.visual-option:hover .visual-demo.soft {
    box-shadow: 10px 10px 20px rgba(102, 126, 234, 0.25), 
                -10px -10px 20px rgba(255, 255, 255, 0.9);
}

.visual-option:hover .visual-demo.solid,
.visual-option:hover .visual-demo.shadow {
    transform: scale(1.05);
}

.visual-option:hover .visual-demo.outline {
    border-color: #764ba2;
    color: #764ba2;
    transform: scale(1.05);
}

.visual-option:hover .visual-demo.glass {
    backdrop-filter: blur(15px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.visual-option span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.visual-option.active span {
    color: #667eea;
}

/* Preview de Botones */
.button-preview-demo {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    border: 2px dashed #cbd5e1;
    margin-top: 20px;
}

.button-preview-demo label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1rem;
}

.button-preview-demo label i {
    color: #667eea;
}

.button-preview-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.demo-btn-primary,
.demo-btn-social {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.demo-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
}

.demo-btn-social {
    width: 50px;
    height: 50px;
    padding: 0;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 8px;
    font-size: 1.3rem;
}

.demo-btn-primary:hover,
.demo-btn-social:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Selector de Plano/Degradado */
.gradient-selector {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.gradient-option {
    flex: 1;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gradient-option:hover {
    background: #e9ecef;
    border-color: #cbd5e0;
}

.gradient-option.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.gradient-option i {
    font-size: 16px;
}

/* Controles de Degradado */
.gradient-controls {
    margin-top: 15px;
}

.gradient-colors-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.gradient-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.gradient-direction select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gradient-direction select:hover {
    border-color: #cbd5e0;
}

.gradient-direction select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-control label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 14px;
    letter-spacing: 0.2px;
    position: relative;
    padding-bottom: 8px;
}

.color-control label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.color-control label i {
    color: #667eea;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 6px;
    font-size: 0.9rem;
}

.color-input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.color-input-group input[type="color"] {
    width: 85px;
    height: 55px;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
                inset 0 1px 3px rgba(255, 255, 255, 0.5);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Webkit color swatch styling */
.color-input-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 9px;
}

.color-input-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 9px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Firefox color swatch styling */
.color-input-group input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 9px;
}

.color-input-group input[type="color"]:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25),
                0 0 0 4px rgba(102, 126, 234, 0.1),
                inset 0 1px 3px rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.02);
}

.color-input-group input[type="color"]:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2),
                0 0 0 3px rgba(102, 126, 234, 0.15),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-input-group input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3),
                0 0 0 4px rgba(102, 126, 234, 0.15),
                inset 0 1px 3px rgba(255, 255, 255, 0.5);
}

.color-hex {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.95rem;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    text-align: center;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    cursor: default;
    user-select: all;
}

.color-hex:hover {
    border-color: #cbd5e1;
    background: linear-gradient(to bottom, #ffffff, #f1f5f9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.color-hex:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15),
                0 0 0 3px rgba(102, 126, 234, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 1);
}

.color-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: #64748b;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03));
    border-left: 2px solid #667eea;
    border-radius: 6px;
    line-height: 1.5;
}

.color-hint i {
    color: #667eea;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Animación de selección para color-hex */
.color-hex.copied {
    animation: colorCopied 0.6s ease;
    border-color: #10b981;
}

@keyframes colorCopied {
    0% {
        background: linear-gradient(to bottom, #ffffff, #f8fafc);
    }
    50% {
        background: linear-gradient(to bottom, #d1fae5, #a7f3d0);
        transform: scale(1.02);
    }
    100% {
        background: linear-gradient(to bottom, #ffffff, #f8fafc);
        transform: scale(1);
    }
}

.reset-colors-container {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn-reset-colors {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-reset-colors:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
}

/* ==========================================
   LOADING Y ESTADOS
   ========================================== */
.loading-edit {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.loading-edit .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

.error-container {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
}

.error-container i {
    font-size: 3rem;
    color: #dc2626;
    margin-bottom: 20px;
}

.error-container h3 {
    color: #1e293b;
    margin-bottom: 10px;
}

.error-container p {
    color: #64748b;
    margin-bottom: 30px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-heavy);
    color: #1e293b;
}

.loading-content .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   RESPONSIVE PARA EDICIÓN
   ========================================== */
@media (max-width: 768px) {
    .edit-header-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .photos-grid {
        grid-template-columns: 1fr;
    }
    
    .fields-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        position: static;
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .photo-preview {
        width: 120px;
        height: 120px;
    }
    
    .upload-controls {
        flex-direction: row;
        gap: 8px;
        width: 100%;
    }
    
    .upload-btn,
    .delete-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .upload-btn {
        flex: 2;
    }
}

@media (max-width: 480px) {
    .edit-photos-section,
    .edit-section-group {
        padding: 20px 15px;
    }
    
    .fields-grid {
        gap: 15px;
    }
    
    .field-container input,
    .field-container textarea {
        padding: 10px 12px;
        font-size: 16px; /* Prevenir zoom en iOS */
    }
    
    .section-title {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Personalización móvil pequeño */
    .personalizacion-dos-columnas {
        padding: 12px;
        gap: 15px;
    }
    
    .preview-card-container {
        padding: 12px;
    }
    
    /* Vista previa móvil pequeño */
    .preview-perfil {
        border-radius: 12px;
        padding-bottom: 18px;
    }
    
    .preview-profile-container {
        width: 100px;
        padding-top: 18px;
    }
    
    .preview-profile-img {
        width: 100px;
        height: 100px;
    }
    
    .preview-profile-pic,
    .preview-img-perfil {
        width: 100px;
        height: 100px;
    }
    
    .preview-company-badge {
        width: 30px;
        height: 30px;
        bottom: -55px;
        right: calc(50% - 60px);
    }
    
    .preview-contenido {
        padding: 18px 12px;
    }
    
    .preview-names h1 {
        font-size: 1.2rem;
    }
    
    .preview-contenido h2 {
        font-size: 0.95rem;
        margin: 0 0 12px 0;
    }
    
    .preview-btn-vcard {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .preview-perfil-button {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    
    .controles-columna {
        padding: 15px 12px;
        gap: 15px;
    }
    
    .color-control {
        padding: 15px 12px;
    }
    
    .color-input-group input[type="color"] {
        width: 70px;
        height: 55px;
        border-radius: 10px;
    }
    
    .color-hex {
        font-size: 0.85rem;
        padding: 12px 10px;
        font-weight: 700;
    }
    
    .button-styles-section {
        padding: 15px 12px;
    }
    
    .button-shape-selector,
    .button-style-selector {
        gap: 8px;
    }
    
    .shape-option,
    .visual-option {
        padding: 12px 8px;
    }
    
    .demo-btn-primary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .demo-btn-social {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* Móvil - Vista Previa y Personalización */
@media (max-width: 768px) {
    /* Preview responsive */
    .preview-card {
        max-width: 100%;
    }
    
    .preview-card-container {
        padding: 15px;
        background: #f8fafc;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        overflow: hidden;
    }
    
    .preview-card-container h4 {
        font-size: 1.05rem;
        margin-bottom: 8px;
    }
    
    .preview-help {
        font-size: 0.8rem;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    /* Vista previa - tarjeta OPTIMIZADA para móvil */
    .preview-perfil {
        max-width: 100%;
        border-radius: 15px;
        padding-bottom: 20px;
    }
    
    .preview-profile-container {
        width: 120px;
        padding-top: 20px;
    }
    
    .preview-profile-img {
        width: 120px;
        height: 120px;
        border-width: 4px;
    }
    
    .preview-profile-pic,
    .preview-img-perfil {
        width: 120px;
        height: 120px;
    }
    
    .preview-company-badge {
        width: 35px;
        height: 35px;
        bottom: -65px;
        right: calc(50% - 70px);
    }
    
    .preview-company-badge img {
        width: 100%;
        height: 100%;
    }
    
    .preview-contenido {
        padding: 20px 15px;
        border-radius: 0 0 15px 15px;
    }
    
    .preview-names h1 {
        font-size: 1.3rem;
        margin: 10px 0 5px 0;
    }
    
    .preview-contenido h2 {
        font-size: 1rem;
        margin: 0 0 15px 0;
    }
    
    .preview-items-buttons {
        gap: 10px;
        margin: 20px 0;
    }
    
    .preview-btn-vcard {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .preview-btn-vcard i {
        font-size: 1rem;
        margin-right: 6px;
    }
    
    .preview-items {
        gap: 8px;
        margin: 15px 0;
        justify-content: center;
    }
    
    .preview-perfil-button {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .preview-section {
        margin: 25px 0 12px 0;
    }
    
    .preview-section h2 {
        font-size: 1.2rem;
    }
    
    .preview-img-icon {
        margin: 12px 0;
    }
    
    .preview-img-icon i {
        font-size: 1rem;
    }
    
    .preview-img-icon span {
        font-size: 0.9rem;
    }
    
    /* Personalización en móvil - MEJORADO */
    .personalizacion-dos-columnas {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 15px;
        background: #f8fafc;
        border-radius: 12px;
    }
    
    .preview-columna {
        order: -1 !important;
        margin-bottom: 0;
        background: white;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .controles-columna {
        gap: 18px;
        background: white;
        padding: 20px 15px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .preview-title {
        font-size: 1.2rem;
    }
    
    .preview-subtitle {
        font-size: 0.85rem;
    }
    
    .preview-avatar {
        width: 70px;
        height: 70px;
        margin-top: -35px;
    }
    
    .preview-body {
        padding: 45px 15px 20px 15px;
    }
    
    /* Controles de color OPTIMIZADOS para móvil */
    .color-controls-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .color-control {
        padding: 20px 16px;
        background: linear-gradient(to bottom, #ffffff, #fafbfc);
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }
    
    .color-control label {
        font-size: 0.95rem;
        font-weight: 700;
        margin-bottom: 12px;
    }
    
    .color-control label i {
        width: 20px;
        height: 20px;
        font-size: 0.85rem;
    }
    
    .color-input-group {
        flex-direction: row;
        gap: 12px;
    }
    
    .color-input-group input[type="color"] {
        width: 75px;
        height: 60px;
        border-width: 3px;
        border-radius: 12px;
        flex-shrink: 0;
    }
    
    .color-input-group input[type="color"]::-webkit-color-swatch-wrapper {
        padding: 0;
        border-radius: 9px;
    }
    
    .color-input-group input[type="color"]::-webkit-color-swatch {
        border: none;
        border-radius: 9px;
    }
    
    .color-input-group input[type="color"]:hover {
        transform: translateY(-1px) scale(1.02);
    }
    
    .color-input-group input[type="color"]:active {
        transform: translateY(0) scale(0.98);
    }
    
    .color-hex {
        flex: 1;
        padding: 14px 12px;
        font-size: 0.9rem;
        min-width: 0;
        font-weight: 700;
    }
    
    .color-hint {
        font-size: 0.75rem;
        margin-top: 10px;
    }
    
    /* Estilos de botones responsive - MEJORADO */
    .button-styles-section {
        padding: 18px 15px;
        margin-top: 20px;
        border-radius: 10px;
    }
    
    .subsection-title {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .subsection-description {
        font-size: 0.85rem;
        margin-bottom: 18px;
    }
    
    .button-style-grid {
        gap: 18px;
    }
    
    .style-control {
        margin-bottom: 15px;
    }
    
    .style-control label {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .button-shape-selector,
    .button-style-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .shape-option,
    .visual-option {
        padding: 15px 10px;
        font-size: 0.85rem;
    }
    
    .shape-option span,
    .visual-option span {
        font-size: 0.8rem;
        margin-top: 8px;
    }
    
    .shape-demo {
        width: 35px;
        height: 35px;
    }
    
    .visual-demo {
        width: 40px;
        height: 40px;
    }
    
    .button-preview-demo {
        padding: 18px 15px;
        background: #f8fafc;
        border-radius: 10px;
        margin-top: 15px;
    }
    
    .button-preview-demo label {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .button-preview-grid {
        gap: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .demo-btn-primary {
        padding: 14px 24px;
        font-size: 0.95rem;
        width: 100%;
        border-radius: 10px;
    }
    
    .demo-btn-social {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin: 0 auto;
        border-radius: 50%;
    }
    
    /* Select dropdowns en móvil */
    .style-control select {
        padding: 14px 12px;
        font-size: 0.95rem;
        border-width: 2px;
        border-radius: 8px;
    }
}

/* ==========================================
   TABS RESPONSIVE
   ========================================== */

/* Tablets y móvil - Tabs adaptados */
@media (max-width: 768px) {
    .edit-tabs {
        padding: 0 15px;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .edit-tab {
        padding: 12px 16px;
        font-size: 0.9rem;
        flex: 1;
        justify-content: center;
        text-align: center;
    }
    
    .edit-tab i {
        font-size: 1.2rem;
        margin-right: 6px;
    }
}

/* Móviles pequeños - Tabs en columna */
@media (max-width: 640px) {
    .edit-tabs {
        gap: 4px;
        padding: 0 10px;
    }
    
    .edit-tab {
        padding: 12px 8px;
        flex-direction: column;
        gap: 4px;
        font-size: 0.7rem;
        min-width: 70px;
        flex: 1;
    }
    
    .edit-tab i {
        margin: 0;
        font-size: 1.3rem;
    }
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-notification {
    position: fixed;
    top: 90px;
    right: -400px;
    min-width: 320px;
    max-width: 400px;
    background: white;
    padding: 18px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-left: 4px solid #667eea;
}

.toast-notification.show {
    right: 30px;
}

.toast-notification i {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-notification span {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #2d3748;
}

/* Tipos de Toast */
.toast-success {
    border-left-color: #38ef7d;
    background: linear-gradient(to right, #f0fdf4, white);
}

.toast-success i {
    color: #38ef7d;
}

.toast-error {
    border-left-color: #f56565;
    background: linear-gradient(to right, #fef2f2, white);
}

.toast-error i {
    color: #f56565;
}

.toast-info {
    border-left-color: #4facfe;
    background: linear-gradient(to right, #eff6ff, white);
}

.toast-info i {
    color: #4facfe;
}

.toast-warning {
    border-left-color: #fee140;
    background: linear-gradient(to right, #fffbeb, white);
}

.toast-warning i {
    color: #f59e0b;
}

/* Toast Responsive */
@media (max-width: 768px) {
    .toast-notification {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        top: 80px;
    }
    
    .toast-notification.show {
        right: 20px;
    }
}

/* ==========================================
   LOADING OVERLAY
   ========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-top: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    .dashboard-sidebar,
    .header-actions,
    .sidebar-toggle,
    .toast-notification,
    .loading-overlay {
        display: none !important;
    }
    
    .dashboard-main {
        margin-left: 0 !important;
    }
}