.leads-container{

    padding:40px;

    width:100%;

    overflow-x:auto;

    box-sizing:border-box;

    position: relative; /* هذا السطر يمنع تداخل العناصر ويحمي الأزرار */

}

.leads-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:30px;

}

.leads-title{

    font-size:42px;

    font-weight:700;

    color:#1e40af;

}

.leads-actions{

    display:flex;

    gap:15px;

    align-items:center;

    flex-wrap:wrap;

}

.import-btn,
.add-leads-btn{

    background:#1d4ed8;

    color:white;

    padding:14px 22px;

    border:none;

    border-radius:14px;

    font-size:15px;

    font-weight:600;

    cursor:pointer;

    min-width:180px;

}

.import-btn{

    background:#e5e7eb;

    color:#111827;

}

.import-btn:hover{

    background:#d1d5db;

}

.add-leads-btn{

    background:#1d4ed8;

    color:white;

}

.add-leads-btn:hover{

    background:#1e3a8a;

}

.leads-stats{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:20px;

    margin-bottom:30px;

}

.stat-card{

    background:white;

    border-radius:18px;

    padding:25px;

    box-shadow:0 4px 12px rgba(0,0,0,0.06);

}

.stat-card h3{

    font-size:16px;

    color:#6b7280;

    margin-bottom:10px;

}

.stat-card p{

    font-size:32px;

    font-weight:700;

    color:#111827;

}

.search-box{

    margin-bottom:25px;

}

.search-box input{

    width:100%;

    padding:16px;

    border-radius:14px;

    border:1px solid #d1d5db;

    font-size:15px;

    outline:none;

}

.search-box input:focus{

    border-color:#2563eb;

}

.leads-card{

    background:white;

    border-radius:22px;

    padding:25px;

    box-shadow:0 4px 20px rgba(0,0,0,0.05);

}

.leads-table{

    width:100%;

    border-collapse:collapse;

}

.leads-table thead{

    border-bottom:1px solid #e5e7eb;

}

.leads-table th{

    text-align:left;

    padding:18px;

    font-size:15px;

    color:#6b7280;

}

.leads-table td{

    padding:20px 18px;

    font-size:15px;

    color:#111827;

}

.leads-table tbody tr{

    border-bottom:1px solid #f3f4f6;

    transition:0.2s;

}

.leads-table tbody tr:hover{

    background:#f9fafb;

}

.status{

    padding:8px 14px;

    border-radius:30px;

    font-size:13px;

    font-weight:600;

}

.status.active{

    background:#dcfce7;

    color:#166534;

}

.table-btn{

    border:none;

    padding:10px 14px;

    border-radius:10px;

    cursor:pointer;

    font-size:13px;

    font-weight:600;

    margin-right:8px;

    transition:0.2s;

}

.view-btn{

    background:#dbeafe;

    color:#1d4ed8;

}

.view-btn:hover{

    background:#bfdbfe;

}

.download-btn{

    background:#dcfce7;

    color:#15803d;

}

.download-btn:hover{

    background:#bbf7d0;

}

.download-btn:disabled{

    opacity:0.65;

    cursor:wait;

}

.rename-btn{

    background:#fef3c7;

    color:#92400e;

}

.rename-btn:hover{

    background:#fde68a;

}

.leads-list-actions{

    display:flex;

    align-items:center;

    gap:8px;

    flex-wrap:wrap;

    min-width:370px;

}

.leads-list-actions .table-btn{

    margin-right:0;

}

.delete-btn{

    background:#fee2e2;

    color:#dc2626;

}

.delete-btn:hover{

    background:#fecaca;

}

@media(max-width:1200px){

    .leads-stats{

        grid-template-columns:repeat(2,1fr);

    }

}

@media(max-width:768px){

    .leads-header{

        flex-direction:column;

        align-items:flex-start;

        gap:20px;

    }

    .leads-stats{

        grid-template-columns:1fr;

    }

}

.view-leads-modal{

    width:900px;

    max-height:80vh;

    overflow:hidden;

}

.leads-viewer-list{

    margin-top:20px;

    max-height:500px;

    overflow-y:auto;

}

.leads-viewer-table{

    width:100%;

    border-collapse:collapse;

}

.leads-viewer-table th,
.leads-viewer-table td{

    padding:14px;

    border-bottom:1px solid #eee;

    text-align:left;

}

.leads-viewer-table th{

    background:#f9fafb;

    position:sticky;

    top:0;

}

#importListSelect,
#newImportListName{

    width:100%;

    padding:14px;

    border:1px solid #ddd;

    border-radius:12px;

    margin-bottom:15px;

    font-size:14px;

}

.viewer-actions{

    display:flex;

    gap:10px;

    margin:15px 0;

}

