/* =========================================
   PATIENT HUB - LUMINAM PREMIUM STYLES
   ========================================= */

:root {
    /* Colores Disney / Luminam */
    --primary-color: #002B49; /* Azul Profundo Corporativo */
    --accent-color: #00AEEF; /* Cian Luminam */
    --accent-color-hover: #0088cc;
    --secondary-accent: #2ECC71; /* Verde Saludable */
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    
    /* Superficies Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(0, 43, 73, 0.07);
    
    /* Texto */
    --text-primary: #1A1A1A;
    --text-secondary: #5a6b7c;
    --text-white: #ffffff;
    
    /* Variables Geometría */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --radius-pill: 50px;
}

/* =========================================
   RESET & TIPOGRAFÍA
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: #f0f4f8; /* Color de fallback */
    overflow-x: hidden;
    padding-bottom: 100px; /* Espacio para el bottom nav */
}

h1, h2, h3, h4, h5 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    font-weight: 700;
}

/* =========================================
   BACKGROUND AURA (Efecto Mágico)
   ========================================= */
.background-aurora {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: #f4f7f6;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%; left: -10%;
    width: 60vw; height: 60vw;
    background: rgba(0, 174, 239, 0.4);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%; right: -10%;
    width: 70vw; height: 70vw;
    background: rgba(46, 204, 113, 0.3);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%; left: 60%;
    width: 40vw; height: 40vw;
    background: rgba(0, 43, 73, 0.2);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 40px) scale(1.1); }
    100% { transform: translate(-30px, -20px) scale(0.9); }
}

/* =========================================
   GLASSMORPHISM UTILITIES
   ========================================= */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.premium-shadow {
    box-shadow: 0 12px 40px rgba(0, 43, 73, 0.12);
}

/* =========================================
   HEADER & USER PILL
   ========================================= */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-container img {
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.brand-text {
    font-family: 'Outfit';
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 6px 16px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.9);
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-info .user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
}

.user-info .user-id {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 174, 239, 0.3);
    border: 2px solid white;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar:hover, .avatar:active {
    transform: scale(1.1);
}

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

.avatar-text {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.9rem;
    font-family: 'Outfit';
}

/* =========================================
   LAYOUT & SECTIONS
   ========================================= */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 15px;
}

