/* ========================================
   LEADS PAGE
   Design matches Find Equipment patterns
   ======================================== */

/* --- Page wrapper --- */
.sf-leads-page {
    font-family: 'Inter', sans-serif;
    color: #2D3436;
    background-color: #F5F6F5;
    min-height: 100vh;
}

/* --- Banner styles are in extra-style.css (shared sf-fe-banner) --- */

/* --- Container --- */
.sf-leads-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 0 60px;
}

/* ========================================
   PROMO BLOCK
   ======================================== */
.sf-leads-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #f7fbf7;
    border: 1px solid #d4e8d4;
    border-left: 4px solid #3A7D44;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.sf-leads-promo-content {
    flex: 1;
    min-width: 0;
}

.sf-leads-promo-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    color: #1a3a0e;
    margin: 0 0 6px;
}

.sf-leads-promo-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.6;
    color: #5a6b5a;
    margin: 0;
}

/* Merge both paragraphs visually — only show the second one on hover/always, separated by a space */
.sf-leads-promo-body+.sf-leads-promo-body {
    display: none;
}

.sf-leads-promo-cta {
    flex-shrink: 0;
}

.sf-leads-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.sf-leads-promo-btn--primary {
    background-color: #3A7D44;
    color: #fff;
}

.sf-leads-promo-btn--primary:hover {
    background-color: #2d6435;
    color: #fff;
    opacity: 1;
}

.sf-leads-promo-btn--warning {
    background-color: #F59E0B;
    color: #fff;
}

.sf-leads-promo-btn--warning:hover {
    background-color: #d97706;
    color: #fff;
    opacity: 1;
}

/* ========================================
   RESPONSIVE — Promo block
   ======================================== */
@media screen and (max-width: 768px) {
    .sf-leads-promo {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px 18px;
    }

    .sf-leads-promo-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   TOOLBAR (dark top bar)
   ======================================== */
.sf-leads-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px 12px 0 0;
    padding: 20px 24px;
    gap: 16px;
}

.sf-leads-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sf-leads-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 28px;
    color: #2D3436;
    margin: 0;
}

.sf-leads-subheading {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 18px;
    color: #9CA3AF;
}

/* --- Search Input --- */
.sf-leads-search-wrap {
    position: relative;
    width: 280px;
    flex-shrink: 0;
}

.sf-leads-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.sf-leads-search {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 38px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background-color: #F9FAFB;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #2D3436;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.sf-leads-search::placeholder {
    color: #999;
}

.sf-leads-search:focus {
    border-color: #2D5016;
}

/* ========================================
   TABLE
   ======================================== */
.sf-leads-table-wrap {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sf-leads-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 20px;
    min-width: 700px;
}

/* --- Table Header --- */
.sf-leads-table thead {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #E5E7EB;
}

.sf-leads-table thead th {
    background-color: #FFFFFF !important;
    font-weight: 500;
    font-size: 13px;
    line-height: 18px;
    color: #6B7280;
    text-align: left;
    padding: 12px 16px;
    white-space: nowrap;
    border-bottom: 1px solid #E5E7EB;
}

.sf-leads-th-check {
    width: 44px;
    text-align: center !important;
    padding-left: 16px !important;
}

/* --- Table Body --- */
.sf-leads-table tbody tr {
    border-bottom: 1px solid #F0F0F0;
    transition: background-color 0.15s ease;
}

.sf-leads-table tbody tr:last-child {
    border-bottom: none;
}

.sf-leads-table tbody tr:hover {
    background-color: #F9FAFB;
}

.sf-leads-table tbody td {
    padding: 16px 16px;
    color: #374151;
    vertical-align: middle;
}

/* Checkbox column */
.sf-leads-td-check {
    width: 44px;
    text-align: center;
    padding-left: 16px !important;
}

.sf-leads-td-check input[type="checkbox"],
.sf-leads-th-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2D5016;
    cursor: pointer;
    margin: 0;
}