.lead-checkbox{

width:18px;

height:18px;

cursor:pointer;

flex-shrink:0;

}

.lead-checkbox{

width:18px !important;

height:18px !important;

min-width:18px;

min-height:18px;

cursor:pointer;

accent-color:#2f5fe3;

transform:scale(1);

margin:0;

padding:0;

box-sizing:border-box;

}

/* HEADER CHECKBOX */

#selectAllCheckbox{

width:18px !important;

height:18px !important;

cursor:pointer;

accent-color:#2f5fe3;

}

#leadsViewerTable th:first-child,
#leadsViewerTable td:first-child{

width:50px;
text-align:center;

}

.lead-checkbox{

width:18px;
height:18px;
cursor:pointer;

}

.leads-viewer-page{

display:none;

position:absolute;

top:0;

left:0;

width:100%;

height:100%;

background:#f4f7fb;

padding:40px;

box-sizing:border-box;

overflow:auto;

z-index:999;

}

.viewer-header{

display:flex;

justify-content:space-between;

align-items:center;

margin-bottom:20px;

}

.close-viewer-btn{

width:45px;

height:45px;

border:none;

border-radius:12px;

background:#ff4d4f;

color:white;

font-size:22px;

cursor:pointer;

}

.viewer-actions{

display:flex;

gap:12px;

margin-bottom:20px;

}

.viewer-table{

width:100%;

border-collapse:collapse;

background:white;

border-radius:20px;

overflow:hidden;

}

.viewer-table th,
.viewer-table td{

padding:16px;

border-bottom:1px solid #eee;

text-align:left;

}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:22px;
}

.modal-primary-btn{
    background:#2f5fe3;
    color:#fff;
    border:none;
    padding:13px 24px;
    border-radius:12px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
}

.modal-secondary-btn{
    background:#e8eef7;
    color:#102033;
    border:none;
    padding:13px 24px;
    border-radius:12px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
}

/* =========================================================================
   RENAME LEADS LIST
   ========================================================================= */

.rename-leads-modal{
    inset:0;
    width:100%;
    height:100%;
    padding:20px;
    box-sizing:border-box;
    background:rgba(15,23,42,.55);
    align-items:center;
    justify-content:center;
}

.rename-leads-modal-content{
    width:min(480px, calc(100vw - 32px));
    max-width:480px;
    background:#ffffff;
    border-radius:18px;
    padding:26px;
    box-sizing:border-box;
    box-shadow:0 28px 70px rgba(15,23,42,.24);
}

.rename-leads-modal-content .modal-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:22px;
}

.rename-leads-modal-content .modal-header h2{
    margin:0;
    color:#0f172a;
    font-size:22px;
    font-weight:800;
}

.rename-leads-modal-content .close-modal-btn{
    width:36px;
    height:36px;
    flex-shrink:0;
    border:none;
    border-radius:9px;
    background:#f1f5f9;
    color:#475569;
    cursor:pointer;
    font-size:16px;
}

.rename-leads-current-label{
    margin:7px 0 0;
    color:#64748b;
    font-size:13px;
    overflow-wrap:anywhere;
}

.rename-leads-current-label strong{
    color:#334155;
}

.rename-leads-field-label{
    display:block;
    margin-bottom:8px;
    color:#334155;
    font-size:13px;
    font-weight:800;
}

#renameLeadsListName{
    width:100%;
    box-sizing:border-box;
    padding:13px 14px;
    border:1px solid #cbd5e1;
    border-radius:10px;
    background:#ffffff;
    color:#0f172a;
    font-size:14px;
    outline:none;
}

#renameLeadsListName:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,.1);
}

.rename-leads-error{
    min-height:19px;
    margin:8px 0 0;
    color:#dc2626;
    font-size:12px;
    font-weight:700;
}

.rename-leads-save-btn:disabled{
    opacity:.65;
    cursor:wait;
}

/* =========================================================================
   GLOBAL SUPPRESSION LIST
   ========================================================================= */

.global-suppression-btn{
    background:#fff1f2;
    color:#be123c;
    border:1px solid #fecdd3;
    padding:10px 18px;
    border-radius:8px;
    font-weight:700;
    cursor:pointer;
    transition:.2s;
}

.global-suppression-btn:hover{
    background:#ffe4e6;
}

.status.suppressed{
    background:#fff1f2;
    color:#be123c;
    border:1px solid #fecdd3;
    font-weight:800;
}

.suppression-modal{
    position:fixed;
    inset:0;
    z-index:10020;
    background:rgba(15,23,42,.55);
    align-items:center;
    justify-content:center;
    padding:24px;
    box-sizing:border-box;
}

.suppression-modal-card{
    width:min(1150px,96vw);
    max-height:90vh;
    overflow:hidden;
    background:#fff;
    border-radius:18px;
    box-shadow:0 28px 70px rgba(15,23,42,.25);
    display:flex;
    flex-direction:column;
}

.suppression-modal-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    padding:22px 24px 18px;
    border-bottom:1px solid #e2e8f0;
}

.suppression-modal-header h2{
    margin:0;
    color:#0f172a;
    font-size:22px;
    font-weight:800;
}

.suppression-modal-header p{
    margin:6px 0 0;
    color:#64748b;
    font-size:13px;
}

.suppression-close-btn{
    width:36px;
    height:36px;
    flex-shrink:0;
    border:none;
    border-radius:9px;
    background:#f1f5f9;
    color:#475569;
    cursor:pointer;
    font-size:16px;
}

.suppression-add-panel{
    display:grid;
    grid-template-columns:1fr 1.5fr auto;
    gap:12px;
    padding:18px 24px;
    background:#f8fafc;
    border-bottom:1px solid #e2e8f0;
}

.suppression-add-panel input,
.suppression-toolbar input{
    width:100%;
    box-sizing:border-box;
    padding:11px 13px;
    border:1px solid #cbd5e1;
    border-radius:9px;
    background:#fff;
    color:#0f172a;
    font-size:13px;
    outline:none;
}

.suppression-add-panel input:focus,
.suppression-toolbar input:focus{
    border-color:#e11d48;
    box-shadow:0 0 0 3px rgba(225,29,72,.08);
}

.suppression-add-btn{
    border:none;
    border-radius:9px;
    padding:11px 17px;
    background:#e11d48;
    color:#fff;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
    white-space:nowrap;
}

.suppression-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    padding:16px 24px;
}

.suppression-toolbar input{
    max-width:380px;
}

.suppression-summary{
    color:#64748b;
    font-size:13px;
}

.suppression-summary strong{
    color:#be123c;
    font-size:18px;
    margin-right:5px;
}

.suppression-table-wrap{
    overflow:auto;
    padding:0 24px 24px;
}

.suppression-table{
    width:100%;
    min-width:900px;
    border-collapse:collapse;
}

.suppression-table th{
    text-align:left;
    padding:12px 10px;
    color:#64748b;
    background:#f8fafc;
    border-bottom:1px solid #e2e8f0;
    font-size:12px;
    font-weight:800;
    position:sticky;
    top:0;
}

.suppression-table td{
    padding:12px 10px;
    border-bottom:1px solid #f1f5f9;
    color:#334155;
    font-size:13px;
    vertical-align:top;
}

.suppression-email-cell{
    color:#0f172a;
    font-weight:750;
}

.suppression-status-active,
.suppression-status-released{
    display:inline-flex;
    padding:5px 9px;
    border-radius:999px;
    font-size:11px;
    font-weight:800;
}

.suppression-status-active{
    background:#fff1f2;
    color:#be123c;
}

.suppression-status-released{
    background:#f1f5f9;
    color:#64748b;
}

.suppression-release-btn{
    border:1px solid #cbd5e1;
    background:#fff;
    color:#334155;
    padding:7px 10px;
    border-radius:8px;
    font-size:12px;
    font-weight:750;
    cursor:pointer;
}

.suppression-release-btn:hover{
    border-color:#16a34a;
    color:#15803d;
}

.suppression-empty-row{
    text-align:center;
    color:#94a3b8 !important;
    padding:28px !important;
}

@media(max-width:800px){
    .suppression-add-panel{
        grid-template-columns:1fr;
    }

    .suppression-toolbar{
        align-items:stretch;
        flex-direction:column;
    }

    .suppression-toolbar input{
        max-width:none;
    }
}


/* =========================================================================
   LEADS VIEWER PAGINATION & PERFORMANCE v3.5.0
   ========================================================================= */

.leads-viewer-list{
    margin-top:0;
    min-height:260px;
    max-height:none;
    overflow:auto;
    contain:layout paint;
}

.leads-viewer-table{
    table-layout:fixed;
}

.leads-viewer-table th,
.leads-viewer-table td{
    padding:12px 14px;
    vertical-align:middle;
    overflow:hidden;
    text-overflow:ellipsis;
}

.leads-viewer-table th:nth-child(1),
.leads-viewer-table td:nth-child(1){
    width:50px;
}

.leads-viewer-table th:nth-child(2),
.leads-viewer-table td:nth-child(2){
    width:25%;
}

.leads-viewer-table th:nth-child(3),
.leads-viewer-table td:nth-child(3){
    width:18%;
}

.leads-viewer-table th:nth-child(4),
.leads-viewer-table td:nth-child(4){
    width:18%;
}

.leads-viewer-table th:nth-child(5),
.leads-viewer-table td:nth-child(5){
    width:22%;
}

