:root {
    --bg-dark: #09090b;
    --card-bg: #121216;
    --card-border: #27272a;
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;

    --neon-blue: #00f3ff;
    --neon-purple: #bd00ff;
    --neon-green: #00ff9d;
    --neon-pink: #ff0055;

    --glow-blue: 0 0 10px rgba(0, 243, 255, 0.5);
    --glow-purple: 0 0 10px rgba(189, 0, 255, 0.5);
    --glow-green: 0 0 10px rgba(0, 255, 157, 0.5);
    --glow-pink: 0 0 10px rgba(255, 0, 85, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    pointer-events: auto !important;
    position: relative;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200vh;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: var(--card-bg);
    border: 2px solid var(--neon-blue);
    border-radius: 16px;
    padding: 3rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.3);
}

.login-card .logo {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--neon-blue);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.error-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid var(--neon-pink);
    border-radius: 8px;
    color: var(--neon-pink);
    text-align: center;
}

/* Main Screen */
.main-screen {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.main-screen.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-main);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.version {
    font-size: 0.8rem;
    color: var(--neon-purple);
    margin-left: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background: transparent;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--neon-pink);
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .number {
    font-size: 3rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.bar-container {
    width: 100%;
    height: 4px;
    background: #27272a;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.bar {
    height: 100%;
    background: var(--text-main);
    width: 50%;
    transition: width 0.5s ease;
}

.bar.neon-blue {
    background: var(--neon-blue);
    box-shadow: var(--glow-blue);
}

.bar.neon-green {
    background: var(--neon-green);
    box-shadow: var(--glow-green);
}

.bar.neon-pink {
    background: var(--neon-pink);
    box-shadow: var(--glow-pink);
}

/* Progress Card */
.progress-card {
    margin-bottom: 2rem;
    overflow: visible;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 1.5rem;
    justify-content: flex-start;
    width: 100%;
}

.progress-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.3));
    flex-shrink: 0;
    order: 1;
}

.progress-ring {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.5));
}

.progress-ring-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 12;
    r: 90;
    cx: 100;
    cy: 100;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--card-border);
    stroke-width: 10;
    r: 90;
    cx: 100;
    cy: 100;
}

.progress-ring-circle.progress {
    stroke: var(--neon-green);
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.8));
    animation: progressPulse 2s ease-in-out infinite;
}

/* Animación de pulso para el círculo de progreso */
@keyframes progressPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(0, 243, 255, 0.8));
        stroke-width: 10;
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(0, 243, 255, 1));
        stroke-width: 11;
    }
}

/* Efecto de brillo animado */
.progress-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
    animation: glowPulse 3s ease-in-out infinite;
    opacity: 0;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    width: 100%;
    pointer-events: none;
}

.progress-percent-animated {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--neon-green);
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.8), 0 0 40px rgba(0, 243, 255, 0.4);
    transition: all 0.3s ease;
    animation: numberPulse 0.5s ease-out;
}

@keyframes numberPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.progress-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

@keyframes progressCelebrate {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.15) rotate(5deg);
    }
    50% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(1.15) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes highlightContact {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 243, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0);
    }
}

.notifications-panel {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notifications-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-left: 0;
    order: 2;
    flex: 1;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.progress-item .label {
    color: var(--text-muted);
}

.progress-item .value {
    color: var(--text-main);
    font-weight: 600;
}

/* Tabs */
.main-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    position: relative;
    z-index: 9999 !important;
    /* MUY ALTO para estar sobre todo */
    background: var(--bg-dark);
    padding-top: 0.5rem;
    pointer-events: auto !important;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    border-radius: 8px;
    position: relative;
    z-index: 10000 !important;
    /* MUY ALTO para estar sobre todo */
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(0, 243, 255, 0.3);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    border-bottom: 2px solid var(--neon-blue);
    border-radius: 8px 8px 0 0;
}

