:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #eff6ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --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: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

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

.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links > span { color: var(--gray-600); font-size: 0.875rem; }

.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    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-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

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

.btn-logout {
    background: transparent;
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
}

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

.dashboard-layout { display: flex; min-height: calc(100vh - 60px); }

.sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }

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

.sidebar-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }

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

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

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

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

.card-header { margin-bottom: 1rem; }
.card-title { font-size: 1rem; font-weight: 600; color: var(--gray-800); }

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

.stat-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.stat-label { color: var(--gray-500); font-size: 0.875rem; }
.stat-value { font-size: 1.75rem; font-weight: 600; color: var(--gray-900); margin-top: 0.25rem; }

.table-container { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; }
.table-container table { width: 100%; border-collapse: collapse; }
.table-container th { text-align: left; padding: 1rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); font-weight: 600; color: var(--gray-600); font-size: 0.875rem; }
.table-container td { padding: 1rem; border-bottom: 1px solid var(--gray-100); }
.table-container tr:hover { background: var(--gray-50); }

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

.status-new { background: #dbeafe; color: #1d4ed8; }
.status-contacted { background: #fef3c7; color: #b45309; }
.status-qualified { background: #d1fae5; color: #047857; }
.status-lost { background: #fee2e2; color: #b91c1c; }
.status-completed { background: #d1fae5; color: #047857; }
.status-pending { background: #fef3c7; color: #b45309; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--gray-700); font-weight: 500; font-size: 0.875rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 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-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

.filters { display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-input { padding: 0.5rem 1rem; border: 1px solid var(--gray-200); border-radius: var(--radius); min-width: 200px; }

.tabs { display: flex; border-bottom: 1px solid var(--gray-200); margin-bottom: 1.5rem; }
.tab {
    padding: 0.75rem 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.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);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.2s;
}

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

.modal-header { margin-bottom: 1rem; }
.modal-title { font-size: 1.25rem; font-weight: 600; }
.modal-close { float: right; cursor: pointer; color: var(--gray-400); font-size: 1.5rem; }
.modal-close:hover { color: var(--gray-600); }

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

.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);
}

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

.skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; }

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

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 1rem; }
    .filters { flex-direction: column; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.empty-state { text-align: center; padding: 3rem; color: var(--gray-500); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 1rem; opacity: 0.5; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-600);
}

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

.progress { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); transition: width 0.3s; }

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    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;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.dropdown.active .dropdown-menu { display: block; }

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    cursor: pointer;
}

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

.tabs-vertical { display: flex; gap: 1rem; }
.tabs-vertical .tab { border-bottom: none; border-left: 3px solid transparent; padding: 0.5rem 1rem; }
.tabs-vertical .tab.active { border-left-color: var(--primary); background: var(--primary-light); }

.section { margin-bottom: 2rem; }
.section-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; color: var(--gray-800); }

.alert { padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }

.lead-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.lead-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.lead-name { font-weight: 600; color: var(--gray-800); }
.lead-email, .lead-phone { color: var(--gray-500); font-size: 0.875rem; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; }
.calendar-day {
    padding: 0.5rem;
    text-align: center;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
}

.calendar-day:hover { background: var(--primary-light); }
.calendar-day.today { background: var(--primary); color: #fff; }
.calendar-day.disabled { color: var(--gray-300); cursor: not-allowed; }

.time-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }
.time-slot {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
}

.time-slot:hover { border-color: var(--primary); background: var(--primary-light); }
.time-slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.time-slot.disabled { color: var(--gray-300); cursor: not-allowed; }

.booking-form { max-width: 600px; margin: 0 auto; }

.booking-page { max-width: 800px; margin: 0 auto; padding: 2rem; }
.booking-header { text-align: center; margin-bottom: 2rem; }
.booking-business-name { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.booking-service-list { margin: 1rem 0; }

.service-option {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.service-option:hover { border-color: var(--primary); }
.service-option.selected { border-color: var(--primary); background: var(--primary-light); }

.auth-container { max-width: 400px; margin: 2rem auto; padding: 2rem; }
.auth-card { background: #fff; border-radius: var(--radius); padding: 2rem; border: 1px solid var(--gray-200); }
.auth-title { font-size: 1.5rem; text-align: center; margin-bottom: 1.5rem; }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 768px) { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.pricing-card.popular { border-color: var(--primary); position: relative; }
.pricing-card.popular::before { content: 'Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: 0.25rem 1rem; border-radius: 9999px; font-size: 0.75rem; }

.pricing-price { font-size: 2.5rem; font-weight: 700; color: var(--gray-900); }
.pricing-price span { font-size: 1rem; color: var(--gray-500); }
.pricing-features { list-style: none; padding: 1rem 0; text-align: left; }
.pricing-features li { padding: 0.5rem 0; color: var(--gray-600); }
.pricing-features li::before { content: '✓'; color: var(--success); margin-right: 0.5rem; }

.qr-code { display: inline-block; padding: 1rem; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.qr-code img { max-width: 200px; }

.notification-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notification-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.notification-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.notification-icon.email { background: #dbeafe; color: #1d4ed8; }
.notification-icon.sms { background: #d1fae5; color: #047857; }
.notification-icon.whatsapp { background: #dcfce7; color: #16a34a; }

.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-item::before { content: ''; position: absolute; left: -2rem; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; }

.embed-preview { border: 2px dashed var(--gray-300); padding: 2rem; text-align: center; margin: 1rem 0; border-radius: var(--radius); }
.embed-code { background: var(--gray-800); color: #fff; padding: 1rem; border-radius: var(--radius); font-family: monospace; font-size: 0.875rem; overflow-x: auto; white-space: nowrap; }

.chart-container { background: #fff; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--gray-200); }
.chart-title { font-weight: 600; margin-bottom: 1rem; }

.welcome-banner { background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%); color: #fff; padding: 2rem; border-radius: var(--radius); margin-bottom: 2rem; }
.welcome-banner h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.welcome-banner p { opacity: 0.9; }

.action-buttons { display: flex; gap: 0.5rem; }
.action-btn { padding: 0.25rem 0.5rem; border: none; background: var(--gray-100); border-radius: 4px; cursor: pointer; color: var(--gray-600); }
.action-btn:hover { background: var(--gray-200); }

.search-bar { position: relative; }
.search-bar input { padding-left: 2.5rem; }
.search-bar::before { content: '🔍'; position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 0.875rem; }

.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.pagination button { padding: 0.5rem 1rem; border: 1px solid var(--gray-200); background: #fff; cursor: pointer; }
.pagination button:hover { background: var(--gray-50); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }