/* LeadPro - Clean White/Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --primary-dark: #5b4cdb;
    --accent: #6c5ce7;
    --bg: #f8f9fb;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: #ffffff;
    --bg-input: #f1f3f5;
    --bg-hover: #f4f3ff;
    --text: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e5e7eb;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --header-height: 60px;
    --sidebar-width: 250px;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* === SKELETON LOADER === */
#pageLoader {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s, visibility 0.4s;
}
#pageLoader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* === HEADER === */
.top-nav {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.nav-left { display: flex; align-items: center; gap: 0.75rem; }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.brand {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1.2rem; font-weight: 800; color: var(--text);
}
.brand i { color: var(--primary); font-size: 1.1rem; }
.brand .accent { color: var(--primary); }
.menu-toggle {
    display: none; background: none; border: none; font-size: 1.2rem;
    color: var(--text); cursor: pointer; padding: 0.4rem;
}
.nav-btn {
    background: none; border: none; font-size: 1.1rem; color: var(--text-secondary);
    cursor: pointer; padding: 0.5rem; border-radius: var(--radius-xs); position: relative;
    transition: color 0.2s, background 0.2s; text-decoration: none;
}
.nav-btn:hover { color: var(--primary); background: var(--bg-hover); }
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--error); color: #fff; font-size: 0.6rem; font-weight: 700;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.user-dropdown {
    display: none; position: absolute; top: 100%; right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    min-width: 180px; padding: 0.5rem 0; z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 1rem; color: var(--text); text-decoration: none;
    font-size: 0.85rem; font-weight: 500; transition: background 0.15s;
}
.user-dropdown a:hover { background: var(--bg-hover); }
.user-dropdown a.danger { color: var(--error); }

/* === SIDEBAR === */
.sidebar {
    position: fixed; top: var(--header-height); left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto; z-index: 90;
    padding: 1rem 0;
    transition: transform 0.3s;
}
.sidebar-header { padding: 0.75rem 1rem 1rem; border-bottom: 1px solid var(--border-light); }
.user-info { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar-lg {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.user-info h3 { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.user-info small { font-size: 0.75rem; color: var(--text-muted); }
.sidebar-nav { padding: 0.5rem 0.6rem; }
.nav-item {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 0.85rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.85rem; font-weight: 500; transition: all 0.15s;
    margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--primary); }
.nav-item.active {
    background: var(--bg-hover); color: var(--primary); font-weight: 600;
    border-left: 3px solid var(--primary);
}
.nav-item.logout { color: var(--error); }
.nav-item.logout:hover { background: #fef2f2; }
.count-badge {
    margin-left: auto; background: var(--bg-input); color: var(--text-secondary);
    padding: 2px 8px; border-radius: 20px; font-size: 0.7rem; font-weight: 600;
}
.sidebar-divider { height: 1px; background: var(--border-light); margin: 0.75rem 0.85rem; }
.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3); z-index: 85;
}
.sidebar-overlay.active { display: block; }

/* === MAIN CONTENT === */
.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: calc(100vh - var(--header-height));
}
.view { display: none; }
.view.active { display: block; }
.view-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;
}
.view-header h2 {
    font-size: 1.3rem; font-weight: 800; color: var(--text);
    display: flex; align-items: center; gap: 0.5rem;
}
.view-header h2 i { color: var(--primary); font-size: 1.1rem; }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 600; border: none;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
    font-family: inherit;
}
.btn-primary {
    background: var(--primary); color: #fff;
    box-shadow: 0 2px 8px rgba(108,92,231,0.25);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(108,92,231,0.35); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-input); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-outline {
    background: transparent; color: var(--primary); border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--bg-hover); }
.btn-success { background: var(--success); color: #fff; }

/* === STATS === */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.stat-card.total .stat-icon { background: rgba(108,92,231,0.1); color: var(--primary); }
.stat-card.hot .stat-icon { background: rgba(239,68,68,0.1); color: #ef4444; }
.stat-card.cold .stat-icon { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-top: 0.2rem; }

/* === SEARCH === */
.search-bar {
    position: relative; margin-bottom: 1rem;
}
.search-bar i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-bar input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text);
    font-size: 0.9rem; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,92,231,0.1); }
.search-bar input::placeholder { color: var(--text-muted); }
.search-clear {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 0.9rem; padding: 0.25rem;
}