/* Tabs del modal de perfil (mejor toque en móviles) */
.profile-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.profile-tab-btn {
    min-height: 54px;
    padding: 0.9rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.2px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.profile-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.profile-tab-btn.active {
    color: var(--text-main);
    background: rgba(0, 243, 255, 0.12);
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 18px rgba(0, 243, 255, 0.2);
}

.profile-tab-subtitle {
    margin-bottom: 1.2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Views */
.view-section.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.view-section {
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.view-section.active {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toolbar */
.toolbar-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Buttons */
.action-btn {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    display: flex;
    gap: 1.5rem;
}

.filter-bar label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-main);
}

.filter-bar input[type="radio"] {
    cursor: pointer;
}

/* Contacts Grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
}

.contact-card:hover {
    border-color: var(--neon-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 243, 255, 0.2);
}

.contact-card.called {
    border-color: var(--neon-green);
    opacity: 0.7;
}

.contact-card.called::before {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    background: var(--neon-green);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.contact-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.contact-status {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.contact-status.pending {
    background: rgba(255, 0, 85, 0.2);
    color: var(--neon-pink);
    border: 1px solid var(--neon-pink);
}

.contact-status.called {
    background: rgba(0, 255, 157, 0.2);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
}

.contact-info {
    margin-bottom: 1rem;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contact-actions {
    display: flex;
    gap: 0.5rem;
}

.contact-info-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--card-border);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* No bloquea cuando está oculto */
}

.modal.hidden {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.modal:not(.hidden) {
    display: flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.modal-content {
    background: var(--card-bg);
    border: 2px solid var(--neon-blue);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 20001;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.3);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--neon-pink);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions .action-btn {
    flex: 1;
}

/* Stats Detail */
.stats-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Admin Dashboard - Advisors Grid */
.advisors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* Admin Dashboard - Advisor Progress Circle */
#admin-dashboard .advisor-progress-circle {
    position: relative;
    width: 150px;
    height: 150px;
    min-width: 150px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#admin-dashboard .advisor-progress-circle svg {
    width: 150px;
    height: 150px;
    display: block;
}

#admin-dashboard .advisor-progress-circle svg circle {
    transform-origin: center;
}

#admin-dashboard .advisor-progress-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.stat-detail-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1rem;
}

.stat-detail-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.stat-detail-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--neon-blue);
}

/* Toast */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: rgba(18, 18, 22, 0.95);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--neon-green);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.4s ease-out;
}

.toast.error {
    border-left-color: var(--neon-pink);
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast.info {
    border-left-color: var(--neon-blue);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Botón Listo: estado loading y estado done con animación */
.listo-loading {
    opacity: 0.8;
    pointer-events: none;
}
.listo-loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.5rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: listo-spin 0.7s linear infinite;
}
@keyframes listo-spin {
    to { transform: rotate(360deg); }
}
.listo-done {
    background: #059669 !important;
    border-color: #059669 !important;
}
.listo-done .listo-check {
    display: inline-block;
    animation: listo-check-pop 0.4s ease-out;
}
@keyframes listo-check-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h2 .icon {
    font-size: 1.5rem;
}

/* Vista Móvil: Tarjetas Secuenciales */
.mobile-cards-view {
    display: none;
    position: relative;
    width: 100%;
    height: calc(100vh - 180px);
    overflow: visible;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    z-index: 1;
}

.mobile-cards-container {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    padding: 0.5rem;
    overflow: visible;
    z-index: 1;
}

.cards-carousel {
    position: relative;
    width: 95%;
    max-width: 420px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    z-index: 1;
}

.mobile-contact-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    padding-bottom: 220px;
    /* Espacio MUY aumentado para botones fijos y todo el contenido */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    /* Asegurar que el contenido no se corte */
    min-height: 100%;
}

.mobile-contact-card.active {
    z-index: 10;
    transform: translateX(0) scale(1);
    opacity: 1;
}

/* Asegurar que todo el contenido dentro de las tarjetas sea visible */
.mobile-contact-card > * {
    position: relative;
    z-index: 2;
}

.mobile-contact-card a,
.mobile-contact-card span,
.mobile-contact-card div {
    position: relative;
    z-index: 2;
}

.mobile-contact-card.prev {
    transform: translateX(-100%) scale(0.9);
    opacity: 0.3;
    pointer-events: none;
}

.mobile-contact-card.next {
    transform: translateX(100%) scale(0.9);
    opacity: 0.3;
    pointer-events: none;
}

.mobile-contact-card.hidden {
    display: none;
}

.card-number-badge {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    background: var(--neon-blue) !important;
    color: #000 !important;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    z-index: 100;
}

