/* 
    DESIGN SYSTEM: Explorador PRO (Prosegur)
    Estilo Premium Dark / Steel Blue
    OPTIMIZACIÓN: Alineación y Responsividad
*/

:root {
    --primary-blue: #003399; /* Prosegur Blue */
    --primary-yellow: #FED000; /* Prosegur Gold */
    --bg-dark: #0f172a; /* Deep Navy */
    --bg-card: rgba(30, 41, 59, 0.7); /* Glass Card */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }
body { 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

.hidden { display: none !important; }

/* --- Auth Screen --- */
.auth-container {
    display: none; height: 100vh; width: 100%;
    background: radial-gradient(circle at top right, var(--primary-blue), var(--bg-dark));
    justify-content: center; align-items: center; padding: 1.5rem;
}
.auth-container.active { display: flex; }

.auth-card {
    background: var(--bg-card); backdrop-filter: blur(15px);
    padding: 3rem 2rem; border-radius: 2.5rem; width: 100%; max-width: 420px;
    border: 1px solid var(--border); box-shadow: var(--shadow-premium);
    text-align: center;
}
.brand-logo-main { width: 180px; margin-bottom: 3rem; }

/* Login Minimalista */
.login-minimal-group {
    display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem;
}
.login-minimal-group input {
    background: rgba(255,255,255,0.05); border: 2px solid var(--border);
    border-radius: 1.5rem; padding: 1.5rem; color: white; font-size: 1.3rem;
    text-align: center; font-weight: 600; width: 100%;
}
.login-minimal-group input:focus {
    border-color: var(--primary-yellow); outline: none; background: rgba(255,255,255,0.1);
}

.btn-giant {
    height: 75px; width: 100%; font-size: 1.2rem; letter-spacing: 2px;
    box-shadow: 0 10px 20px rgba(254, 208, 0, 0.3);
}

.auth-footer-links {
    margin-top: 3rem; display: flex; flex-direction: column; gap: 1.5rem;
}
.link-btn {
    background: none; border: none; color: var(--primary-yellow);
    font-weight: 800; font-size: 1rem; cursor: pointer; text-transform: uppercase;
}
.link-btn-dim {
    background: none; border: none; color: white; opacity: 0.4;
    font-weight: 600; font-size: 0.8rem; cursor: pointer;
}

/* --- Navbar --- */
.navbar {
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px);
    padding: 0 1.5rem; height: 75px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 3px solid var(--primary-yellow); position: sticky; top: 0; z-index: 1001;
}
.nav-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo-img { height: 32px; width: auto; }
.nav-titles { display: flex; flex-direction: column; overflow: hidden; }
.brand-name { font-weight: 800; color: white; font-size: 1.1rem; white-space: nowrap; }
.app-tag { font-size: 0.6rem; color: var(--primary-yellow); font-weight: 800; letter-spacing: 1px; white-space: nowrap; }