.leads-viewer-table th:nth-child(6),
.leads-viewer-table td:nth-child(6){
    width:130px;
}

.leads-viewer-checkbox-cell{
    text-align:center !important;
}

.leads-viewer-muted-cell{
    color:#475569;
    font-weight:500;
}

.leads-viewer-empty-cell,
.leads-viewer-loading-cell{
    padding:32px !important;
    text-align:center !important;
    color:#64748b;
    font-weight:600;
}

.leads-viewer-pagination{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-wrap:wrap;
    flex-shrink:0;
    padding:14px 16px;
    margin-top:12px;
    border:1px solid #e2e8f0;
    border-radius:12px;
    background:#ffffff;
    box-shadow:0 1px 3px rgba(15,23,42,.05);
}

.leads-pagination-summary,
.leads-pagination-navigation{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:wrap;
}

.leads-pagination-summary{
    color:#475569;
    font-size:13px;
    font-weight:700;
}

.leads-page-size-control{
    display:flex;
    align-items:center;
    gap:6px;
}

.leads-page-size-control select{
    height:34px;
    padding:0 28px 0 10px;
    border:1px solid #cbd5e1;
    border-radius:8px;
    background:#ffffff;
    color:#0f172a;
    font:inherit;
    cursor:pointer;
}

.leads-pagination-nav-btn,
.leads-pagination-page{
    min-width:36px;
    height:36px;
    padding:0 11px;
    border:1px solid #cbd5e1;
    border-radius:8px;
    background:#ffffff;
    color:#334155;
    font-size:12px;
    font-weight:800;
    cursor:pointer;
}

.leads-pagination-nav-btn:hover:not(:disabled),
.leads-pagination-page:hover{
    border-color:#2563eb;
    background:#eff6ff;
    color:#1d4ed8;
}

.leads-pagination-page.active{
    border-color:#2563eb;
    background:#2563eb;
    color:#ffffff;
}

.leads-pagination-nav-btn:disabled{
    opacity:.45;
    cursor:not-allowed;
}

.leads-pagination-pages{
    display:flex;
    align-items:center;
    gap:5px;
}

.leads-pagination-ellipsis{
    padding:0 2px;
    color:#94a3b8;
    font-weight:800;
}

.leads-pagination-label{
    min-width:92px;
    color:#64748b;
    font-size:12px;
    font-weight:700;
    text-align:center;
}

@media(max-width:900px){

    .leads-viewer-pagination{
        align-items:flex-start;
        flex-direction:column;
    }

    .leads-pagination-navigation{
        width:100%;
    }

}


/* =========================================================
   V3.4.9 - LEADS STATISTICS
========================================================= */

.leads-main-stats{
    display:grid !important;
    grid-template-columns:repeat(5, minmax(0, 1fr)) !important;
    gap:20px !important;
    margin-bottom:24px !important;
    flex-shrink:0;
}

.leads-main-stats .leads-stat-card{
    background:#fff;
    padding:20px;
    border-radius:12px;
    box-shadow:0 1px 3px rgba(0,0,0,.05);
    border:1px solid #e2e8f0;
    min-width:0;
}

.leads-main-stats .leads-stat-card h3{
    color:#64748b;
    font-size:14px;
    font-weight:600;
    margin:0 0 8px 0;
}

.leads-main-stats .leads-stat-card p{
    color:#0f172a;
    font-size:28px;
    font-weight:700;
    margin:0;
}

.leads-list-stats{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
    margin:0 0 20px 0;
    flex-shrink:0;
}

.leads-list-stat-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    min-height:64px;
    padding:14px 18px;
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:12px;
    box-shadow:0 1px 3px rgba(0,0,0,.04);
}

.leads-list-stat-card span{
    color:#64748b;
    font-size:14px;
    font-weight:700;
}

.leads-list-stat-card strong{
    color:#0f172a;
    font-size:25px;
    line-height:1;
}

/* Valid statistic: soft green positive state */
.leads-list-stat-card:first-child{
    border-color:#bbf7d0;
    background:#f0fdf4;
}

.leads-list-stat-card:first-child strong{
    color:#16a34a;
}

.leads-list-stat-invalid{
    border-color:#fed7aa;
    background:#fffaf5;
}

.leads-list-stat-invalid strong{
    color:#c2410c;
}

.leads-list-stat-suppressed{
    border-color:#fecaca;
    background:#fff7f7;
}

.leads-list-stat-suppressed strong{
    color:#dc2626;
}

@media (max-width:1200px){
    .leads-main-stats{
        grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width:850px){
    .leads-main-stats{
        grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
    }

    .leads-list-stats{
        grid-template-columns:1fr;
    }
}

@media (max-width:560px){
    .leads-main-stats{
        grid-template-columns:1fr !important;
    }
}
