/* ===================================================
   Telesales GMB Mobile WebApp - Design System & Styles
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-main: #0B0F19;
    --bg-surface: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-glass: rgba(26, 34, 53, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(59, 130, 246, 0.25);
    
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-gradient: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    --accent-cyan: #06B6D4;
    --accent-emerald: #10B981;
    --accent-amber: #F59E0B;
    --accent-rose: #F43F5E;
    --accent-purple: #8B5CF6;
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
    --shadow-emerald: 0 0 20px rgba(16, 185, 129, 0.25);
    
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Mobile Frame Wrapper */
.mobile-app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100dvh;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    overflow-x: hidden;
}

/* ─────────── APP HEADER ─────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(10, 13, 22, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.brand-logo-container {
    display: flex;
    align-items: center;
    max-width: 140px;
    height: 32px;
}

.hdr-logo-img {
    max-height: 28px;
    max-width: 130px;
    object-fit: contain;
}

.brand-status {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.brand-status #headerUserEmail {
    font-size: 10px;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hdr-ai-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 12px;
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 9px;
    color: #C4B5FD;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.hdr-ai-btn:hover  { background: rgba(139,92,246,0.25); }
.hdr-ai-btn:active { transform: scale(0.96); }

.hdr-logout-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244,63,94,0.1);
    border: 1px solid rgba(244,63,94,0.25);
    border-radius: 9px;
    color: #FB7185;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.hdr-logout-btn:hover  { background: rgba(244,63,94,0.2); }
.hdr-logout-btn:active { transform: scale(0.92); }

.btn-icon-header {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244,63,94,0.1);
    border: 1px solid rgba(244,63,94,0.25);
    border-radius: 9px;
    color: var(--accent-rose);
    cursor: pointer;
    transition: background 0.15s;
}
.btn-icon-header:active { transform: scale(0.92); }


/* ----------------- Screen Content Area ----------------- */
.app-content {
    flex: 1;
    padding: 14px 14px 90px 14px;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-view {
    display: none;
    animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ----------------- Welcome Hero Card ----------------- */
.welcome-hero {
    background: linear-gradient(135deg, rgba(59,130,246,0.18) 0%, rgba(139,92,246,0.14) 100%);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.welcome-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #06B6D4);
}

.hero-greeting {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.hero-company {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 6px;
}

.hero-device-tag {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
}

/* ----------------- Metrics Grid 2x2 ----------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    border-color: rgba(59,130,246,0.3);
    transform: translateY(-1px);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.metric-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 3px;
    font-family: var(--font-mono);
}

.metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
}

/* ----------------- Lead Cards ----------------- */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.lead-card:hover {
    border-color: rgba(6,182,212,0.25);
}

.lead-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.lead-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    flex: 1;
}

.lead-category-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-cyan);
    background: rgba(6,182,212,0.1);
    border: 1px solid rgba(6,182,212,0.2);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.lead-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.lead-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

/* Lead card sub-components */
.lead-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.lead-badge-dup {
    background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.3);
    color: var(--accent-amber);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
}

.lead-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.lead-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.lead-phone {
    font-size: 12px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-weight: 600;
}

.lead-actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.has-duplicate {
    border-left: 3px solid var(--accent-amber) !important;
}

.new-opportunity {
    border-left: 3px solid var(--accent-emerald) !important;
}

/* ----------------- Action Button (small) ----------------- */
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    font-family: var(--font-main);
}

.btn-action:hover {
    background: rgba(255,255,255,0.09);
    color: var(--text-primary);
}

.btn-action.btn-call {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.25);
    color: var(--accent-emerald);
}

.btn-action.btn-whatsapp {
    background: rgba(37,211,102,0.1);
    border-color: rgba(37,211,102,0.25);
    color: #25D366;
}

.btn-action.btn-status {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.25);
    color: var(--primary);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.interested  { background: rgba(16,185,129,0.15); color: var(--accent-emerald); }
.status-badge.followup    { background: rgba(59,130,246,0.15); color: var(--primary); }
.status-badge.converted   { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.status-badge.not_interested { background: rgba(244,63,94,0.15); color: var(--accent-rose); }
.status-badge.new         { background: rgba(6,182,212,0.1); color: var(--accent-cyan); }


/* ----------------- Bottom Navigation Bar ----------------- */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(15, 23, 42, 0.96);
    border-top: 1px solid var(--border-color);
    display: none; /* shown via JS after login */
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 4px 10px 4px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 4px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item .nav-icon {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

.nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: 18%;
    background: var(--accent-rose);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
}

/* ----------------- Screen 1: Auth & Registration UI ----------------- */
.auth-wrapper {
    min-height: 100dvh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 16px 14px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 18px 16px 20px 16px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-subtle);
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* ═══════════════ GOOGLE MATERIAL 3 AUTH CARD (CLEAN COMPANY LOOK) ═══════════════ */
.google-auth-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 36px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.google-auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4285F4 0%, #EA4335 33%, #FBBC05 66%, #34A853 100%);
}

.brand-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 6px 0;
}

.brand-logo-img {
    max-width: 280px;
    max-height: 75px;
    width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.4));
}

.google-auth-heading-group {
    margin-bottom: 28px;
}

.google-auth-title {
    font-size: 20px;
    font-weight: 800;
    color: #F8FAFC;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.google-auth-subtitle {
    font-size: 13px;
    color: #94A3B8;
    line-height: 1.4;
    font-weight: 500;
}

.google-action-box {
    margin-bottom: 24px;
}