.nav-actions { display: flex; gap: 0.5rem; align-items: center; }
.nav-icon { 
    width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: white; transition: 0.2s;
}
.btn-excel { background: #22c55e; }
.btn-airtable { background: #00AEEF; }
.btn-delete { background: var(--danger); }

.profile-badge { 
    padding: 0.5rem 1rem; background: rgba(255,255,255,0.05); border-radius: 2rem; 
    color: white; font-weight: 800; cursor: pointer; position: relative;
    border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.dropdown-content {
    display: none; position: absolute; top: 120%; right: 0; min-width: 180px;
    background: var(--bg-dark); border: 2px solid var(--primary-yellow); border-radius: 1.2rem;
    padding: 0.6rem; box-shadow: var(--shadow-premium); z-index: 1002;
}
.dropdown-content.active { display: block; animation: slideIn 0.2s ease-out; }
.dropdown-content button {
    width: 100%; text-align: left; background: none; border: none; padding: 0.8rem;
    color: white; font-weight: 700; border-radius: 0.8rem; display: flex; align-items: center; gap: 0.8rem;
}
.dropdown-content button:hover { background: rgba(255,255,255,0.1); }

/* --- Tabs --- */
.main-tabs { 
    display: flex; background: #1e293b; padding: 0.5rem; gap: 0.4rem; 
    position: sticky; top: 75px; z-index: 1000; overflow-x: auto;
}
.tab-link {
    flex: 1; padding: 0.8rem 0.5rem; border: none; background: rgba(255,255,255,0.03);
    color: var(--text-muted); font-weight: 800; font-size: 0.75rem; border-radius: 0.8rem;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    white-space: nowrap; min-width: max-content;
}
.tab-link i { width: 16px; height: 16px; }
.tab-link.active { background: var(--primary-yellow); color: var(--bg-dark); box-shadow: 0 8px 15px rgba(254, 208, 0, 0.2); }

/* --- Content Area --- */
.main-content { padding: 1.5rem; max-width: 1200px; margin: 0 auto; min-height: calc(100vh - 160px); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s ease-out; }

/* Control Cards */
.glass-card {
    background: var(--bg-card); backdrop-filter: blur(12px); border: 1px solid var(--border);
    padding: 1.8rem; border-radius: 2.2rem; box-shadow: var(--shadow-premium); margin-bottom: 2rem;
}
.controls-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.controls-row h2 { color: white; font-weight: 800; font-size: 1.4rem; }

.btn {
    border: none; border-radius: 1.2rem; padding: 0.9rem 1.8rem; font-weight: 900;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.8rem;
    color: white; /* Default para legibilidad */
}
.btn-primary { background: var(--primary-yellow); color: var(--bg-dark); }
.btn-outline { background: none; border: 2px solid var(--primary-yellow); color: var(--primary-yellow); padding: 0.9rem; border-radius: 1.2rem; font-weight: 800; cursor: pointer; }
.btn-pulse { animation: pulseAnim 2s infinite; }

.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.field label { display: block; font-size: 0.65rem; font-weight: 900; color: var(--primary-yellow); margin-bottom: 0.5rem; text-transform: uppercase; }
select { 
    width: 100%; padding: 0.8rem 1.1rem; border-radius: 1rem; border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.6); color: white; font-weight: 700; -webkit-appearance: none;
}
select option {
    background-color: var(--bg-dark);
    color: white;
}

.search-panel { background: rgba(0,0,0,0.2); padding: 1.2rem; border-radius: 1.5rem; margin-top: 1rem; }
.search-input-wrapper { background: rgba(255,255,255,0.05); border-radius: 1rem; padding: 0 1rem; height: 48px; display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.search-input-wrapper input { border: none; background: none; width: 100%; color: white; font-weight: 600; font-size: 1rem; }

.interest-slider-wrapper { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.interest-slider-wrapper label { font-size: 0.7rem; font-weight: 800; color: var(--text-muted); min-width: 120px; }
.interest-slider-wrapper input { flex: 1; min-width: 150px; accent-color: var(--primary-yellow); }

.extra-filters { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tag-select { flex: 1; font-size: 0.75rem; padding: 0.6rem; min-width: 120px; }

/* Leads Grid */
.leads-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.lead-card { 
    background: var(--bg-card); padding: 1.5rem; border-radius: 2rem; border: 1px solid var(--border); 
    position: relative; transition: 0.3s; cursor: pointer;
}
.lead-card:hover { transform: translateY(-5px); border-color: var(--primary-yellow); }
.badge-interest { padding: 0.4rem 0.8rem; border-radius: 2rem; font-size: 0.8rem; font-weight: 900; background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); }
.lead-name-text { font-weight: 800; color: var(--primary-yellow); font-size: 1.2rem; margin-bottom: 0.3rem; margin-right: 40px; }
.lead-sub { font-size: 0.75rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; }



/* --- Map --- */
.map-frame { height: 500px; border-radius: 2rem; overflow: hidden; border: 3px solid var(--primary-yellow); position: relative; margin-bottom: 1.5rem; }
#map { width: 100%; height: 100%; z-index: 1; background: #0f172a; }

.map-overlay-controls {
    position: absolute; bottom: 1.5rem; right: 1rem; z-index: 1000;
    display: flex; flex-direction: column; gap: 0.8rem;
}
.btn-map-control {
    background: var(--bg-dark); border: 2px solid var(--primary-yellow); color: white;
    padding: 0.8rem 1.2rem; border-radius: 1.5rem; font-weight: 800; font-size: 0.7rem;
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer; box-shadow: var(--shadow-premium);
}
.btn-map-control.active { background: var(--primary-yellow); color: var(--bg-dark); }

.map-controls-top { display: flex; gap: 0.6rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.btn-glass { flex: 1; background: rgba(255,255,255,0.05); color: white; border: 1px solid var(--border); padding: 0.8rem; border-radius: 1rem; font-weight: 800; font-size: 0.75rem; cursor: pointer; min-width: 140px; }

/* User Marker */
.user-marker-container { display: flex; align-items: center; justify-content: center; }
.user-marker {
    width: 14px; height: 14px; background: #3b82f6; border: 3px solid white;
    border-radius: 50%; box-shadow: 0 0 15px rgba(59, 130, 246, 1);
    animation: markerPulse 2s infinite;
}

/* Modals */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); z-index: 2000; align-items: center; justify-content: center; padding: 1rem; }
.modal.active { display: flex; animation: fadeIn 0.3s; }
.modal-card { background: var(--bg-dark); border-radius: 2.5rem; padding: 2rem; width: 100%; border: 2px solid var(--primary-yellow); position: relative; max-height: 95vh; overflow-y: auto; }
.modal-card.mini { max-width: 420px; }
.modal-card.full { max-width: 900px; }
.modal-close { position: absolute; top: 1rem; right: 1.5rem; font-size: 2.2rem; cursor: pointer; color: var(--primary-yellow); }

.status-picker h4 { color: var(--primary-yellow); font-size: 0.75rem; font-weight: 900; margin-bottom: 1rem; text-align: center; }
.grid-2-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.status-btn-pick { padding: 0.8rem; border-radius: 1rem; border: 2px solid var(--border); background: none; color: white; font-weight: 800; font-size: 0.7rem; cursor: pointer; transition: all 0.2s; }
.status-btn-pick.visita.active { border-color: #22c55e; color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.status-btn-pick.seguimiento.active { border-color: #f97316; color: #f97316; background: rgba(249, 115, 22, 0.1); }
.status-btn-pick.descartado.active { border-color: #94a3b8; color: #94a3b8; background: rgba(148, 163, 184, 0.1); }
.status-btn-pick.firmado.active { border-color: var(--primary-yellow); color: var(--primary-yellow); background: rgba(254, 208, 0, 0.1); }

/* Profile Modal Enhanced */
.profile-modal-card { max-width: 500px !important; }
.profile-header { text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 2rem; }
.profile-avatar-large {
    width: 80px; height: 80px; background: rgba(254, 208, 0, 0.1); color: var(--primary-yellow);
    border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto;
    border: 2px solid rgba(254, 208, 0, 0.2); transition: all 0.3s;
}
.profile-avatar-large:hover { border-color: var(--primary-yellow); transform: scale(1.05); }
.avatar-edit-badge {
    position: absolute; bottom: 0; right: 0; background: var(--primary-yellow);
    color: var(--bg-dark); width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-dark);
}
.profile-avatar-large i { width: 40px; height: 40px; }
.profile-section { background: rgba(255,255,255,0.02); padding: 1.5rem; border-radius: 1.5rem; border: 1px solid rgba(255,255,255,0.05); }
.section-title { font-size: 0.7rem; font-weight: 900; color: var(--primary-yellow); margin-bottom: 1.2rem; display: flex; align-items: center; gap: 0.5rem; letter-spacing: 1px; }

/* Estilos de Input en Modales/Perfil */
.input-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--primary-yellow);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--primary-yellow);
    background: rgba(255, 255, 255, 0.08);
}

input[readonly] {
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05) !important;
}


