/* Seller Lead Engine - Styles */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* User section in navbar */
.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    color: var(--dark);
    font-weight: 500;
}

.nav-link-small {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link-small:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* Navigation Divider */
.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 0.5rem;
}

/* ============================================
   APP SWITCHER
   ============================================ */

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-switcher {
    position: relative;
}

.app-switcher-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.app-switcher-btn:hover {
    background: rgba(255,255,255,0.2);
}

.app-switcher-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    min-width: 260px;
    padding: 0.5rem;
    display: none;
    z-index: 1000;
}

.app-switcher-menu.show {
    display: block;
}

.app-switcher-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.2s;
}

.app-switcher-item:hover {
    background: var(--light);
}

.app-switcher-item.active {
    background: var(--light);
}

.app-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* Prevent SVG icon strokes from being clipped at the viewport boundary */
.app-icon svg,
.brand-icon svg,
.widget-title svg,
.widget-option-icon svg,
.activity-icon svg {
    overflow: visible;
}

.app-icon-leads {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.app-icon-marketing {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.app-icon-admin {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.app-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.app-desc {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* Brand Icons in Navbar */
.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-icon-leads {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.brand-icon-marketing {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.brand-icon-admin {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* ============================================
   SELLER LEAD ENGINE THEME (Blue)
   ============================================ */

.leads-theme {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
}

.navbar-leads {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
    border-bottom: none;
}

.navbar-leads .nav-brand a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-leads .nav-links a {
    color: rgba(255,255,255,0.7);
}

.navbar-leads .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.navbar-leads .nav-links a.active {
    color: white;
    background: rgba(37, 99, 235, 0.4);
}

.navbar-leads .nav-user .user-name {
    color: white;
}

.navbar-leads .nav-link-small {
    color: rgba(255,255,255,0.7);
}

.navbar-leads .nav-link-small:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.leads-theme .footer {
    background: #0f2744;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   HOME DASHBOARD THEME (Indigo/Purple)
   ============================================ */

.home-theme {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
}

.navbar-home {
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
    border-bottom: none;
}

.navbar-home .nav-brand a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-home .nav-links a {
    color: rgba(255,255,255,0.7);
}

.navbar-home .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.navbar-home .nav-links a.active {
    color: white;
    background: rgba(99, 102, 241, 0.4);
}

.navbar-home .nav-user .user-name {
    color: white;
}

.navbar-home .nav-link-small {
    color: rgba(255,255,255,0.7);
}

.navbar-home .nav-link-small:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.home-theme .footer {
    background: #1e1b4b;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   MARKETING HUB THEME (Purple)
   ============================================ */

.marketing-theme {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
}

.navbar-marketing {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: none;
}

.navbar-marketing .nav-brand a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-marketing .nav-links a {
    color: rgba(255,255,255,0.7);
}

.navbar-marketing .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.navbar-marketing .nav-links a.active {
    color: white;
    background: rgba(139, 92, 246, 0.3);
}

.navbar-marketing .nav-user .user-name {
    color: white;
}

.navbar-marketing .nav-link-small {
    color: rgba(255,255,255,0.7);
}

.navbar-marketing .nav-link-small:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.marketing-theme .footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   ADMIN THEME (Gray)
   ============================================ */

.admin-theme {
    --primary: #64748b;
    --primary-dark: #475569;
}

.navbar-admin {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-bottom: none;
}

.navbar-admin .nav-brand a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-admin .nav-links a {
    color: rgba(255,255,255,0.7);
}

.navbar-admin .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.navbar-admin .nav-links a.active {
    color: white;
    background: rgba(100, 116, 139, 0.4);
}

.navbar-admin .nav-user .user-name {
    color: white;
}

.navbar-admin .nav-link-small {
    color: rgba(255,255,255,0.7);
}

.navbar-admin .nav-link-small:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.admin-theme .footer {
    background: #1f2937;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   CRM THEME (Teal/Green)
   ============================================ */

.crm-theme {
    --primary: #0d9488;
    --primary-dark: #0f766e;
}

.navbar-crm {
    background: linear-gradient(135deg, #134e4a 0%, #0f3d3a 100%);
    border-bottom: none;
}

.navbar-crm .nav-brand a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-crm .nav-links a {
    color: rgba(255,255,255,0.7);
}

.navbar-crm .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.navbar-crm .nav-links a.active {
    color: white;
    background: rgba(13, 148, 136, 0.4);
}

.navbar-crm .nav-user .user-name {
    color: white;
}

.navbar-crm .nav-link-small {
    color: rgba(255,255,255,0.7);
}

.navbar-crm .nav-link-small:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.crm-theme .footer {
    background: #0f3d3a;
    color: rgba(255,255,255,0.6);
}

/* CRM App Icons */
.app-icon-crm {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.brand-icon-crm {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.app-badge-crm {
    background: #ccfbf1;
    color: #0f766e;
}

/* CRM Pipeline Stage Badges */
.pipeline-stage-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stage-new { background: #dbeafe; color: #1e40af; }
.stage-contacted { background: #fef3c7; color: #92400e; }
.stage-qualified { background: #d1fae5; color: #065f46; }
.stage-showing { background: #e9d5ff; color: #7c3aed; }
.stage-offer { background: #fce7f3; color: #be185d; }
.stage-contract { background: #cffafe; color: #0e7490; }
.stage-closed { background: #dcfce7; color: #166534; }
.stage-lost { background: #fee2e2; color: #991b1b; }

/* CRM Deal Stage Badges */
.deal-stage-prospecting { background: #dbeafe; color: #1e40af; }
.deal-stage-showing { background: #e9d5ff; color: #7c3aed; }
.deal-stage-offer { background: #fce7f3; color: #be185d; }
.deal-stage-negotiation { background: #fef3c7; color: #92400e; }
.deal-stage-pending { background: #cffafe; color: #0e7490; }
.deal-stage-closed_won { background: #dcfce7; color: #166534; }
.deal-stage-closed_lost { background: #fee2e2; color: #991b1b; }

/* CRM Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.activity-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

.activity-type-call::before { background: #3b82f6; box-shadow: 0 0 0 2px #3b82f6; }
.activity-type-email::before { background: #8b5cf6; box-shadow: 0 0 0 2px #8b5cf6; }
.activity-type-text::before { background: #10b981; box-shadow: 0 0 0 2px #10b981; }
.activity-type-note::before { background: #6b7280; box-shadow: 0 0 0 2px #6b7280; }
.activity-type-meeting::before { background: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }
.activity-type-showing::before { background: #ec4899; box-shadow: 0 0 0 2px #ec4899; }

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

.activity-type {
    font-weight: 600;
    text-transform: capitalize;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--secondary);
}

.activity-description {
    color: var(--dark);
    font-size: 0.875rem;
}

/* CRM Task Styles */
.task-priority-urgent { border-left: 4px solid #ef4444; }
.task-priority-high { border-left: 4px solid #f59e0b; }
.task-priority-normal { border-left: 4px solid #3b82f6; }
.task-priority-low { border-left: 4px solid #6b7280; }

.task-status-pending { color: #92400e; }
.task-status-completed { color: #166534; text-decoration: line-through; }
.task-status-cancelled { color: #991b1b; text-decoration: line-through; }

/* CRM Contact Type Badges */
.contact-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.contact-type-lead { background: #dbeafe; color: #1e40af; }
.contact-type-buyer { background: #d1fae5; color: #065f46; }
.contact-type-seller { background: #fef3c7; color: #92400e; }
.contact-type-past_client { background: #e9d5ff; color: #7c3aed; }
.contact-type-sphere { background: #f3f4f6; color: #374151; }

/* CRM Stats Cards */
.crm-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.crm-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
}

.crm-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.crm-stat-label {
    font-size: 0.875rem;
    color: var(--secondary);
    margin-top: 0.25rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    color: var(--secondary);
}

/* Form Elements */
input, select, textarea {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input {
    min-width: 250px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
}

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

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

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead {
    background: var(--light);
}

th, td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    user-select: none;
}

th:hover {
    color: var(--primary);
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.02);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.25rem;
}

.tag-absentee {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-bay-area {
    background: #dcfce7;
    color: #166534;
}

.tag-investor {
    background: #fef3c7;
    color: #92400e;
}

.tag-equity {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Score Badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 2rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.score-high {
    background: #dcfce7;
    color: #166534;
}

.score-medium {
    background: #fef3c7;
    color: #92400e;
}

.score-low {
    background: #fee2e2;
    color: #991b1b;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
}

.pagination span {
    color: var(--secondary);
    font-size: 0.875rem;
}

/* Upload Area */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.upload-text {
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--secondary);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* Sliders */
.slider-group {
    margin-bottom: 1.5rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.slider-label {
    font-weight: 500;
}

.slider-value {
    color: var(--primary);
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Charts */
.chart-container {
    position: relative;
    height: 200px;
    margin-top: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--secondary);
    font-size: 0.875rem;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Modal - Full screen overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

/* Modal content box - used inside .modal-overlay */
.modal-overlay .modal,
.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content-large {
    max-width: 700px;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .search-input {
        min-width: 100%;
    }

    /* Center app-switcher menu on mobile */
    .app-switcher-menu {
        position: fixed;
        left: 5%;
        right: 5%;
        top: 120px;
        width: 90%;
        max-width: none;
        transform: none;
    }
}

/* Lead Detail */
.lead-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.lead-detail-item {
    padding: 0.5rem 0;
}

.lead-detail-label {
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
}

.lead-detail-value {
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Score Breakdown */
.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--light);
    border-radius: 4px;
}

.breakdown-label {
    color: var(--secondary);
}

.breakdown-points {
    font-weight: 600;
    color: var(--success);
}

/* Two column layout */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .two-columns {
        grid-template-columns: 1fr;
    }
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: var(--primary);
}

.radio-option.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.radio-option input {
    display: none;
}

/* Hidden */
.hidden {
    display: none !important;
}

/* ============================================
   OFFER WRITER THEME (Orange)
   ============================================ */

.offers-theme {
    --primary: #f97316;
    --primary-dark: #ea580c;
}

.navbar-offers {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-bottom: none;
}

.navbar-offers .nav-brand a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-offers .nav-links a {
    color: rgba(255,255,255,0.7);
}

.navbar-offers .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.navbar-offers .nav-links a.active {
    color: white;
    background: rgba(234, 88, 12, 0.4);
}

.navbar-offers .user-name {
    color: white;
}

.navbar-offers .nav-link-small {
    color: rgba(255,255,255,0.7);
}

.navbar-offers .nav-link-small:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.offers-theme .footer {
    background: #ea580c;
    color: rgba(255,255,255,0.6);
}

/* Offers App Icons */
.app-icon-offers {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.brand-icon-offers {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.app-badge-offers {
    background: #ffedd5;
    color: #c2410c;
}

/* ============================================
   BUYER HUB THEME (Sky Blue)
   ============================================ */

.buyer-theme {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
}

.navbar-buyer {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
    border-bottom: none;
}

.navbar-buyer .nav-brand a {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-buyer .nav-links a {
    color: rgba(255,255,255,0.7);
}

.navbar-buyer .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.navbar-buyer .nav-links a.active {
    color: white;
    background: rgba(14, 165, 233, 0.4);
}

.navbar-buyer .user-name {
    color: white;
}

.navbar-buyer .nav-link-small {
    color: rgba(255,255,255,0.7);
}

.navbar-buyer .nav-link-small:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.buyer-theme .footer {
    background: #0369a1;
    color: rgba(255,255,255,0.6);
}

/* Buyer App Icons */
.app-icon-buyer {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.brand-icon-buyer {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.app-badge-buyer {
    background: #e0f2fe;
    color: #0369a1;
}

/* Offer Status Badges */
.offer-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-draft { background: #f3f4f6; color: #6b7280; }
.status-filling { background: #dbeafe; color: #1e40af; }
.status-review { background: #fef3c7; color: #92400e; }
.status-signing { background: #fce7f3; color: #be185d; }
.status-sent { background: #d1fae5; color: #065f46; }
.status-completed { background: #dcfce7; color: #166534; }

/* Voice Input Styles */
.voice-input-container {
    position: relative;
}

.voice-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.voice-btn.listening {
    animation: pulse-voice 1.5s infinite;
}

@keyframes pulse-voice {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(249, 115, 22, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

.voice-feedback {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    min-height: 60px;
}

.voice-feedback .interim-text {
    color: #9ca3af;
    font-style: italic;
}

.voice-feedback .final-text {
    color: #1f2937;
    font-weight: 500;
}

/* Signature Pad Styles */
.signature-pad-container {
    background: white;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 1rem;
}

.signature-canvas {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.signature-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.signature-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.signature-tab {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.signature-tab:hover {
    border-color: #f97316;
}

.signature-tab.active {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
}

.signature-tab.signed {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #166534;
}

.signature-tab.signed::after {
    content: ' ✓';
}

/* PDF Preview Styles */
.pdf-preview-container {
    background: #1f2937;
    border-radius: 12px;
    padding: 1rem;
    overflow: auto;
    max-height: 600px;
}

.pdf-preview-image {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.pdf-page-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #374151;
    border-radius: 0 0 12px 12px;
    margin-top: -4px;
}

.pdf-page-controls button {
    background: #4b5563;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.pdf-page-controls button:hover:not(:disabled) {
    background: #6b7280;
}

.pdf-page-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-page-indicator {
    color: white;
    font-size: 0.875rem;
}

/* Question Card Styles */
.question-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.question-section {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f97316;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.question-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.question-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s;
}

.question-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.question-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
}

/* Offer Wizard Layout */
.offer-wizard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.wizard-left {
    display: flex;
    flex-direction: column;
}

.wizard-right {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

@media (max-width: 1024px) {
    .offer-wizard {
        grid-template-columns: 1fr;
    }

    .wizard-right {
        position: static;
    }
}

/* Template Upload Zone */
.template-upload-zone {
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.template-upload-zone:hover,
.template-upload-zone.dragover {
    border-color: #f97316;
    background: #fff7ed;
}

.template-upload-zone svg {
    width: 64px;
    height: 64px;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.template-upload-zone h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.template-upload-zone p {
    color: #6b7280;
}

/* Template List */
.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.template-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.template-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.template-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ffedd5;
    color: #ea580c;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.template-card-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.template-card-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.template-card-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.75rem;
}

.badge-ca { background: #dbeafe; color: #1e40af; }
.badge-nv { background: #fef3c7; color: #92400e; }

/* Offer Stats Cards */
.offer-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.offer-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.offer-stat-icon.draft { background: #f3f4f6; color: #6b7280; }
.offer-stat-icon.filling { background: #dbeafe; color: #2563eb; }
.offer-stat-icon.signing { background: #fef3c7; color: #d97706; }
.offer-stat-icon.sent { background: #d1fae5; color: #059669; }

.offer-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.offer-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* App Checkbox for Offers in Users page */
.app-checkbox-icon-offers {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}
