:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #eff6ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --purple: #8b5cf6;
    --teal: #14b8a6;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --sidebar-width: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-brand span span { color: var(--primary); }

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
    display: block;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.plan-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.2);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.plan-badge i {
    font-size: 0.875rem;
}

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.top-header {
    background: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.quick-stats {
    display: flex;
    gap: 1.5rem;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.quick-stat span:first-of-type {
    font-weight: 600;
    color: var(--gray-800);
}

.quick-stat .stat-label {
    color: var(--gray-500);
    font-weight: 400;
}

.quick-stat i { font-size: 1rem; }
.text-blue { color: var(--primary); }
.text-green { color: var(--success); }
.text-purple { color: var(--purple); }

.btn-add-lead {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-add-lead:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.header-profile {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.profile-trigger:hover {
    background: var(--gray-50);
}

.profile-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.profile-email {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.profile-trigger i {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem;
    display: none;
    z-index: 100;
    border: 1px solid var(--gray-200);
}

.profile-dropdown.show {
    display: block;
}

.profile-dropdown a,
.profile-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-sm);
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
    background: var(--gray-50);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

.profile-dropdown-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 0.5rem;
}

.profile-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-plan-badge i {
    font-size: 0.625rem;
}

.main-content {
    padding: 2rem;
    flex: 1;
}

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

.page-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--gray-300);
}

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

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.purple { background: #ede9fe; color: var(--purple); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }

.stat-info {
    flex: 1;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-info .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.stat-trend.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-trend.down {
    background: var(--danger-light);
    color: var(--danger);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.view-all-link {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

.onboarding-steps {
    padding: 1.5rem;
}

.onboarding-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.onboarding-step.completed {
    background: var(--success-light);
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.step-status i {
    font-size: 1.25rem;
    color: var(--gray-400);
}

.step-status .text-success {
    color: var(--success);
}

.onboarding-progress {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    border-radius: 9999px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-weight: 500;
    white-space: nowrap;
}

.leads-list {
    padding: 1rem 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.lead-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    cursor: pointer;
}

.lead-item:hover {
    background: var(--gray-50);
}

.lead-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.lead-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lead-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.lead-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.lead-status {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.lead-status.new { background: var(--primary-light); color: var(--primary); }
.lead-status.contacted { background: var(--warning-light); color: var(--warning); }
.lead-status.qualified { background: var(--success-light); color: var(--success); }
.lead-status.booked { background: var(--success-light); color: var(--success); }

.lead-date {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--gray-300);
}

.empty-state p {
    margin-bottom: 1rem;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--gray-500);
}

.quick-actions-section {
    margin-top: 1rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.quick-action-btn span {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.action-icon.blue { background: var(--primary-light); color: var(--primary); }
.action-icon.green { background: var(--success-light); color: var(--success); }
.action-icon.teal { background: #ccfbf1; color: var(--teal); }
.action-icon.purple { background: #ede9fe; color: var(--purple); }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s;
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.toast {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    color: #fff;
    font-weight: 500;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    text-align: center;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

/* Mobile Menu Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 200;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--gray-100);
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
    }
    
    .mobile-menu-btn i {
        font-size: 1.25rem;
        color: var(--gray-600);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        display: none;
    }
    
    .header-right {
        gap: 0.75rem;
    }
    
    .btn-add-lead span {
        display: none;
    }
    
    .btn-add-lead {
        padding: 0.75rem;
        border-radius: 50%;
    }
    
    .btn-add-lead i {
        margin: 0;
    }
    
    .profile-info {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .sidebar {
        width: var(--sidebar-width);
        max-width: 85vw;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .stat-info .stat-value {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .search-box {
        display: none;
    }
    
    .top-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-left {
        flex: 1;
        min-width: 0;
    }
    
    .header-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .onboarding-step {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .step-content h3 {
        font-size: 0.9rem;
    }
    
    .step-content p {
        font-size: 0.8rem;
    }
    
    .lead-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .lead-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .lead-name {
        font-size: 0.85rem;
    }
    
    .lead-meta {
        font-size: 0.75rem;
    }
    
    .lead-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .lead-date {
        display: none;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .quick-action-btn {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .quick-action-btn span {
        font-size: 0.8rem;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: 55vh;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-left {
        width: auto;
    }
    
    .profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .profile-trigger {
        padding: 0.25rem;
    }
    
    .profile-trigger i {
        display: none;
    }
    
    .btn-add-lead {
        width: 40px;
        height: 40px;
        padding: 0;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .page-subtitle {
        font-size: 0.8rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-info {
        flex: 1;
    }
    
    .stat-info .stat-label {
        font-size: 0.7rem;
    }
    
    .stat-info .stat-value {
        font-size: 1.25rem;
    }
    
    .onboarding-progress {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .progress-text {
        font-size: 0.75rem;
    }
    
    .lead-item {
        flex-wrap: wrap;
    }
    
    .lead-info {
        flex: 1;
        min-width: 0;
    }
    
    .quick-action-btn {
        padding: 0.75rem;
    }
    
    .action-icon {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .quick-action-btn span {
        font-size: 0.75rem;
    }
    
    .card-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .card-header h2 {
        font-size: 0.9rem;
    }
    
    .card-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .view-all-link {
        font-size: 0.75rem;
    }
    
    .onboarding-step .btn {
        width: 100%;
        justify-content: center;
    }
    
    .onboarding-step .btn-sm {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .nav-section-title {
        font-size: 0.65rem;
        padding: 0 0.75rem;
    }
    
    .sidebar-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .sidebar-link i {
        width: 18px;
        font-size: 0.9rem;
    }
    
    .plan-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Bottom Navigation for Mobile */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 0.5rem;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.7rem;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 60px;
}

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

.mobile-bottom-nav-item i {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    .main-content {
        padding-bottom: 80px;
    }
    
    .modal-overlay.active {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .modal {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: calc(100vh - 2rem);
        margin: 0;
        border-radius: var(--radius) var(--radius) 0 0;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .toast {
        bottom: 80px;
        left: 1rem;
        right: 1rem;
        text-align: center;
    }
}

/* Full screen modal on very small screens */
@media (max-width: 375px) {
    .modal-overlay.active {
        padding: 0;
    }
    
    .modal {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .modal-body {
        max-height: calc(100vh - 140px);
    }
}

/* Kanban mobile fixes */
@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
        gap: 1rem;
    }
    
    .kanban-column {
        min-width: 100%;
        max-width: 100%;
    }
    
    .column-body {
        max-height: 300px;
    }
    
    .kanban-card {
        padding: 0.75rem;
    }
    
    .card-header-row {
        margin-bottom: 0.5rem;
    }
    
    .card-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .card-name {
        font-size: 0.85rem;
    }
    
    .card-meta {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

/* Email layout mobile */
@media (max-width: 992px) {
    .email-layout {
        grid-template-columns: 1fr;
    }
    
    .email-templates-panel {
        display: none;
    }
}

/* Stats cards - 2 per row on mobile */
@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-info .stat-value {
        font-size: 1.25rem;
    }
}

/* Table styles for mobile */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .data-table tbody tr {
        display: flex;
        flex-direction: column;
        background: #fff;
        border-radius: var(--radius);
        padding: 1rem;
        border: 1px solid var(--gray-200);
    }
    
    .data-table tbody td {
        padding: 0.25rem 0;
        border: none;
    }
    
    .data-table tbody td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--gray-600);
        font-size: 0.75rem;
    }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    height: 100px;
    margin-bottom: 0.75rem;
}

/* Error state */
.error-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

.error-state i {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.error-state p {
    margin-bottom: 1rem;
}

/* Filter and page actions on mobile */
@media (max-width: 768px) {
    .page-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .filter-select {
        flex: 1;
        min-width: 120px;
    }
    
    .page-actions .btn {
        width: 100%;
    }
}

/* Add lead button in header */
.btn-add-lead-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-lead-top:hover {
    background: var(--primary-dark);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--gray-100);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-item i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.search-result-item.lead i {
    background: var(--primary-light);
    color: var(--primary);
}

.search-result-item.appointment i {
    background: var(--success-light);
    color: var(--success);
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-500);
}

.search-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .btn-add-lead-top span {
        display: none;
    }
    
    .btn-add-lead-top {
        padding: 0.625rem;
        border-radius: 50%;
    }
}

/* Enhanced Mobile Improvements */
@media (max-width: 768px) {
    .top-header {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 50;
        background: #fff;
    }
    
    .page-title-mobile {
        display: block;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--gray-800);
    }
    
    .search-box {
        display: none;
    }
    
    .header-right .btn-primary span {
        display: none;
    }
    
    .header-right .btn-primary {
        padding: 0.75rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 0.875rem;
    }
    
    .page-actions {
        width: 100%;
    }
    
    .page-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    .stat-info .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-info .stat-label {
        font-size: 0.75rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .card-header h2 {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.625rem 0.75rem;
        min-height: 38px;
    }
    
    .btn-icon {
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--gray-100);
        border: none;
        border-radius: var(--radius-sm);
        cursor: pointer;
        color: var(--gray-600);
        transition: all 0.2s;
    }
    
    .btn-icon:hover {
        background: var(--gray-200);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.875rem 1rem;
        font-size: 16px;
        min-height: 44px;
    }
    
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 85vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
    
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .modal-header {
        padding: 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
        max-height: calc(85vh - 140px);
    }
    
    .modal-footer {
        padding: 1rem 1.25rem;
        flex-direction: column-reverse;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .sidebar {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar-overlay {
        transition: opacity 0.3s;
    }
    
    .profile-dropdown {
        right: -0.5rem;
        min-width: 180px;
    }
    
    .toast {
        bottom: 90px;
        left: 1rem;
        right: 1rem;
        max-width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.625rem;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .stat-info .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-info .stat-label {
        font-size: 0.7rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .page-subtitle {
        font-size: 0.8rem;
    }
    
    .card-header h2 {
        font-size: 0.95rem;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    .modal {
        max-height: 95vh;
        border-radius: 0;
    }
    
    .modal-body {
        max-height: calc(95vh - 140px);
    }
}

@media (max-width: 375px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        align-items: center;
    }
    
    .modal {
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .modal-body {
        max-height: calc(100vh - 140px);
    }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 0.5rem 0.25rem;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    padding-bottom: env(safe-area-inset-bottom, 0.5rem);
}

.mobile-bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.7rem;
    background: none;
    border: none;
    cursor: pointer;
    min-width: 60px;
    transition: color 0.2s;
    border-radius: var(--radius-sm);
}

.mobile-bottom-nav-item:active {
    background: var(--gray-50);
}

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

.mobile-bottom-nav-item i {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    .main-wrapper {
        padding-bottom: 70px;
    }
    
    .main-content {
        padding-bottom: 1rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .sidebar-link {
        padding: 0.875rem 1rem;
    }
    
    .btn {
        min-height: 44px;
    }
    
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }
    
    input, select, textarea {
        font-size: 16px !important;
    }
    
    .template-card,
    .lead-item,
    .quick-action-btn {
        min-height: 44px;
    }
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
    
    .table-container,
    .templates-list,
    .leads-list {
        -webkit-overflow-scrolling: touch;
    }
}

/* Better tap targets */
@media (max-width: 768px) {
    .profile-trigger {
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .tab-btn,
    .email-tab {
        min-height: 44px;
    }
}

/* Card-style table for mobile */
@media (max-width: 768px) {
    .mobile-card-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-card-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
    }
    
    .mobile-card-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-600);
        font-size: 0.75rem;
        margin-right: 1rem;
    }
    
    .mobile-card-table thead {
        display: none;
    }
}

/* Source Badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 500;
}
.source-badge.embed_form { background: #eff6ff; color: #2563eb; }
.source-badge.booking { background: #f0fdf4; color: #16a34a; }
.source-badge.direct_form { background: #fef3c7; color: #d97706; }
.source-badge.qr_code { background: #faf5ff; color: #9333ea; }
.source-badge.manual_entry, .source-badge.manual_phone { background: #fef2f2; color: #dc2626; }
.source-badge.manual_walkin { background: #fff7ed; color: #ea580c; }
.source-badge.manual_whatsapp, .source-badge.whatsapp_link { background: #ecfdf5; color: #059669; }
.source-badge.manual_email { background: #eff6ff; color: #2563eb; }
.source-badge.manual_social { background: #fdf2f8; color: #db2777; }
.source-badge.manual_referral { background: #f0f9ff; color: #0284c7; }
.source-badge.facebook_ad { background: #eff6ff; color: #1877f2; }

.source-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}
.source-btn:hover { border-color: var(--primary); color: var(--primary); }
.source-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.source-btn i { font-size: 0.9rem; }