/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes markerPulse { 0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); } }
@keyframes pulseAnim { 0% { box-shadow: 0 0 0 0 rgba(254, 208, 0, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(254, 208, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(254, 208, 0, 0); } }

/* Exploration Tab Premium */
.exploration-header { background: rgba(255,255,255,0.02); border-radius: 2rem; padding: 2rem; border: 1px solid rgba(255,255,255,0.05); margin-bottom: 2rem; }
.header-main { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; gap: 2rem; flex-wrap: wrap; }

.btn-radar {
    position: relative; overflow: hidden; padding: 1rem 2rem; border-radius: 2rem;
    display: flex; align-items: center; gap: 0.8rem; font-weight: 900;
}
.radar-ping {
    position: absolute; width: 100%; height: 100%; background: rgba(254, 208, 0, 0.3);
    border-radius: 50%; left: 0; top: 0; animation: radarPing 2s infinite; pointer-events: none;
}
@keyframes radarPing { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(2.5); opacity: 0; } }

.exploration-filters-bar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.search-box-premium {
    flex: 1; background: rgba(0,0,0,0.2); border: 1px solid var(--border); border-radius: 1.5rem;
    display: flex; align-items: center; padding: 0.4rem 1.2rem; gap: 0.8rem; min-width: 300px;
}
.search-box-premium input { background: none; border: none; color: white; width: 100%; font-size: 0.9rem; padding: 0.6rem 0; }
.search-box-premium i { opacity: 0.4; }

.premium-filters-container {
    display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2); padding: 1rem; border-radius: 1.5rem;
    border: 1px solid rgba(255,255,255,0.05); width: 100%;
}