/* Navegación arriba (pequeña) */
.cards-navigation-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(18, 18, 22, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 500;
    /* Menor que las pestañas (9999) pero suficiente para estar sobre contenido */
    margin-bottom: 0.5rem;
    pointer-events: auto;
}

.nav-card-btn-small {
    padding: 0.4rem 0.8rem;
    background: var(--neon-blue);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-card-btn-small:hover {
    background: var(--neon-green);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.4);
}

.nav-card-btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0, 243, 255, 0.3);
}

.card-counter-small {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--neon-blue);
    text-align: center;
    min-width: 60px;
    padding: 0.3rem 0.6rem;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.3);
}

/* Botones de acción fijos en tarjetas móviles */
.mobile-card-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    /* Oculto por defecto */
    gap: 0.5rem;
    padding: 0.8rem;
    background: rgba(9, 9, 11, 0.98);
    backdrop-filter: blur(20px);
    border-top: 2px solid var(--card-border);
    z-index: 1000;
    /* Z-index reducido para no interferir con el contenido */
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    /* Asegurar que no tape el contenido */
    max-height: 90px;
}

/* Mostrar botones fijos solo cuando estamos en vista de contactos activa */
#view-contacts.active .mobile-card-actions,
.view-section.active#view-contacts .mobile-card-actions {
    display: flex !important;
}

/* Ocultar botones fijos cuando no estamos en vista de contactos */
.view-section:not(#view-contacts) .mobile-card-actions,
.view-section.hidden .mobile-card-actions,
#view-contacts.hidden .mobile-card-actions {
    display: none !important;
    pointer-events: none !important;
}

.mobile-action-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.mobile-call-btn {
    background: var(--neon-green);
    color: #000;
}

.mobile-call-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 25px rgba(0, 255, 157, 0.6);
}

.mobile-mark-btn {
    background: var(--neon-blue);
    color: #000;
}

.mobile-mark-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
}

.btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.btn-text {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Navegación abajo (oculta, por si se necesita) */
.cards-navigation {
    display: none;
}



/* Transiciones de tarjetas */
@keyframes slideOutLeft {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(-100%) scale(0.8);
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.mobile-contact-card.slide-out-left {
    animation: slideOutLeft 0.4s ease-out forwards;
}

.mobile-contact-card.slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.mobile-contact-card.slide-out-right {
    animation: slideOutRight 0.4s ease-out forwards;
}

.mobile-contact-card.slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

/* Responsive - Mejoras completas para móvil */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: rgba(0, 243, 255, 0.2);
    }

    .container {
        padding: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Header responsive */
    header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 9998;
        background: var(--bg-dark);
        backdrop-filter: blur(10px);
    }

    .logo {
        font-size: 1.2rem;
    }

    .user-info {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .logout-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Tabs mejorados para móvil */
    .main-tabs {
        position: sticky;
        top: 0;
        z-index: 9999 !important;
        background: var(--bg-dark);
        padding: 0.5rem;
        margin-bottom: 0;
        border-bottom: 2px solid var(--card-border);
        display: flex;
        justify-content: space-around;
        gap: 0.5rem;
    }

    .tab-btn {
        z-index: 10000 !important;
        pointer-events: auto !important;
        min-height: 50px;
        min-width: 0;
        flex: 1;
        padding: 0.7rem 0.5rem;
        font-size: 0.9rem;
        -webkit-tap-highlight-color: rgba(0, 243, 255, 0.4);
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
    }

    .tab-btn span {
        display: none;
        /* Ocultar emojis en móvil para más espacio */
    }

    /* Stats grid responsive */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0.8rem;
    }

    .stat-card {
        padding: 1rem 0.8rem;
        min-height: auto;
    }

    .stat-card h3 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .stat-card .number {
        font-size: 1.8rem;
    }

    .stat-card .stat-subtitle {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }

    /* Progress card responsive */
    .progress-card {
        padding: 1.5rem 1rem 2rem 1rem;
        margin: 0.8rem;
        overflow: visible !important;
    }

    .progress-card h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .progress-info {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        width: 100%;
        padding: 0.5rem 0;
        overflow: visible;
    }

    .progress-circle {
        width: 150px !important;
        height: 150px !important;
        margin: 0.5rem auto !important;
        position: relative;
        overflow: visible !important;
        padding: 10px;
        box-sizing: content-box;
    }
    
    .progress-ring {
        width: 150px !important;
        height: 150px !important;
        display: block;
        overflow: visible !important;
    }

    .progress-details {
        text-align: center;
        margin-left: 0 !important;
        width: 100%;
        align-self: stretch;
    }
    
    .progress-percent-animated {
        font-size: 1.8rem !important;
    }
    
    .progress-label {
        font-size: 0.75rem !important;
    }
    
    .progress-glow {
        width: 140px !important;
        height: 140px !important;
    }

    /* Admin dashboard cards responsive */
    #admin-dashboard .card {
        padding: 1rem 0.8rem;
        margin: 0.8rem;
    }

    #admin-dashboard .card h3 {
        font-size: 1.1rem;
    }
    
    .advisors-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    #admin-dashboard .card > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.8rem;
    }

    #admin-dashboard .card > div[style*="display: flex"] {
        flex-direction: column;
        gap: 1rem;
    }

    /* Advisor dashboard responsive */
    .advisor-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .advisor-progress-section {
        flex-direction: column !important;
        gap: 1rem;
    }

    .advisor-progress-circle {
        width: 120px !important;
        height: 120px !important;
        min-width: 120px !important;
        margin: 0 auto;
    }

    .advisor-progress-circle svg {
        width: 120px !important;
        height: 120px !important;
    }

    .advisor-progress-details {
        margin-left: 0 !important;
        text-align: center;
    }

    .advisor-summary-grid {
        grid-template-columns: 1fr !important;
        gap: 0.6rem;
    }

    /* Vista de contactos móvil */
    .contacts-grid,
    .toolbar-card {
        display: none !important;
    }

    .mobile-cards-view {
        display: flex !important;
    }
}