.app-section {
    display: none;
}
.app-section.active {
    display: block;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.section-header {
    margin-bottom: 24px;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* =========================================
   HERO CARD (Viaje del Paciente)
   ========================================= */
.hero-card {
    background: linear-gradient(135deg, rgba(0, 43, 73, 0.95) 0%, rgba(0, 114, 188, 0.9) 100%);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
    color: var(--text-white);
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.1);
}

.hero-card::after {
    content: '\f06e';
    font-family: 'Font Awesome 6 Free';
    position: absolute;
    right: -20px;
    bottom: -40px;
    font-size: 10rem;
    opacity: 0.04;
    color: white;
    transform: rotate(-15deg);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.greeting {
    color: white;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.subtitle {
    font-weight: 300;
    font-size: 0.95rem;
    opacity: 0.9;
}

.highlight {
    font-weight: 700;
    color: #48dbfb; /* Resalte brillante */
}

/* Journey Timeline */
.journey-timeline {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    position: relative;
    z-index: 2;
}

.timeline-line {
    position: absolute;
    top: 15px; left: 10%; right: 10%;
    height: 2px;
    background: rgba(255,255,255,0.2);
    z-index: -1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 25%;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.step.completed {
    opacity: 1;
}
.step.active {
    opacity: 1;
}

.step-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    font-size: 0.8rem; font-weight: bold;
    color: white;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.step.completed .step-circle {
    background: var(--secondary-accent);
    color: white;
}

.step.active .step-circle {
    background: var(--accent-color);
    border-color: white;
    box-shadow: 0 0 15px rgba(0, 174, 239, 0.6);
    transform: scale(1.15);
}

.step span {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* =========================================
   NPS WIDGET
   ========================================= */
.nps-widget {
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid var(--accent-color);
}

.widget-title {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 15px;
}

.faces-container {
    display: flex;
    justify-content: space-around;
    padding: 0 10px;
}

.face-btn {
    font-size: 2.2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(1) opacity(0.5);
    transform: scale(1);
}

.face-btn:hover {
    transform: scale(1.1);
}

.face-btn.selected {
    filter: grayscale(0) opacity(1);
    transform: scale(1.3) translateY(-5px);
    text-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* =========================================
   CARDS GENERALES
   ========================================= */
.card {
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card.interactive {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card.interactive:hover, .card.interactive:active {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,43,73,0.1);
}

.card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: white;
    flex-shrink: 0;
}

.card-text {
    flex: 1;
}

.card-text strong {
    font-size: 1rem; color: var(--primary-color); display: block;
}
.card-text p {
    font-size: 0.8rem; color: var(--text-secondary); margin-top: 3px; line-height: 1.3;
}

.chevron {
    color: #ccc;
    font-size: 1.2rem;
    transition: transform 0.3s;
}
.card.interactive:hover .chevron {
    transform: translateX(3px);
    color: var(--accent-color);
}

.gradient-bg {
    background: linear-gradient(135deg, var(--accent-color), #00d2ff);
}

/* =========================================
   FORMULARIOS (Invitadología)
   ========================================= */
.form-card {
    padding: 20px;
}

.form-label {
    display: block;
    font-family: 'Outfit';
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1rem;
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.glass-input {
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s;
}

.glass-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
}

.custom-select-wrapper {
    position: relative;
}
.custom-select-wrapper::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute; right: 15px; top: 15px;
    color: var(--primary-color); pointer-events: none;
}
.custom-select {
    appearance: none;
}

/* Range Slider */
.range-slider-container {
    padding: 10px 0;
}
.custom-range {
    -webkit-appearance: none;
    width: 100%; height: 6px;
    background: #e0e6ed; border-radius: 5px; outline: none;
}
.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}
.custom-range::-webkit-slider-thumb:active {
    transform: scale(1.2);
}
.range-labels {
    display: flex; justify-content: space-between;
    margin-top: 12px; font-size: 0.75rem; color: var(--text-secondary); font-weight: 600;
}
.range-val {
    font-size: 1.2rem;
    color: var(--accent-color);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-family: 'Outfit';
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(0, 43, 73, 0.2);
}
.btn-primary:active {
    transform: scale(0.98);
}
.glints-effect::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: glint 3s infinite;
}
@keyframes glint {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* =========================================
   BITÁCORA (Dashboard)
   ========================================= */

    /* Estilos mejorados para el Banner de Prueba / Admin */
    .trial-banner {
        margin-top: 10px;
        margin-bottom: 25px !important;
        position: relative;
        z-index: 10;
    }

    /* Tarjeta de Próxima Cita (WOW Effect) */
    .next-appt-card {
        background: white;
        border-radius: var(--radius-md);
        padding: 20px;
        margin-bottom: 24px;
        border-left: 4px solid var(--secondary-accent);
        display: flex;
        align-items: center;
        gap: 15px;
        box-shadow: var(--glass-shadow);
        animation: slideUpCustom 0.5s ease-out;
    }

    .next-appt-icon {
        width: 50px;
        height: 50px;
        background: rgba(46, 204, 113, 0.1);
        border-radius: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: var(--secondary-accent);
    }

.card-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 12px; margin-bottom: 12px;
}
.card-header strong { color: var(--primary-color); font-family: 'Outfit'; }
.badge {
    padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 700;
}
.badge-primary { background: rgba(0, 174, 239, 0.1); color: var(--accent-color); }

.med-item {
    display: flex; align-items: center; gap: 15px; padding: 12px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}
.med-item:last-child { border-bottom: none; padding-bottom: 0; }
.med-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.bg-cyan-light { background: rgba(0,174,239,0.1); }
.text-cyan { color: var(--accent-color); }
.bg-green-light { background: rgba(46,204,113,0.1); }
.text-green { color: var(--secondary-accent); }

.med-info flex { flex: 1; }
.med-info strong { display: block; font-size: 0.95rem; color: var(--text-primary); }
.med-info p { font-size: 0.75rem; color: var(--text-secondary); margin: 2px 0 0 0; }

.btn-check {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid #ddd; background: transparent; color: transparent;
    cursor: pointer; transition: 0.3s;
}
.btn-check.checked {
    background: var(--secondary-accent); border-color: var(--secondary-accent); color: white;
}

/* Vídeo Educación */
.video-thumbnail {
    position: relative; height: 160px; width: 100%;
}
.video-thumbnail img {
    width: 100%; height: 100%; object-fit: cover;
}
.play-overlay {
    position: absolute; inset: 0; background: rgba(0,43,73,0.3);
    display: flex; align-items: center; justify-content: center;
}
.play-btn-pulse {
    width: 50px; height: 50px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-color); font-size: 1.2rem;
    box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
    animation: pulse-white 2s infinite;
}
@keyframes pulse-white {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.duration-badge {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.7); color: white; padding: 3px 8px;
    border-radius: 4px; font-size: 0.7rem; font-weight: 600;
}

/* =========================================
   LUMIBOT (CHAT)
   ========================================= */
.chat-container {
    height: calc(100vh - 200px);
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--radius-md);
}
.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex; align-items: center; gap: 15px;
}
.bot-avatar .avatar-img {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.4rem;
}
.online-indicator {
    position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px;
    background: var(--secondary-accent); border: 2px solid white; border-radius: 50%;
}
.bot-info h3 { margin: 0; font-size: 1.1rem; }
.bot-info span { font-size: 0.75rem; color: var(--text-secondary); }

.chat-body {
    flex: 1; padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 15px;
}
.msg { display: flex; flex-direction: column; max-width: 85%; }
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; align-items: flex-end; }