/* === FILTER TABS === */
.filter-tabs {
    display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
}
.filter-tab {
    padding: 0.4rem 1rem; border-radius: 20px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-secondary);
    font-size: 0.8rem; font-weight: 500; cursor: pointer;
    transition: all 0.2s; font-family: inherit;
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* === LEAD CARDS === */
.leads-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}
.lead-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.15rem;
    cursor: pointer; transition: box-shadow 0.2s, border-color 0.2s;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--border);
}
.lead-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.lead-card.status-hot { border-left-color: #ef4444; }
.lead-card.status-warm { border-left-color: #f59e0b; }
.lead-card.status-cold { border-left-color: #3b82f6; }
.lead-card.status-other { border-left-color: var(--primary); }
.lead-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.lead-card-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.lead-card-company { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.lead-card-context {
    font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5;
    margin-bottom: 0.5rem;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lead-card-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.lead-meta-item {
    font-size: 0.75rem; color: var(--text-muted);
    display: flex; align-items: center; gap: 0.3rem;
}
.lead-meta-item i { font-size: 0.7rem; color: var(--primary-light); }
.lead-meta-item.overdue { color: var(--error); }
.lead-meta-item.overdue i { color: var(--error); }
.lead-meta-item.upcoming { color: var(--success); }
.lead-card-actions { display: flex; gap: 0.4rem; justify-content: flex-end; padding-top: 0.5rem; border-top: 1px solid var(--border-light); }
.lead-action-btn {
    background: none; border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 0.35rem 0.6rem; cursor: pointer; color: var(--text-muted);
    font-size: 0.75rem; transition: all 0.15s;
}
.lead-action-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--bg-hover); }
.lead-action-btn.delete:hover { color: var(--error); border-color: var(--error); background: #fef2f2; }

/* Status Badge */
.status-badge {
    padding: 0.2rem 0.6rem; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.status-badge.status-hot { background: rgba(239,68,68,0.1); color: #dc2626; }
.status-badge.status-warm { background: rgba(245,158,11,0.1); color: #d97706; }
.status-badge.status-cold { background: rgba(59,130,246,0.1); color: #2563eb; }
.status-badge.status-other { background: rgba(108,92,231,0.1); color: var(--primary); }

/* Empty State */
.empty-state {
    text-align: center; padding: 3rem 1.5rem; color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; color: #d1d5db; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }

/* === MODALS === */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35); backdrop-filter: blur(4px);
    z-index: 500; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card); border-radius: var(--radius);
    width: 100%; max-width: 600px; max-height: 90vh;
    overflow-y: auto; box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: modalIn 0.25s;
}
@keyframes modalIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-lg { max-width: 800px; }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.modal-header h3 i { color: var(--primary); }
.modal-close {
    background: none; border: none; font-size: 1.1rem; color: var(--text-muted);
    cursor: pointer; padding: 0.25rem; border-radius: var(--radius-xs);
    transition: color 0.15s;
}
.modal-close:hover { color: var(--error); }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-actions {
    display: flex; justify-content: flex-end; gap: 0.75rem;
    padding-top: 1rem; margin-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

/* === FORMS === */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 0.35rem;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.6rem 0.85rem;
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: var(--bg-input); color: var(--text);
    font-size: 0.88rem; font-family: inherit;
    transition: border-color 0.2s, box-shadow 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(108,92,231,0.1);
    background: #fff;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Status Selector */
.status-selector { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.status-option {
    padding: 0.35rem 0.8rem; border-radius: 20px; border: 1px solid var(--border);
    cursor: pointer; font-size: 0.8rem; font-weight: 500;
    transition: all 0.15s; background: var(--bg-input); color: var(--text-secondary);
}
.status-option:has(input:checked) {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.status-option input { display: none; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-slider {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #d1d5db; border-radius: 22px; cursor: pointer;
    transition: all 0.3s;
}
.toggle-slider::before {
    content: ''; position: absolute; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background: #fff;
    border-radius: 50%; transition: transform 0.3s;
}
input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch.sm { width: 36px; height: 18px; }
.toggle-switch.sm .toggle-slider::before { height: 12px; width: 12px; left: 3px; bottom: 3px; }
.toggle-switch.sm input:checked + .toggle-slider::before { transform: translateX(17px); }

/* Settings */
.settings-container { display: grid; gap: 1rem; max-width: 700px; }
.settings-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.settings-card h3 {
    font-size: 0.95rem; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
}
.settings-card h3 i { color: var(--primary); font-size: 0.85rem; }
.setting-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.65rem 0; border-bottom: 1px solid var(--border-light);
}
.setting-row:last-child { border-bottom: none; }
.setting-row.compact { padding: 0.4rem 0; border: none; }
.setting-info strong { font-size: 0.85rem; color: var(--text); display: block; }
.setting-info small { font-size: 0.75rem; color: var(--text-muted); }

/* Notification Config Section */
.notif-config-section {
    background: var(--bg-input); border-radius: var(--radius-sm);
    padding: 1rem; margin-top: 0.5rem;
}
.notif-config-section h4 {
    font-size: 0.85rem; font-weight: 600; color: var(--text);
    margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.4rem;
}
.notif-config-section h4 i { color: var(--primary); }

/* Notification Subsections */
.notif-subsection {
    background: var(--bg-card); border-radius: var(--radius-sm);
    padding: 0.75rem; border: 1px solid var(--border-light);
}
.notif-hint {
    display: block; font-size: 0.72rem; color: var(--text-muted);
    margin-top: 0.25rem; padding-left: 0.1rem;
}

/* Recurring Quick-Set Chips */
.recur-section {
    margin-top: 0.6rem; padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}
.recur-label {
    font-size: 0.78rem; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem;
}
.recur-label i { color: var(--primary); font-size: 0.72rem; }
.recur-chips {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.recur-chip {
    padding: 0.3rem 0.65rem; font-size: 0.72rem; font-weight: 600;
    border: 1.5px solid var(--border-light); border-radius: 20px;
    background: var(--bg-card); color: var(--text);
    cursor: pointer; transition: all 0.15s ease;
    white-space: nowrap;
}
.recur-chip:hover {
    border-color: var(--primary); color: var(--primary);
    background: rgba(108, 92, 231, 0.06);
}
.recur-chip.active {
    border-color: var(--primary); color: #fff;
    background: var(--primary); box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}
.recur-active-hint {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 0.72rem; color: var(--primary); font-weight: 600;
    margin-top: 0.4rem;
}
.recur-active-hint i { font-size: 0.68rem; }
.recur-clear-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.2rem;
    transition: color 0.15s;
}
.recur-clear-btn:hover { color: var(--danger, #ef4444); }

/* Status Config */
.status-config-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border-light);
    margin-bottom: 0.5rem; transition: box-shadow 0.15s;
}
.status-config-item:hover { box-shadow: var(--shadow-sm); }
.status-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.status-config-icon { font-size: 1.1rem; }
.status-config-name { flex: 1; font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* Rules */
.rule-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
}
.rule-header { display: flex; justify-content: space-between; align-items: center; }
.rule-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.rule-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

/* Orders & Invoices */
.order-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem; background: var(--bg-input); border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}
.order-info h4 { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.order-info p { font-size: 0.78rem; color: var(--text-muted); }
.order-amount { font-size: 1rem; font-weight: 700; color: var(--success); }
.invoice-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem; background: var(--bg-input); border-radius: var(--radius-sm);
    cursor: pointer; margin-bottom: 0.4rem; transition: background 0.15s;
}
.invoice-item:hover { background: #e8e6ff; }
.invoice-item i { color: var(--error); font-size: 1.1rem; }
.invoice-item span { flex: 1; font-size: 0.85rem; color: var(--text); font-weight: 500; }

/* Detail Tabs */
.detail-tabs { display: flex; gap: 0; margin-bottom: 1.25rem; border-bottom: 2px solid var(--border-light); }
.detail-tab {
    padding: 0.6rem 1.15rem; background: none; border: none;
    font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
    cursor: pointer; position: relative; transition: color 0.2s;
    font-family: inherit;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--primary); }
.detail-tab.active::after {
    content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
    height: 2px; background: var(--primary); border-radius: 2px;
}

/* PDF Viewer */
.pdf-viewer { width: 100%; height: 70vh; border: none; border-radius: 0 0 var(--radius) var(--radius); }

/* === NOTIFICATION PANEL === */
.notif-panel {
    position: fixed; top: var(--header-height); right: -360px; bottom: 0;
    width: 360px; background: var(--bg-card); border-left: 1px solid var(--border);
    z-index: 200; box-shadow: var(--shadow-lg); transition: right 0.3s;
    overflow-y: auto;
}
.notif-panel.open { right: 0; }
.notif-panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light);
}
.notif-panel-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.notif-panel-header h3 i { color: var(--primary); }
.notif-item {
    padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border-light);
    cursor: pointer; transition: background 0.15s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: #f4f3ff; border-left: 3px solid var(--primary); }
.notif-item h4 { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.notif-item p { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }
.notif-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; }
.notif-empty { text-align: center; padding: 2rem; color: var(--text-muted); }
.notif-empty i { font-size: 2rem; color: #d1d5db; display: block; margin-bottom: 0.5rem; }
.notif-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.15); z-index: 195; }

/* Location Results */
.location-results {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); max-height: 200px; overflow-y: auto;
    z-index: 50; box-shadow: var(--shadow-md);
}
.location-results.open { display: block; }
.location-result-item {
    padding: 0.6rem 0.85rem; cursor: pointer; font-size: 0.82rem;
    color: var(--text); transition: background 0.15s;
    display: flex; align-items: flex-start;
}
.location-result-item:hover { background: var(--bg-hover); }

/* Scan Area */
.scan-area {
    border: 2px dashed var(--border); border-radius: var(--radius-sm);
    padding: 1.5rem; text-align: center; cursor: pointer;
    transition: border-color 0.2s; position: relative;
}
.scan-area:hover { border-color: var(--primary); }
.scan-area i { font-size: 1.5rem; color: var(--text-muted); display: block; margin-bottom: 0.3rem; }
.scan-area p { font-size: 0.8rem; color: var(--text-muted); }
.scan-preview {
    max-width: 100%; max-height: 150px; border-radius: var(--radius-xs);
    object-fit: contain;
}

/* === TOAST === */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    padding: 0.75rem 1.25rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; gap: 0.5rem;
    box-shadow: var(--shadow-lg); animation: toastIn 0.3s;
    transition: opacity 0.3s;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.error i { color: var(--error); }
.toast.info { border-left: 4px solid var(--primary); }
.toast.info i { color: var(--primary); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === LOGIN PAGE === */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f8f9fb 0%, #eef2ff 50%, #f8f9fb 100%);
    padding: 1.5rem;
}
.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; padding: 2.5rem;
    width: 100%; max-width: 420px;
    box-shadow: 0 8px 40px rgba(108,92,231,0.08);
}
.login-logo {
    text-align: center; margin-bottom: 2rem;
}
.login-logo-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: var(--primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 0.75rem;
    box-shadow: 0 4px 15px rgba(108,92,231,0.3);
}
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.login-logo h1 span { color: var(--primary); }
.login-logo p { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }
.login-input-group {
    position: relative; margin-bottom: 1.25rem;
}
.login-input-group label {
    display: block; font-size: 0.82rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 0.35rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.login-input-group label i { color: var(--primary); font-size: 0.85rem; }
.login-input-group input {
    width: 100%; padding: 0.7rem 1rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input); color: var(--text);
    font-size: 0.9rem; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input-group input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,0.1); background: #fff;
}
.login-btn {
    width: 100%; padding: 0.75rem; border: none;
    background: var(--primary); color: #fff;
    font-size: 0.95rem; font-weight: 700; font-family: inherit;
    border-radius: var(--radius-sm); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(108,92,231,0.25);
}
.login-btn:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(108,92,231,0.35); }
.login-btn:active { transform: scale(0.98); }
.login-error {
    background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
    padding: 0.7rem 1rem; border-radius: var(--radius-xs);
    font-size: 0.85rem; margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.login-footer { text-align: center; margin-top: 1.5rem; font-size: 0.8rem; color: var(--text-muted); }
.password-toggle {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer;
}

/* PWA Install Banner */
.pwa-install-banner {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.85rem 1rem;
    margin-top: 1.25rem; display: none;
    text-align: center; animation: fadeIn 0.3s;
}
.pwa-install-banner p { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.pwa-install-btn {
    padding: 0.5rem 1.25rem; border: none; border-radius: var(--radius-xs);
    background: var(--primary); color: #fff; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: background 0.2s;
}
.pwa-install-btn:hover { background: var(--primary-dark); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .sidebar { transform: translateX(-100%); z-index: 95; box-shadow: none; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-content { margin-left: 0; padding: 1rem; }
    .leads-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .view-header h2 { font-size: 1.1rem; }
    .btn .btn-text { display: none; }
    .notif-panel { width: 100%; right: -100%; }
    .login-card { padding: 2rem 1.5rem; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .top-nav { padding: 0 0.85rem; }
}
