/* php-app/style.css */
:root {
    --bg-base: #060913;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --border-color: #334155;
    --border-color-hover: #475569;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-sky: #38bdf8;
    --accent-sky-glow: rgba(56, 189, 248, 0.15);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.15);
    --accent-rose: #f43f5e;
    --accent-rose-glow: rgba(244, 63, 94, 0.15);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Navigation Header */
.app-header {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.logo-icon {
    font-size: 1.5rem;
}
.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    background: linear-gradient(135deg, #ffffff, var(--accent-sky));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.app-nav {
    display: flex;
    gap: 8px;
}
.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
    color: var(--accent-sky);
    background: var(--accent-sky-glow);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
}
.user-avatar {
    font-size: 1rem;
}
.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}
.user-role {
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.logout-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.logout-btn:hover {
    color: var(--text-primary);
    background: var(--accent-rose-glow);
    border-color: rgba(244, 63, 94, 0.4);
}

/* App Container Layout */
.app-container {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

.app-footer {
    border-top: 1px solid var(--border-color);
    background: #090d16;
    padding: 16px 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.db-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Cards & Layout */
.page-header {
    margin-bottom: 24px;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.card-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.card-stat::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-sky);
}
.card-stat.emerald::after { background: var(--accent-emerald); }
.card-stat.rose::after { background: var(--accent-rose); }

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Filter Card Panel */
.filter-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}
.filter-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-control {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.form-control:focus {
    border-color: var(--accent-sky);
}

.filter-search-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    width: 100%;
    margin-bottom: 16px;
}
.filter-search-bar .search-field {
    flex: 1;
}
.filter-search-bar .search-submit-btn {
    height: 38px;
    white-space: nowrap;
}
.filter-collapsible-content {
    display: block;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent-sky);
    color: #000000;
}
.btn-primary:hover {
    background: #58d0ff;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
}
.btn-danger {
    background: var(--accent-rose-glow);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--accent-rose);
}
.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: var(--accent-rose);
}
.link-btn {
    background: none;
    border: none;
    color: var(--accent-sky);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    text-align: left;
}
.link-btn:hover {
    color: #58d0ff;
}

/* Responsive Table Styles (Desktop View) */
.table-responsive {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
}
.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.leads-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}
.leads-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.leads-table tr:last-child td {
    border-bottom: none;
}
.leads-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-new { background: rgba(56, 189, 248, 0.1); color: var(--accent-sky); border: 1px solid rgba(56, 189, 248, 0.2); }
.badge-completed { background: rgba(16, 185, 129, 0.1); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-default { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* --- Mobile-First Layout Override (< 768px) --- */
@media screen and (max-width: 768px) {
    .header-container {
        padding: 10px 16px;
    }
    .app-nav {
        order: 3;
        width: 100%;
        justify-content: space-around;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
    }
    .nav-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .app-container {
        padding: 16px;
    }
}

/* Modals & Backdrops (Native dialog) */
.modal-dialog {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin: auto;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-premium);
    outline: none;
}
.modal-dialog::backdrop {
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(4px);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}
.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover {
    color: var(--text-primary);
}
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
}

/* Login Page Styling */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-base);
    min-height: 100vh;
}
.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-premium);
}
.login-header {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo {
    font-size: 2.5rem;
    margin-bottom: 8px;
    display: block;
}
.login-title {
    font-size: 1.5rem;
    font-weight: 700;
}
.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.alert {
    background: var(--accent-rose-glow);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}
.pagination-controls {
    display: flex;
    gap: 8px;
}
.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Notes layout inside modal */
.notes-list {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.note-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.note-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.note-text {
    line-height: 1.4;
}

/* Highlight fresh leads already in DB green */
.leads-table tr.row-imported td {
    background-color: rgba(34, 197, 94, 0.25) !important;
    border-bottom-color: rgba(34, 197, 94, 0.4) !important;
}
.leads-table tr.row-imported:hover td {
    background-color: rgba(34, 197, 94, 0.35) !important;
}

/* Fresh leads legend styles */
.fresh-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: center;
}
.fresh-legend-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.fresh-legend__swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 6px;
}
.fresh-legend__swatch--existing {
    background: rgba(34, 197, 94, 0.85);
}
.fresh-legend__swatch--new {
    background: rgba(255, 255, 255, 0.18);
}

/* Display controls for responsive layouts */
.desktop-only {
    display: block;
}
.mobile-only {
    display: none;
}