.msg-bubble {
    padding: 12px 16px; border-radius: 18px; font-size: 0.95rem; line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.bot .msg-bubble { background: white; border-bottom-left-radius: 4px; color: var(--text-primary); }
.user .msg-bubble { background: var(--primary-color); color: white; border-bottom-right-radius: 4px; }

.msg-time { font-size: 0.65rem; color: #999; margin-top: 4px; margin-left: 5px; margin-right: 5px; }

.chat-input-area {
    padding: 15px; display: flex; gap: 10px; align-items: center;
    background: rgba(255,255,255,0.5);
}
.full-width { flex: 1; margin: 0; border-radius: var(--radius-pill); }
.btn-send {
    width: 48px; height: 48px; border-radius: 50%; border: none;
    color: white; font-size: 1.1rem; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,174,239,0.3); transition: transform 0.2s;
}
.btn-send:active { transform: scale(0.9); }

/* =========================================
   BOTTOM NAVIGATION
   ========================================= */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    display: flex; justify-content: space-around;
    padding: 12px 0 20px 0; /* Padding bottom for iPhone indicator */
    border-radius: 25px 25px 0 0;
    z-index: 2000;
}
.nav-item {
    background: transparent; border: none;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 25%; cursor: pointer; color: var(--text-secondary);
    transition: all 0.3s;
}
.nav-icon {
    font-size: 1.3rem; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}
.nav-item span { font-size: 0.7rem; font-weight: 500; transition: color 0.3s; }

.nav-item.active { color: var(--primary-color); }
.nav-item.active .nav-icon {
    color: var(--accent-color);
    transform: translateY(-5px) scale(1.1);
}
.nav-item.active .nav-icon::after {
    content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--accent-color);
}

/* =========================================
   MODALS Y UTILIDADES
   ========================================= */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,43,73,0.6);
    backdrop-filter: blur(5px); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
    width: 90%; max-width: 350px; padding: 30px 25px;
    border-radius: var(--radius-lg); position: relative;
}
.close-modal {
    position: absolute; top: 15px; right: 15px;
    background: #eee; border: none; width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; color: #666; transition: 0.2s;
}
.close-modal:hover { background: #ddd; }

.qr-code-wrapper {
    background: white; padding: 15px; border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); position: relative;
    overflow: hidden; width: fit-content; margin: 0 auto;
}
.qr-code-wrapper img { display: block; width: 200px; height: 200px; }
.scanner-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 3px;
    background: rgba(46,204,113,0.8); box-shadow: 0 0 10px rgba(46,204,113,0.8);
    animation: scan 2.5s infinite linear;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.85rem; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 20px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 24px; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 16px; }
.d-flex { display: flex; }
.d-block { display: block; }
.justify-between { justify-content: space-between; }
.border-bottom { border-bottom: 1px solid rgba(0,0,0,0.05); }
.pb-2 { padding-bottom: 10px; }

/* Toast */
.toast-notification {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-200%);
    padding: 12px 24px; border-radius: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 700; color: var(--text-primary);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
    z-index: 99999; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-notification.show { transform: translateX(-50%) translateY(0); }

/* =========================================
   ANIMACIONES GENERALES
   ========================================= */
.zoom-in { animation: zoomIn 0.5s ease-out forwards; }
.slide-up { animation: slideUpCustom 0.5s ease-out both; }
.slide-down { animation: slideDown 0.5s ease-out both; }
.fade-in { animation: fadeIn 0.4s ease-out both; }
.bounce-in { animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
.enter-left { animation: enterLeft 0.4s ease-out both; }

/* Stagger List (Cascada) */
/* =========================================
   NUEVOS MÓDULOS: CALENDARIO & CRM
   ========================================= */

/* Calendario */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    width: 100%;
    margin-top: 15px;
    background: transparent;
}

.calendar-weekday {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 10px 0;
    text-align: center;
    opacity: 0.6;
}

.calendar-day {
    aspect-ratio: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    position: relative;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.calendar-day:hover {
    background: rgba(0, 174, 239, 0.1);
    border-color: var(--accent-color);
    transform: scale(1.05);
    z-index: 2;
}

.calendar-day.empty {
    background: transparent !important;
    border: none !important;
    cursor: default !important;
    opacity: 0;
    pointer-events: none;
}

.calendar-day span {
    z-index: 1;
}

.calendar-day.active {
    background: var(--accent-color) !important;
    color: white !important;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 174, 239, 0.4);
}

.calendar-day.blocked {
    background: rgba(255, 59, 48, 0.08) !important;
    color: #ff3b30 !important;
    border: 1px dashed rgba(255, 59, 48, 0.3);
}

.calendar-day.blocked::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    background: #ff3b30;
    border-radius: 50%;
}

.calendar-day.disabled {
    opacity: 0.2;
    cursor: not-allowed !important;
    filter: grayscale(1);
}

.modal-content.patient-record {
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 24px;
}

.patient-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.info-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Agenda Bloqueada */
.calendar-day.blocked {
    background: rgba(255, 59, 48, 0.1) !important;
    color: #ff3b30 !important;
    position: relative;
    cursor: not-allowed;
}

.calendar-day.blocked::after {
    content: '\f05e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.5rem;
}

.admin-mode .calendar-day {
    cursor: pointer;
}

.admin-mode .calendar-day:hover {
    border: 1px solid var(--accent-color);
}
.calendar-day.active {
    background: var(--accent-color);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 174, 239, 0.3);
}
.calendar-day.today {
    border-color: var(--accent-color);
    color: var(--accent-color);
    font-weight: 700;
}
.calendar-day.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}
.time-slot {
    padding: 10px;
    text-align: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.05);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.time-slot:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.time-slot.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* CRM & Admin */
.stats-card h3 {
    margin: 5px 0 0 0;
    font-size: 1.5rem;
}
.crm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: background 0.2s;
}
.crm-row:hover {
    background: rgba(0, 174, 239, 0.03);
}
.crm-row .avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.crm-info {
    flex: 1;
}
.crm-info strong {
    font-size: 0.9rem;
    display: block;
}
.crm-info span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Badge System */
.badge-accent {
    background: var(--accent-color);
    color: white;
}

/* Chat Badge */
.chat-badge-container {
    position: relative;
}
.chat-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid white;
    font-weight: 800;
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.w-full { width: 100%; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 24px; }
.p-4 { padding: 24px !important; }
.text-xs { font-size: 0.7rem; }
.scrollable { overflow-y: auto; }
.glass-border-bottom { border-bottom: 1px solid rgba(0,0,0,0.05); }
.full-width { width: 100%; }

/* Animations Re-definition for consistency */
@keyframes slideUpCustom {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-slide-up { animation: slideUpCustom 0.5s ease-out forwards; }
.stagger-list > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-list > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-list > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-list > *:nth-child(4) { animation-delay: 0.4s; }

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideUpCustom {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes enterLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(0, 174, 239, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 174, 239, 0); }
}
.pulse .step-circle { animation: pulse 2s infinite; }

/* =========================================
   NUEVOS ESTILOS (Fase 2)
   ========================================= */

/* Onboarding Overlay */
.onboarding-overlay {
    position: fixed; inset: 0; background: rgba(0,43,73,0.85);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    transition: opacity 0.4s ease;
}
.onboarding-content {
    width: 90%; max-width: 400px; padding: 30px;
    border-radius: var(--radius-lg); position: relative;
    background: rgba(255,255,255,0.9);
}
.onboarding-step { display: none; }
.onboarding-step.active { display: block; }