/* Banner de Celebración por 100% */
.celebration-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease-in-out;
}

.celebration-banner.hidden {
    display: none;
    animation: fadeOut 0.5s ease-in-out;
}

.celebration-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #FFD700;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(255, 215, 0, 0.5),
                0 0 100px rgba(102, 126, 234, 0.6),
                inset 0 0 30px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: slideInBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.celebration-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.celebration-title {
    color: #FFD700;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 0 1rem 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                 0 0 40px rgba(255, 215, 0, 0.6),
                 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

.celebration-message {
    color: white;
    font-size: 1.3rem;
    line-height: 1.6;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.celebration-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.celebration-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: scale(1.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInBounce {
    0% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(20px) scale(1.05);
    }
    70% {
        transform: translateY(-10px) scale(0.98);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive para el banner */
@media (max-width: 768px) {
    .celebration-content {
        padding: 2rem 1.5rem;
        max-width: 95%;
    }
    
    .celebration-emoji {
        font-size: 3rem;
    }
    
    .celebration-title {
        font-size: 2rem;
    }
    
    .celebration-message {
        font-size: 1.1rem;
    }
        flex-direction: column;
        height: calc(100vh - 200px);
        min-height: 500px;
        position: relative;
        overflow: visible;
        z-index: 1;
    }

    /* Navegación de tarjetas mejorada */
    .cards-navigation-top {
        padding: 0.6rem 1rem;
        background: rgba(18, 18, 22, 0.95);
        backdrop-filter: blur(15px);
        border-bottom: 2px solid var(--card-border);
        position: sticky;
        top: 0;
        z-index: 500;
        margin-bottom: 0;
    }

    .nav-card-btn-small {
        min-width: 50px;
        min-height: 44px;
        font-size: 1.2rem;
        padding: 0.5rem;
    }

    .card-counter-small {
        font-size: 1rem;
        font-weight: 700;
        min-width: 60px;
    }

    /* Tarjetas móviles mejoradas */
    .mobile-cards-container {
        flex: 1;
        overflow: visible;
        padding: 0.5rem;
        z-index: 1;
    }

    .mobile-contact-card {
        padding: 1.5rem;
        padding-bottom: 250px;
        /* Espacio MUY aumentado para botones fijos y todo el contenido detallado */
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        max-height: 100%;
        box-sizing: border-box;
        min-height: 100%;
        /* Asegurar que el contenido no se corte */
    }

    .mobile-contact-card h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    /* Botones de acción fijos mejorados */
    .mobile-card-actions {
        z-index: 1000;
        padding: 1rem;
        gap: 0.8rem;
        display: flex !important;
        max-height: 100px;
    }

    .mobile-action-btn {
        padding: 1.2rem;
        font-size: 1rem;
        min-height: 56px;
        flex: 1;
        border-radius: 16px;
        font-weight: 700;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }

    .btn-icon {
        font-size: 1.3rem;
    }

    .btn-text {
        font-size: 0.95rem;
    }

    .mobile-contact-card a,
    .mobile-contact-card button {
        -webkit-user-select: auto;
    }
}

/* Burbujas flotantes universales (Móvil y Desktop) */
.floating-stats {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    /* Asegurar que esté sobre todo */
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.floating-stats.hidden {
    opacity: 0;
    transform: translateX(100px);
    pointer-events: none;
}

.floating-bubble {
    background: rgba(18, 18, 22, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid var(--neon-blue);
    border-radius: 20px;
    padding: 1rem;
    min-width: 130px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 243, 255, 0.3);
    animation: floatBubble 3s ease-in-out infinite;
    pointer-events: auto;
    transition: all 0.3s;
}

.floating-bubble:nth-child(2) {
    animation-delay: 0.5s;
    border-color: var(--neon-green);
    box-shadow: 0 8px 32px rgba(0, 255, 157, 0.3);
}

.floating-bubble:nth-child(3) {
    animation-delay: 1s;
    border-color: var(--neon-pink);
    box-shadow: 0 8px 32px rgba(255, 0, 85, 0.3);
}

.bubble-icon {
    font-size: 2rem;
    line-height: 1;
}

.bubble-content {
    flex: 1;
}

.bubble-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.bubble-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--neon-blue);
    line-height: 1;
}

.bubble-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Colores específicos por ID */
#calls-bubble {
    border-color: var(--neon-blue);
}

#calls-bubble .bubble-value {
    color: var(--neon-blue);
}