.premium-filter-pill {
    flex: 1; min-width: 140px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1.2rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    display: flex; flex-direction: column;
}

.premium-filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-yellow);
}

.premium-filter-pill label {
    font-size: 0.6rem; font-weight: 900; color: var(--primary-yellow);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;
}

.pill-select-area {
    display: flex; align-items: center; position: relative; gap: 0.8rem;
}

.pill-select-area i:first-child { width: 16px; color: var(--text-muted); opacity: 0.8; }
.pill-select-area .arrow { position: absolute; right: 0; width: 18px; color: var(--primary-yellow); pointer-events: none; }

.pill-select-area select {
    background: transparent; border: none; color: white;
    font-weight: 800; font-size: 0.9rem; width: 100%;
    cursor: pointer; outline: none; appearance: none; -webkit-appearance: none;
    padding-right: 1.5rem; /* Espacio para la flecha */
}

.pill-select-area select option {
    background: var(--bg-dark); color: white; font-weight: 600;
}

/* Empty Exploration State - Radar Pro */
.empty-exploration-state { text-align: center; padding: 4rem 2rem; }
.radar-container {
    width: 160px; height: 160px; margin: 0 auto 2.5rem auto; position: relative;
    border: 1px solid rgba(254, 208, 0, 0.15); border-radius: 50%;
    background: radial-gradient(circle, rgba(254, 208, 0, 0.05) 0%, transparent 70%);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
/* Grid lines for radar */
.radar-container::before {
    content: ''; position: absolute; inset: 0;
    background-image: 
        linear-gradient(rgba(254, 208, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(254, 208, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px; background-position: center;
    border-radius: 50%;
}
.radar-line {
    position: absolute; width: 50%; height: 4px; 
    background: linear-gradient(to right, transparent, var(--primary-yellow));
    top: 50%; left: 50%; transform-origin: left; 
    animation: radarRotate 3s linear infinite;
    filter: blur(1px); z-index: 2;
}
.radar-circle {
    position: absolute; inset: 0; border: 1px solid rgba(254, 208, 0, 0.1); border-radius: 50%;
    animation: radarRipple 4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
.radar-point {
    position: absolute; width: 6px; height: 6px; background: var(--primary-yellow);
    border-radius: 50%; box-shadow: 0 0 10px var(--primary-yellow);
    animation: pointFlicker 2s infinite; opacity: 0;
}

@keyframes radarRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes radarRipple { 0% { transform: scale(0.6); opacity: 0; } 50% { opacity: 0.5; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes pointFlicker { 0%, 100% { opacity: 0; } 50% { opacity: 0.8; } }

/* Cards Premium Plus */
.lead-card-premium {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 2rem;
    padding: 1.8rem; position: relative; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden; animation: cardSlideUp 0.5s ease-out backwards;
}
@keyframes cardSlideUp { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.lead-card-premium:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-yellow);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(254, 208, 0, 0.1);
}

.interest-progress-wrapper { margin: 1.2rem 0; }
.interest-label-flex { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.7rem; font-weight: 900; }
.progress-track { height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 1.5s ease-out; }

.card-header-flex { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.2rem; }
.badge-status-premium { padding: 0.4rem 0.8rem; border-radius: 2rem; font-size: 0.6rem; font-weight: 900; letter-spacing: 1px; }
.badge-status-premium.visita { background: rgba(34, 197, 94, 0.1); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-status-premium.seguimiento { background: rgba(249, 115, 22, 0.1); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.2); }
.badge-status-premium.descartado { background: rgba(100, 116, 139, 0.1); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.2); }
.badge-status-premium.firmado { background: rgba(254, 208, 0, 0.1); color: var(--primary-yellow); border: 1px solid rgba(254, 208, 0, 0.2); }


/* Leads Grid Premium */
.leads-grid-premium {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem;
}

/* Nav Actions Fix */
.nav-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.3rem 0.5rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.7rem;
    font-weight: 800;
}

.nav-btn-text i {
    width: 16px;
    height: 16px;
}

.nav-btn-text.btn-excel { color: #22c55e; }
.nav-btn-text.btn-airtable { color: #3b82f6; }
.nav-btn-text.btn-delete { color: #ef4444; }

.nav-btn-text:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn-text.btn-excel:hover { background: rgba(34, 197, 94, 0.1); }
.nav-btn-text.btn-airtable:hover { background: rgba(59, 130, 246, 0.1); }
.nav-btn-text.btn-delete:hover { background: rgba(239, 68, 68, 0.1); }

/* Stats Colors */
#stat-total { color: white; }
#stat-high { color: var(--primary-yellow); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.stat-val { display: block; font-size: 1.8rem; font-weight: 800; color: var(--primary-yellow); }
.stat-label { font-size: 0.6rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .btn-label { display: none; }
    .nav-btn-text { padding: 0.6rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 1rem; }
    .modal-layout { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    .leads-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .navbar { height: 70px; padding: 0 1rem; }
    .nav-titles { display: none; } /* Hide titles on small mobile to save space */
    .brand-name { font-size: 1rem; }
    .profile-badge { padding: 0.4rem 0.8rem; }
    #display-name { font-size: 0.8rem; }
    
    .main-tabs { top: 70px; padding: 0.4rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-link { font-size: 0.65rem; padding: 0.6rem 1rem; flex: 0 0 auto; }
    
    .glass-card { padding: 1.2rem; border-radius: 1.5rem; }
    .controls-row h2 { font-size: 1.2rem; }
    .btn { padding: 0.8rem 1.2rem; font-size: 0.75rem; border-radius: 1rem; }
    
    .map-frame { height: 400px; border-radius: 1.5rem; }
}

@media (max-width: 400px) {
    .nav-actions { display: flex; transform: scale(0.85); } /* Mostrar siempre pero más pequeños */
    .tab-link { padding: 0.6rem 0.8rem; font-size: 0.6rem; }
}

/* Loader for simulation */
.loader-ring {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(254, 208, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-yellow);
    animation: spin 1s ease-in-out infinite;
}

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

.modal-card.mini {
    max-width: 400px;
}

/* Lead Cards Premium */
.lead-card-premium {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 1.5rem; padding: 1.5rem; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; gap: 1rem; position: relative; overflow: hidden;
}
.lead-card-premium:hover {
    background: rgba(255,255,255,0.05); border-color: var(--primary-yellow);
    transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-header-flex { display: flex; justify-content: space-between; align-items: center; }

.badge-interest-premium {
    padding: 0.3rem 0.8rem; border-radius: 2rem; font-weight: 900; font-size: 0.8rem;
    border: 1px solid transparent; display: flex; align-items: center; gap: 0.4rem;
}
.badge-interest-premium small { font-size: 0.5rem; opacity: 0.7; }



.lead-name-premium { font-size: 1.1rem; font-weight: 900; color: white; margin: 0.5rem 0; }
.lead-sector-premium, .lead-address-premium {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; opacity: 0.5; font-weight: 600; margin: 0.2rem 0;
}
.lead-sector-premium i, .lead-address-premium i { width: 14px; color: var(--primary-yellow); opacity: 0.8; }

.card-actions-premium { display: flex; gap: 0.5rem; margin-top: 1rem; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 1rem; }
.btn-card-action {
    flex: 1; padding: 0.6rem; border-radius: 1rem; border: none; font-weight: 800; font-size: 0.65rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    transition: all 0.2s; background: rgba(255,255,255,0.05); color: white;
}
.btn-card-action:hover { background: rgba(255,255,255,0.1); }
.btn-card-action.detail { border: 1px solid rgba(255,255,255,0.1); }
.btn-card-action.maps { background: #4285F4; color: white; }
.btn-card-action.maps:hover { background: #3367d6; }

/* --- Cloud Sync Indicator & Feedback --- */
.cloud-sync-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 2rem;
    border: 1px solid var(--border);
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.cloud-sync-indicator.syncing {
    color: var(--primary-yellow);
    border-color: var(--primary-yellow);
    animation: syncPulse 1.5s infinite;
}

.cloud-sync-indicator.success {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
}

.cloud-sync-indicator.error {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    animation: errorShake 0.5s ease-in-out;
}

.cloud-sync-indicator i {
    width: 14px;
    height: 14px;
}

@keyframes syncPulse {
    0% { box-shadow: 0 0 0 0 rgba(254, 208, 0, 0.2); }
    70% { box-shadow: 0 0 0 8px rgba(254, 208, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(254, 208, 0, 0); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Enhanced Sync Button in Profile */
.btn-sync-now {
    background: rgba(254, 208, 0, 0.1);
    color: var(--primary-yellow);
    border: 1px solid rgba(254, 208, 0, 0.2);
    padding: 1rem;
    border-radius: 1.2rem;
    font-weight: 800;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.2s;
}

.btn-sync-now:hover {
    background: var(--primary-yellow);
    color: var(--bg-dark);
}

.sync-status-text {
    font-size: 0.6rem;
    opacity: 0.5;
    margin-top: 0.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}