/* Auth Overlay */
.auth-overlay {
    position: fixed; inset: 0; background: rgba(0,43,73,0.85);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    transition: opacity 0.4s ease;
}
.auth-box {
    width: 90%; max-width: 400px; padding: 30px;
    border-radius: var(--radius-lg); position: relative;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.blur-target { filter: blur(8px); pointer-events: none; transition: filter 0.5s; }

/* Clínica y Políticas */
.border-warning { border-left: 4px solid var(--warning-color); }
.text-warning { color: var(--warning-color); }
.text-orange { color: #d35400; }
.text-danger { color: var(--danger-color); }

.policy-list { list-style: none; padding: 0; margin-top: 15px; }
.policy-list li {
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed rgba(0,0,0,0.05);
}
.policy-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.policy-list i { font-size: 1.2rem; margin-top: 2px; }

/* =========================================
   UTILIDADES ADICIONALES
   ========================================= */
.hidden { display: none !important; }

.flex-1 { flex: 1; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* =========================================
   ESTILOS CALENDARIO DINÁMICO (PROFESIONAL)
   ========================================= */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.month-title {
    font-family: 'Outfit';
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-icon:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.2);
}

.calendar-day.empty {
    cursor: default;
    background: transparent !important;
    border: none !important;
}


.calendar-day.empty:hover {
    background: transparent !important;
}

/* Typing Indicator for AI Contextual Feel */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    width: fit-content;
    margin-bottom: 5px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* =========================================
   SISTEMA DE QR Y ESCÁNER
   ========================================= */
#qr-reader {
    border: 2px dashed rgba(255,255,255,0.3) !important;
    background: #000 !important;
    border-radius: 15px !important;
    overflow: hidden;
    position: relative;
    border: none !important;
}

#qr-reader__scan_region {
    background: #000 !important;
}

#qr-reader__dashboard {
    padding: 15px !important;
    background: rgba(255,255,255,0.05) !important;
    backdrop-filter: blur(10px);
}

#qr-reader__dashboard_section_csr button {
    background: #00AEEF !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    font-family: 'Outfit', sans-serif !important;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

#qr-reader__dashboard_section_csr button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 174, 239, 0.4);
}

/* Forzar visualización de modales activos */
.modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

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

.qr-code-wrapper img {
    display: block;
    margin: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* === ADMIN SUB-NAV NEW STYLING === */
.admin-subnav {
    display: flex;
    gap: 8px;
    padding: 8px;
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.subnav-item {
    background: transparent;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* CHAT WINDOW */
.chat-window {
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    max-height: 720px;
    max-width: 860px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
    box-shadow: 0 16px 45px rgba(0, 43, 73, 0.1);
}

.chat-header {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.subnav-item:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-dark);
    transform: translateY(-1px);
}

.subnav-item.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 174, 239, 0.3);
}

/* Appointment management icons */
.appt-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(0,0,0,0.05);
    border: none;
    color: var(--text-dark);
}

.btn-icon:hover {
    background: rgba(0,0,0,0.1);
    transform: scale(1.05);
}

.btn-icon.delete:hover {
    background: rgba(255, 69, 58, 0.1);
    color: #ff453a;
}

.btn-icon.edit:hover {
    background: rgba(0, 174, 239, 0.1);
    color: var(--accent-color);
}
/* === LIVE VOICE MODE (GEMINI 3.1 FLASH LIVE) === */
.live-voice-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 43, 73, 0.95), rgba(0, 174, 239, 0.9));
    backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.live-voice-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.1);
}

.voice-wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 80px;
}

.voice-wave-bar {
    width: 6px;
    height: 20px;
    background: white;
    border-radius: 3px;
    animation: wave-bounce 1s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.voice-wave-bar:nth-child(2) { animation-delay: 0.1s; height: 30px; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.2s; height: 50px; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.3s; height: 35px; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.4s; height: 25px; }

@keyframes wave-bounce {
    0%, 100% { transform: scaleY(1); opacity: 0.7; }
    50% { transform: scaleY(1.8); opacity: 1; }
}

.btn-stop-live {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.btn-stop-live:hover {
    background: #ff453a;
    border-color: #ff453a;
    transform: scale(1.05);
}

#btnLiveMode.recording {
    color: #ff453a;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(255, 69, 58, 0)); }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 10px rgba(255, 69, 58, 0.5)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(255, 69, 58, 0)); }
}