#contacts-bubble {
    border-color: var(--neon-green);
}

#contacts-bubble .bubble-value {
    color: var(--neon-green);
}

#sales-bubble {
    border-color: var(--neon-pink);
}

#sales-bubble .bubble-value {
    color: var(--neon-pink);
}

@media (max-width: 768px) {

    /* Progress card responsive */
    /* Progress card responsive - Tablet/Mobile */
    .progress-card {
        overflow: visible !important;
    }
    
    .progress-info {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        width: 100%;
        padding: 0.5rem 0;
        overflow: visible;
    }
    
    .progress-circle {
        order: 1 !important;
        width: 180px !important;
        height: 180px !important;
        margin: 0.5rem auto !important;
        overflow: visible !important;
        padding: 10px;
        box-sizing: content-box;
    }
    
    .progress-ring {
        width: 180px !important;
        height: 180px !important;
        overflow: visible !important;
    }
    
    .progress-details {
        order: 2 !important;
        width: 100%;
        margin-left: 0 !important;
        text-align: center;
    }
    
    .progress-percent-animated {
        font-size: 2rem !important;
    }
    
    .progress-glow {
        width: 160px !important;
        height: 160px !important;
    }

    /* Modales responsive */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem;
    }

    /* Cards responsive */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Formularios responsive */
    .form-group {
        margin-bottom: 1rem;
    }

    input,
    textarea,
    select {
        font-size: 16px !important;
        /* Evita zoom en iOS */
        padding: 0.8rem;
    }

    /* Mejoras de scroll */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Evitar selección accidental */
    .mobile-contact-card {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    .mobile-contact-card a,
    .mobile-contact-card button {
        -webkit-user-select: auto;
        user-select: auto;
    }
}

@media (min-width: 769px) {
    .mobile-cards-view {
        display: none !important;
    }

    /* floating-stats ya no se oculta aquí */
}

/* Ajuste: permitir click en todas las filas de botones móviles */
.mobile-card-actions {
    max-height: none;
    height: auto;
    overflow: visible;
    z-index: 12000;
}

.mobile-contact-card {
    padding-bottom: 320px;
}

@media (max-width: 768px) {
    .mobile-contact-card {
        padding-bottom: 340px;
    }

    .mobile-card-actions {
        max-height: none;
        height: auto;
        overflow: visible;
        z-index: 12000;
    }
}