@media screen and (max-width: 768px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
    
    /* Avoid header overflow */
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 10px 16px;
    }
    .user-profile {
        justify-content: space-between;
        width: 100%;
    }
    .app-nav {
        order: 3;
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
        gap: 4px;
    }
    .nav-item {
        padding: 6px 8px;
        font-size: 0.75rem;
        flex: 1;
        text-align: center;
    }
    
    /* Avoid container/filters overflow */
    .app-container {
        padding: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .filter-panel {
        padding: 12px;
    }
    .filter-search-bar {
        gap: 8px;
        align-items: center;
        margin-bottom: 0;
    }
    .filter-search-bar .search-field label {
        display: none;
    }
    .filter-search-bar .toggle-filters-btn {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 8px 12px;
        height: 38px;
    }
    .filter-collapsible-content {
        display: none;
        margin-top: 12px;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
    }
    .filter-collapsible-content.expanded {
        display: block;
    }
    .filter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .filter-actions {
        margin-top: 16px;
        justify-content: space-between;
    }
    .filter-actions .btn {
        flex: 1;
    }
    
    /* Mobile Card Layout */
    .mobile-leads-list {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 24px;
        width: 100%;
    }
    .mobile-lead-card {
        background: transparent;
        border: none;
        border-bottom: 1px dashed var(--border-color);
        border-radius: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        box-shadow: none;
        box-sizing: border-box;
        width: 100%;
    }
    .mobile-lead-card:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .mobile-lead-card.row-imported {
        background: rgba(34, 197, 94, 0.18);
        border: 1.5px solid rgba(34, 197, 94, 0.45);
        border-radius: 8px;
        padding: 12px;
        border-bottom: none;
    }
    .mobile-lead-card:hover {
        background: none;
    }
    .mobile-card-grid {
        display: grid;
        grid-template-columns: max-content 1fr max-content;
        gap: 10px;
        align-items: start;
        width: 100%;
    }
    .mobile-grid-col {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }
    
    .col-dates {
        font-size: 0.68rem;
        color: var(--text-muted);
    }
    .col-dates .label {
        font-weight: 600;
        color: var(--text-secondary);
    }
    .col-dates .mobile-date {
        line-height: 1.2;
        white-space: nowrap;
    }
    
    .col-name-number {
        align-items: flex-start;
    }
    .mobile-name-btn {
        font-weight: 600;
        font-size: 0.88rem;
        color: var(--text-primary);
        text-decoration: none;
        padding: 0;
        text-align: left;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1.3;
    }
    .mobile-name-btn:hover {
        text-decoration: underline;
    }
    .mobile-phone-btn {
        font-size: 0.76rem;
        color: var(--text-secondary);
        text-decoration: none;
        padding: 0;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        margin-top: 2px;
    }
    .mobile-phone-btn:hover {
        text-decoration: underline;
    }
    
    .col-project-status {
        align-items: flex-start;
    }
    .mobile-project {
        font-size: 0.76rem;
        color: var(--text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .mobile-status-btn {
        text-decoration: none;
        padding: 0;
        margin-top: 4px;
        max-width: 100%;
    }
    .mobile-status-btn .badge {
        font-size: 0.62rem;
        padding: 2px 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    .mobile-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px dashed var(--border-color);
        padding-top: 8px;
        margin-top: 4px;
        width: 100%;
    }
    .mobile-id {
        font-size: 0.7rem;
        color: var(--text-muted);
        font-weight: 600;
    }
    .mobile-notes-btn {
        font-size: 0.68rem !important;
        padding: 4px 6px !important;
    }
    .mobile-card-grid-4col {
        display: grid;
        grid-template-columns: max-content 1.1fr max-content 1.1fr;
        gap: 8px;
        align-items: start;
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* Journey Timeline Styles inside Modal */
.journey-timeline-wrapper {
    margin-top: 0.5rem;
    width: 100%;
}
.journey-slider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0 0.75rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}
.journey-slider::-webkit-scrollbar {
    height: 6px;
}
.journey-slider::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

/* Timeline Connectors */
.journey-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
    padding: 0 2px;
}

/* Journey Card with left color bar indicators */
.journey-card {
    flex: 0 0 150px;
    background: linear-gradient(135deg, var(--bg-surface-elevated), rgba(8, 12, 26, 0.95));
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-sky);
    border-radius: 12px;
    padding: 10px 12px;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.journey-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-color-hover);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

/* Differentiate Source vs Status updates visually */
.journey-card.journey-card--source {
    border-left-color: var(--accent-emerald);
}
.journey-card.journey-card--source .journey-card__title {
    color: var(--accent-emerald);
}

.journey-card.journey-card--status {
    border-left-color: var(--accent-sky);
}
.journey-card.journey-card--status .journey-card__title {
    color: var(--accent-sky);
}

.journey-card__body {
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 2;
    position: relative;
}
.journey-card__icon {
    font-size: 1.35rem;
    margin-bottom: 2px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.journey-card__title {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}
.journey-card__value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.journey-card__meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.25;
}

/* Custom Multi-select Dropdown styles */
.multiselect-dropdown {
    position: relative;
    width: 100%;
}
.multiselect-display {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    box-sizing: border-box;
    min-height: 38px;
}
.multiselect-display:hover {
    border-color: var(--accent-sky);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}
.multiselect-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
    font-weight: 500;
}
.multiselect-arrow {
    font-size: 0.65rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}
.multiselect-dropdown.active .multiselect-arrow {
    transform: rotate(180deg);
}

.multiselect-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0b1120;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg), 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    padding: 6px 0;
    box-sizing: border-box;
}
.multiselect-dropdown.active .multiselect-menu {
    display: block;
}

.multiselect-menu::-webkit-scrollbar {
    width: 6px;
}
.multiselect-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 0.82rem;
    color: var(--text-secondary);
    user-select: none;
    box-sizing: border-box;
}
.multiselect-option:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}
.multiselect-option input[type="checkbox"] {
    accent-color: var(--accent-sky);
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.multiselect-option span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sortable table headers styling */
.leads-table th a.sort-header {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}
.leads-table th a.sort-header:hover {
    color: var(--text-primary);
}


