@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ===================== THEME VARIABLES ===================== */
:root {
    --primary: #00ff88;
    --secondary: #00d2ff;
    --bg-dark: #0a0e14;
    --surface: #11161f;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f4f8;
    --text-secondary: #7a8494;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --blue: #3498db;
    --nav-bg: rgba(10, 14, 20, 0.95);
    --card-bg: rgba(255, 255, 255, 0.03);
    --input-bg: #161b24;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --nav-height: 72px;
}

[data-theme="light"] {
    --primary: #00b05a;
    --secondary: #0077bb;
    --bg-dark: #f0f4f8;
    --surface: #ffffff;
    --glass: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --blue: #2563eb;
    --nav-bg: rgba(255, 255, 255, 0.98);
    --card-bg: rgba(0, 0, 0, 0.015);
    --input-bg: #f8fafc;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ===================== ACCESSIBILITY ===================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ===================== RESET & BASE ===================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.35s ease-out;
}

/* ===================== LAYOUT ===================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===================== NAV ===================== */
.glass-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    height: var(--nav-height);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    min-width: 0;
}

.brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-icon {
    background: var(--primary);
    padding: 7px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-btns {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* ===================== BUTTONS ===================== */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000 !important;
    font-weight: 700;
}

.btn-secondary {
    background: var(--blue);
    color: #fff !important;
}

.btn-outline {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-primary) !important;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-danger {
    background: var(--danger) !important;
    color: #fff !important;
    border: none;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ===================== GLASS PANELS ===================== */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ===================== HEADER ===================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1,
.page-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ===================== STATS GRID ===================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.25rem !important;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-icon {
    padding: 0.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

.hot-stat {
    border: 1px solid rgba(46, 204, 113, 0.4);
    position: relative;
    overflow: hidden;
}

.hot-stat::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(46, 204, 113, 0.05);
    animation: pulse 2s infinite;
}

/* ===================== SEARCH / LOGIC BAR ===================== */
.logic-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem !important;
    margin-bottom: 0 !important;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    background: #202124 !important;
    /* Deep phone app dark */
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0 0.75rem;
    height: 52px;
    width: 100%;
    gap: 0.5rem;
}

.search-box input {
    background: transparent;
    border: none;
    color: white;
    flex: 1;
    padding: 0 0.5rem;
    font-size: 1rem;
    outline: none;
}

.filter-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ===================== FORM CONTROLS ===================== */
.form-control {
    width: 100%;
    padding: 0.65rem 2rem 0.65rem 0.8rem;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.9rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8494' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
    height: 40px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-control option {
    background: var(--input-bg);
    color: var(--text-primary);
    padding: 8px;
}

.filter-group select.form-control {
    width: 150px;
    min-width: 130px;
}

/* Custom Dropdown Styling for Dashboard */
.filter-dropdown {
    height: 48px;
    border-radius: 12px;
    background-color: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.filter-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

.filter-dropdown option {
    background-color: #1a202c; /* Dark background for options to match screenshot */
    color: white;
    padding: 10px;
}

/* ===================== TABLE (DESKTOP) ===================== */
.table-container {
    padding: 0 !important;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--card-bg);
}

th {
    text-align: left;
    padding: 0.9rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.875rem;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ===================== BADGES ===================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.badge-sent {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.badge-delivered {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b2;
}

.badge-read {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.badge-replied {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
}

.badge-failed {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.badge-default {
    background: rgba(149, 165, 166, 0.15);
    color: #95a5a6;
}

/* ===================== CALL STATUS INDICATORS ===================== */
.status-indicator {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-indicator.interested {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.status-indicator.not-interested {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.status-indicator.call-back-later {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.25);
}

.status-indicator.busy-no-answer {
    background: rgba(243, 156, 18, 0.15);
    color: #f39c12;
    border: 1px solid rgba(243, 156, 18, 0.25);
}

.status-indicator.wrong-number {
    background: rgba(149, 165, 166, 0.15);
    color: #95a5a6;
    border: 1px solid rgba(149, 165, 166, 0.25);
}

.status-indicator.switch-off {
    background: rgba(192, 57, 43, 0.15);
    color: #c0392b;
    border: 1px solid rgba(192, 57, 43, 0.25);
}

.status-indicator.whatsapp-sent {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
    border: 1px solid rgba(37, 211, 102, 0.25);
}

.status-indicator.none {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

/* ===================== PAGINATION ===================== */
.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.note-box {
    background: var(--card-bg);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    max-height: 48px;
    overflow-y: auto;
    font-size: 0.78rem;
    line-height: 1.4;
}

/* ===================== CONTACT CARDS (PHONE APP STYLE) ===================== */
.contact-list {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.contact-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    transition: background 0.2s ease;
    cursor: pointer;
    gap: 1rem;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.contact-card:last-child {
    border-bottom: none;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-main {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-phone-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-wrap: nowrap;
}

.sim-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.6;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.contact-status-meta {
    display: flex;
    align-items: center;
    gap: 4px;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-ghost-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
}

.btn-ghost-circle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

/* ===================== MODALS ===================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    width: 520px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    padding: 2.5rem;
    border-radius: 20px !important;
    animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: var(--surface) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--glass-border) !important;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
}

.detail-item {
    padding: 0.25rem 0;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.nav-logo-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: var(--primary);
}



/* ===================== TOGGLE SWITCH ===================== */
.switch {
    display: inline-block;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary) !important;
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
    transform: translateX(14px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===================== FORMS ===================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-control[type="text"],
.form-control[type="password"],
.form-control[type="number"],
textarea.form-control {
    background-image: none;
    padding-right: 0.8rem;
    height: auto;
    resize: vertical;
}

/* ===================== MOBILE (max-width: 768px) ===================== */
@media (max-width: 768px) {

    /* Give space for fixed bottom nav */
    /* Remove body padding for fixed nav */
    body {
        padding-bottom: 0;
    }


    .container {
        padding: 0.75rem;
    }

    /* --- NAV (mobile) --- */
    .glass-nav {
        padding: 0.5rem 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-top-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
    }

    .brand h1 {
        font-size: 1rem;
    }

    /* Nav buttons row — full width, evenly spread */
    .nav-btns {
        display: flex;
        width: 100%;
        gap: 0;
        padding: 0;
        margin-top: 0.25rem;
        border-top: 1px solid var(--glass-border);
    }

    /* Each nav button: icon on top, label below, no overlap */
    .nav-btns .nav-item {
        flex: 1;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        padding: 0.5rem 0.25rem !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        font-size: 0.62rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.2px !important;
        text-align: center !important;
        color: var(--text-secondary) !important;
        min-height: 52px;
    }

    .nav-btns .nav-item svg {
        width: 20px !important;
        height: 20px !important;
        flex-shrink: 0;
    }

    .nav-btns .nav-item.btn-primary,
    .nav-btns .nav-item:first-child {
        color: var(--primary) !important;
    }

    #admin-nav-btn {
        display: none !important;
    }

    #admin-nav-btn.active-admin {
        display: flex !important;
    }

    .nav-logo-mobile {
        display: none !important;
    }


    /* --- AGENT INFO --- */
    .hide-mobile {
        display: none !important;
    }

    #agent-info {
        gap: 6px !important;
    }

    /* --- PAGE HEADER --- */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .page-header h1,
    .page-header h2 {
        font-size: 1.2rem;
    }

    .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .header-actions .btn {
        justify-content: center;
        font-size: 0.78rem;
        padding: 0.5rem 0.6rem;
    }

    /* --- STATS GRID --- */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 0.75rem 0.5rem !important;
        border-radius: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0.3px;
    }

    .stat-icon {
        display: none;
    }

    /* --- SEARCH BAR --- */
    .logic-bar {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
        padding: 0.75rem !important;
    }

    .search-box {
        min-width: unset;
    }

    .filter-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .filter-group select.form-control {
        width: 100%;
        min-width: unset;
        height: 36px;
        font-size: 0.78rem;
    }

    /* --- GLASS PANEL (mobile) --- */
    /* NOTE: do NOT add padding here — contact-list panels need padding:0 */
    .glass-panel {
        border-radius: 12px;
    }

    /* Panels that are NOT the contact list get a small padding via this class */
    .glass-panel.padded {
        padding: 0.75rem;
    }

    /* --- MODAL --- */
    .modal {
        padding: 1.25rem;
        border-radius: 16px;
    }

    /* --- CONTACT LIST (mobile) --- */
    .contact-list {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* --- PAGINATION --- */
    .pagination-footer {
        padding: 0.75rem 1rem;
        font-size: 0.82rem;
    }

    /* --- MOBILE TABLES --- */
    .table-container table, 
    .table-container thead, 
    .table-container tbody, 
    .table-container th, 
    .table-container td, 
    .table-container tr { 
        display: block; 
    }
    
    .table-container thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-container tr { 
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        margin-bottom: 1rem;
        background: var(--card-bg);
        overflow: hidden;
    }
    
    .table-container td { 
        border: none;
        border-bottom: 1px solid var(--glass-border); 
        position: relative;
        padding-left: 45%; 
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
        min-height: 45px;
        text-align: right;
    }
    
    .table-container td:last-child {
        border-bottom: none;
    }
    
    .table-container td::before { 
        position: absolute;
        top: 0.8rem;
        left: 1rem;
        width: 40%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
        content: attr(data-label);
    }
    
    .table-container .btn {
        margin-left: auto;
    }

}

/* ===================== LIGHT THEME FIXES ===================== */
[data-theme="light"] .glass-nav {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn-outline {
    color: var(--text-primary) !important;
}

[data-theme="light"] tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .search-box input {
    color: var(--text-primary);
}

[data-theme="light"] .form-control {
    color: var(--text-primary);
}

[data-theme="light"] .note-box {
    color: var(--text-primary);
}

[data-theme="light"] .search-box {
    background: #e8ecf0 !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .search-box .btn-icon-pure {
    color: var(--text-secondary) !important;
}

[data-theme="light"] .contact-card:hover,
[data-theme="light"] div[onmouseover]:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

/* ===================== TOAST NOTIFICATIONS ===================== */
.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 420px;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(12px);
}

.toast.toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.toast.toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.toast.toast-info {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.toast.toast-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

/* ===================== SPINNER ===================== */
.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ===================== ENHANCED FOCUS STATES ===================== */
.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===================== SMOOTH CARD TRANSITIONS ===================== */
.stat-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}

.stat-clickable {
    cursor: pointer;
    user-select: none;
}

.stat-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    border-color: var(--stat-color, var(--glass-border));
}

.stat-clickable:active {
    transform: translateY(0px) scale(0.98);
}

/* Active stat card — highlighted with accent border + glow */
.stat-card.stat-active {
    border-color: var(--stat-color, var(--primary)) !important;
    box-shadow: 0 0 0 2px var(--stat-color, var(--primary)), 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-card.stat-active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--primary));
    border-radius: 0 0 16px 16px;
}

.stat-card.stat-active .stat-label::after {
    content: ' ✓';
    font-size: 0.7rem;
}

/* ===================== EMPTY STATE ===================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 0.9rem;
}

/* ===================== LEAD ROW RESPONSIVE ===================== */
.lead-row {
    display: flex; 
    align-items: center; 
    border-bottom: 1px solid var(--glass-border); 
    transition: background 0.2s; 
    background: transparent;
    padding: 12px 16px;
    gap: 12px;
}

.lead-row:hover {
    background: rgba(255,255,255,0.02) !important;
}

.lead-selector {
    flex: 0 0 30px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.lead-content {
    display: flex; 
    flex: 1; 
    align-items: center; 
    cursor: pointer; 
    gap: 12px; 
    min-width: 0;
}

.lead-avatar {
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    font-size: 1.1rem; 
    flex-shrink: 0; 
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.lead-info {
    flex: 1; 
    min-width: 0;
}

.lead-actions {
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.btn-action-small {
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text-primary);
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s;
}

.btn-action-small:hover {
    background: var(--primary);
    color: #000;
    transform: scale(1.1);
}

/* Responsive Overrides */
@media (max-width: 600px) {
    .lead-row {
        gap: 8px;
        padding: 10px 12px;
    }
    
    .lead-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .lead-actions {
        gap: 4px;
    }
    
    .btn-action-small {
        width: 32px;
        height: 32px;
    }
}

/* Source Filter Buttons */
.source-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.source-btn i {
    opacity: 0.7;
}

.source-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.source-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.25);
}

.source-btn.active i {
    opacity: 1;
}

.source-btn[data-source="IndiaMART"].active {
    background: #4b2c9a; /* IndiaMART Theme Color (Purple) */
    color: white;
    border-color: #4b2c9a;
    box-shadow: 0 4px 15px rgba(75, 44, 154, 0.3);
}

.source-btn[data-source="Justdial"].active {
    background: #ff7b00; /* Justdial Theme Color (Orange) */
    color: white;
    border-color: #ff7b00;
    box-shadow: 0 4px 15px rgba(255, 123, 0, 0.3);
}

.source-btn[data-source="Uploaded"].active {
    background: #2563eb; /* Uploaded Themes Color (Blue) */
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Priority Filter Buttons */
.priority-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.priority-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.priority-btn.active[data-priority="Hot"] {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border-color: #ff4757;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.15);
}

.priority-btn.active[data-priority="Warm"] {
    background: rgba(255, 165, 2, 0.2);
    color: #ffa502;
    border-color: #ffa502;
    box-shadow: 0 4px 12px rgba(255, 165, 2, 0.15);
}

.priority-btn.active[data-priority="Cold"] {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

/* Priority Badge on Cards */
.priority-indicator {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.priority-indicator.priority-hot { background: rgba(255, 71, 87, 0.1); color: #ff4757; }
.priority-indicator.priority-warm { background: rgba(255, 165, 2, 0.1); color: #ffa502; }
.priority-indicator.priority-cold { background: rgba(52, 152, 219, 0.1); color: #3498db; }

/* ===================== MOBILE BOTTOM NAV ===================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 14, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 9000;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.mobile-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item i {
    width: 20px;
    height: 20px;
}

.mobile-nav-center .center-btn {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    margin-top: -30px;
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.4);
    transition: all 0.3s ease;
}

.mobile-nav-center .center-btn i {
    width: 24px;
    height: 24px;
}

.mobile-nav-center:active .center-btn {
    transform: scale(0.9) translateY(4px);
}

/* Responsive Utilities */
.desktop-only { display: inline; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: inline !important; }

    :root {
        --nav-height: 56px;
    }

    .mobile-bottom-nav {
        display: flex;
    }
    
    .glass-nav {
        padding: 0 0.75rem;
        height: var(--nav-height);
    }
    
    .nav-btns {
        display: none !important;
    }

    body {
        padding-bottom: 70px;
    }

    .container {
        padding: 0.5rem;
    }

    #contacts-header {
        position: relative !important;
        top: 0 !important;
        padding: 12px 10px !important;
        margin-bottom: 0;
        background: var(--surface) !important;
        border-radius: 20px 20px 0 0;
    }

    #contacts-table {
        border-top: none;
        border-radius: 0 0 20px 20px;
        background: var(--surface);
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.5rem !important;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}

/* Spinner Ring Enhancement */
.spinner-ring {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* New Lead Pulse */
.new-pulse {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(0, 255, 136, 1);
    animation: new-lead-pulse 2s infinite;
    display: inline-block;
}

@keyframes new-lead-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}



/* Template Button Grid */
.template-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.template-btn {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.template-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateX(4px);
}

.template-btn strong {
    display: block;
    color: var(--primary);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.template-btn p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}