/* Title column */
.sf-leads-td-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sf-leads-td-title strong {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.sf-leads-td-id {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
}

/* Category badge */
.sf-leads-category-badge {
    display: inline-block;
    padding: 3px 10px;
    background-color: #F3F4F6;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* --- Sortable Headers --- */
.sf-leads-th-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.sf-leads-th-sortable:hover {
    color: #2D5016;
}

.sf-leads-sort-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.sf-leads-th-sortable:hover .sf-leads-sort-icon,
.sf-leads-th-active .sf-leads-sort-icon {
    opacity: 1;
}

/* --- Location cell --- */
.sf-leads-td-location {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sf-leads-td-location svg {
    flex-shrink: 0;
}

/* --- Lead number --- */
.sf-leads-td-num strong {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    font-family: 'Inter', monospace;
    letter-spacing: 0.02em;
}

/* --- Expiration badge --- */
.sf-leads-expires {
    display: inline-block;
    padding: 3px 10px;
    background-color: #F0FDF4;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #166534;
    white-space: nowrap;
}

.sf-leads-expires--urgent {
    background-color: #FEF2F2;
    color: #991B1B;
}

/* --- View link --- */
.sf-leads-view-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #2D5016;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s ease;
}

.sf-leads-view-link:hover {
    color: #1a3a0e;
    text-decoration: underline;
}

/* --- Access Notice --- */
.sf-leads-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 16px 20px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
}

.sf-leads-notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.sf-leads-notice strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #92400E;
    margin-bottom: 4px;
}

.sf-leads-notice p {
    font-size: 13px;
    color: #78716C;
    margin: 0;
    line-height: 1.5;
}

.sf-leads-notice a {
    color: #2D5016;
    font-weight: 500;
    text-decoration: underline;
}

/* --- Toolbar right --- */
.sf-leads-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ========================================
   RESPONSIVE — Tablet (≤1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
    .sf-leads-container {
        padding: 24px 20px 60px;
    }
}

/* ========================================
   RESPONSIVE — Mobile (≤768px)
   ======================================== */
@media screen and (max-width: 768px) {
    .sf-leads-page {
        overflow-x: hidden;
    }

    .sf-leads-container {
        padding: 16px 16px 40px;
    }

    .sf-leads-toolbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 20px;
        border-radius: 10px 10px 0 0;
        gap: 12px;
    }

    .sf-leads-search-wrap {
        width: 100%;
    }

    .sf-leads-heading {
        font-size: 18px;
    }

    .sf-leads-table {
        font-size: 13px;
    }

    .sf-leads-table thead th {
        font-size: 12px;
        padding: 10px 12px;
    }

    .sf-leads-table tbody td {
        padding: 14px 12px;
    }
}

/* ========================================
   RESPONSIVE — Small Mobile (≤480px)
   ======================================== */
@media screen and (max-width: 480px) {
    .sf-leads-container {
        padding: 12px 12px 32px;
    }

    .sf-leads-toolbar {
        padding: 14px 16px;
        border-radius: 8px 8px 0 0;
    }

    .sf-leads-heading {
        font-size: 16px;
    }

    .sf-leads-search {
        height: 38px;
        font-size: 13px;
    }
}

/* ========================================
   RESTRICTED ACCESS MODAL
   ======================================== */
.sf-leads-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sf-leads-modal {
    position: relative;
    background: #FFFFFF;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    padding: 32px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: sf-modal-in 0.2s ease-out;
}

@keyframes sf-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sf-leads-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #9CA3AF;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s ease;
}

.sf-leads-modal-close:hover {
    color: #374151;
}

.sf-leads-modal-icon {
    margin-bottom: 16px;
}

.sf-leads-modal h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #111827;
    margin: 0 0 8px;
}

.sf-leads-modal p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #6B7280;
    margin: 0 0 24px;
}

.sf-leads-modal-actions {
    display: flex;
    gap: 12px;
}

.sf-leads-modal-actions .sf-eq-btn {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
}

/* --- Account Leads Table: Action Buttons --- */
.sf-leads-td-actions {
    white-space: nowrap;
}

.sf-leads-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sf-leads-action-btn:hover {
    background-color: #F3F4F6;
    color: #374151;
}

.sf-leads-action-btn--delete:hover {
    background-color: #FEF2F2;
    color: #DC2626;
}