/* Google Material Sign In Button */
.btn-google-material {
    width: 100%;
    height: 52px;
    background: #FFFFFF;
    color: #1E293B;
    border: 1px solid #DADCE0;
    border-radius: 26px;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-google-material:hover {
    background: #F8FAFC;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-google-material:active {
    background: #F1F5F9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transform: translateY(1px);
}

.g-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.g-btn-text {
    letter-spacing: 0.2px;
    font-weight: 600;
}

/* Trust Badge Footer */
.google-auth-trust-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: #64748B;
    font-weight: 500;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #06B6D4, #8B5CF6);
}

.auth-header {
    text-align: center;
    margin-bottom: 12px;
}

.auth-logo-badge {
    width: 44px;
    height: 44px;
    margin: 0 auto 8px auto;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.auth-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.auth-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Device Security Scanner Box */
.device-detect-chip {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chip-icon {
    font-size: 18px;
}

.chip-body {
    flex: 1;
}

.chip-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chip-code {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-top: 3px;
    display: inline-block;
    word-break: break-all;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.chip-meta {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Form Styles */
.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    font-size: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 10px 12px 10px 38px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.95);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: 12px;
}

.auth-tabs-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
}

.auth-toggle-btn {
    flex: 1;
    padding: 7px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0 12px 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    padding: 0 10px;
}

/* Google Login Button in Auth Footer */
.btn-google-auth {
    width: 100%;
    padding: 11px 16px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.btn-google-auth:hover {
    background: #f9fafb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-google-auth:active {
    transform: scale(0.98);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.metric-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.metric-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ----------------- Lead & Opportunity Cards ----------------- */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.lead-card.has-duplicate {
    border-left: 4px solid var(--accent-amber);
}

.lead-card.new-opportunity {
    border-left: 4px solid var(--accent-emerald);
}

.lead-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.lead-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.lead-badge-dup {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.lead-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.lead-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lead-phone {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.lead-actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-action {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-call {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.btn-status {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ----------------- Lead Engine UI ----------------- */
.engine-hero-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 18px;
}

.scraper-feed-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 280px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
}

.feed-item {
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feed-item.fresh {
    color: var(--accent-emerald);
}

.feed-item.dup {
    color: var(--accent-amber);
}

/* ----------------- Modal Dialog (Global Fullscreen Overlay) ----------------- */
/* Covers: leadStatusModal, aiMessageStudioModal, categorySearchModal, stateSearchModal */
#leadStatusModal,
#aiMessageStudioModal,
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

#leadStatusModal.open,
#aiMessageStudioModal.open,
.modal-overlay.open {
    display: flex;
}

.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    border-bottom: none;
    padding: 16px 18px 28px 18px;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 88vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0.2; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    margin: 0 auto 16px auto;
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 440px;
    z-index: 200;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.success { border-left: 4px solid var(--accent-emerald); color: var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-rose); color: var(--accent-rose); }
.toast.warning { border-left: 4px solid var(--accent-amber); color: var(--accent-amber); }

/* ----------------- 4000+ Searchable Category Picker ----------------- */
.category-picker-trigger {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-picker-trigger:hover, .category-picker-trigger:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.95);
}

.picker-selected-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-count-badge {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-cyan);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.category-modal-body {
    max-height: 75vh;
    display: flex;
    flex-direction: column;
}

.cat-quick-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 2px 10px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cat-quick-chips::-webkit-scrollbar {
    display: none;
}

.cat-chip-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-chip-btn:active, .cat-chip-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.category-search-box {
    position: relative;
    margin-bottom: 10px;
}

.category-results-list {
    flex: 1;
    overflow-y: auto;
    max-height: 380px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(11, 15, 25, 0.6);
    padding: 4px;
}

.cat-result-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cat-result-item:hover, .cat-result-item:active {
    background: rgba(59, 130, 246, 0.18);
    color: var(--accent-cyan);
}

.cat-result-item.selected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    font-weight: 700;
}

.cat-highlight {
    color: var(--accent-cyan);
    font-weight: 700;
    text-decoration: underline;
}

/* ----------------- Country Toggle & Location Pickers ----------------- */
.country-toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.country-pill-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.country-pill-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.25));
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.25);
}

.location-tier-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.25);
}

/* ═══════════════════════════════════════════
   BOTTOM NAVIGATION BAR (5-TAB PRO LAYOUT)
═══════════════════════════════════════════ */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 13, 22, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 100;
    padding: 0 4px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748B;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    user-select: none;
}

.nav-item .nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.nav-item span:not(.nav-badge) {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: -0.2px;
    text-transform: uppercase;
}

.nav-item.active {
    color: #38BDF8;
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    background: #F43F5E;
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 10px;
    min-width: 15px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.5);
    line-height: 1.2;
}

/* ---- Small Phone Viewport Fix (Short Screens) ---- */
@media screen and (max-height: 680px) {
    .auth-wrapper {
        justify-content: flex-start;
        padding: 12px 12px 16px 12px;
    }
    .auth-header {
        margin-bottom: 8px;
    }
    .auth-logo-badge {
        width: 36px;
        height: 36px;
        font-size: 20px;
        margin-bottom: 4px;
    }
    .auth-title { font-size: 16px; }
    .auth-desc { font-size: 10px; }
    .device-detect-chip { padding: 6px 8px; margin-bottom: 10px; }
    .chip-icon { font-size: 15px; }
    .form-group { margin-bottom: 8px; }
    .form-control { padding: 8px 10px 8px 34px; font-size: 12px; }
    .auth-tabs-toggle { margin-bottom: 10px; padding: 2px; }
    .auth-toggle-btn { padding: 6px 8px; font-size: 11px; }
    .btn-primary { padding: 10px 14px; font-size: 13px; }
}

/* ---- Desktop Centering Fix ---- */
@media screen and (min-width: 481px) {
    .bottom-nav-bar {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 480px;
    }
    .modal-overlay {
        width: 100%;
        transform: none;
        left: 0;
    }
}
