/* Lead Agent Modal */
.lead-agent-modal,
.lead-agent-modal * {
    font-family: 'Inter', sans-serif;
}

.lead-agent-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.26s ease, visibility 0.26s ease;
}

.lead-agent-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lead-agent-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 9, 12, 0.72);
    backdrop-filter: blur(12px);
}

.lead-agent-frame {
    position: relative;
    width: min(1240px, 100%);
    height: min(760px, calc(100vh - 64px));
    overflow: hidden;
    background: #0b0d12;
    border: 1px solid #242832;
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.42);
    transform: translateY(12px) scale(0.985);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.lead-agent-modal.is-open .lead-agent-frame {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.lead-agent-app {
    position: relative;
    height: 100%;
    color: #f4f4f5;
    background: #0b0d12;
}

/* Loader */
.lead-agent-loader {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    background: #0b0d12;
}

.lead-agent-loader.is-active {
    display: flex;
}

.lead-agent-loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.lead-agent-loader-box p {
    margin: 0;
    color: #a0a8b6;
    font-size: 13px;
    font-weight: 500;
}

.lead-agent-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #242832;
    border-top-color: #24e98a;
    border-radius: 999px;
    animation: leadSpin 0.8s linear infinite;
}

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

/* Top Bar */
.lead-agent-topbar {
    height: 66px;
    display: grid;
    grid-template-columns: 210px 1fr 44px;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    border-bottom: 1px solid #242832;
    background: #0d1016;
}

.lead-agent-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.lead-agent-search-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 780px;
}

.lead-agent-search {
    height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 14px;
    border: 1px solid #252a34;
    background: #11141b;
}

.lead-agent-search-svg {
    flex: 0 0 auto;
    color: #7e8796;
    display: block;
}

.lead-agent-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #d8dde6;
    font-size: 13px;
    line-height: 40px;
    font-weight: 500;
}

.lead-agent-close {
    width: 36px;
    height: 36px;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.lead-agent-close:hover {
    background: #171b23;
}

/* Body */
.lead-agent-body {
    height: calc(100% - 66px);
    display: grid;
    grid-template-columns: 230px 1fr;
}

/* Sidebar */
.lead-agent-sidebar {
    padding: 22px;
    border-right: 1px solid #242832;
    background: #090b10;
}

.lead-sidebar-section {
    margin-bottom: 30px;
}

.lead-sidebar-section p {
    margin: 0 0 12px;
    color: #7d8695;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.lead-sidebar-link {
    width: 100%;
    height: 38px;
    padding: 0 14px;
    margin-bottom: 6px;
    border: 0;
    background: transparent;
    color: #8d96a6;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.lead-sidebar-link:hover,
.lead-sidebar-link.is-active {
    background: #131720;
    color: #ffffff;
}

.lead-mini-agent {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 32px;
    color: #aeb6c4;
    font-size: 13px;
    font-weight: 500;
}

.lead-mini-agent span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #24e98a;
}

.lead-sidebar-metric {
    padding: 13px 14px;
    margin-bottom: 8px;
    border: 1px solid #242832;
    background: #0f1218;
}

.lead-sidebar-metric span {
    display: block;
    margin-bottom: 7px;
    color: #818a99;
    font-size: 11px;
    font-weight: 500;
}

.lead-sidebar-metric strong {
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.04em;
}

/* Content */
.lead-agent-content {
    position: relative;
    overflow-y: auto;
    padding: 28px 34px;
}

.lead-workspace-view {
    display: none;
}

.lead-workspace-view.is-active {
    display: block;
}

.lead-agent-content-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.lead-agent-kicker {
    margin: 0 0 9px;
    color: #a4adbd;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.lead-agent-content-header h3 {
    margin: 0;
    max-width: 620px;
    color: #ffffff;
    font-size: clamp(34px, 3.3vw, 50px);
    line-height: 1.04;
    font-weight: 500;
    letter-spacing: -0.06em;
}

.lead-agent-content-header p {
    max-width: 680px;
    margin: 14px 0 0;
    color: #939cab;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 500;
}

.lead-run-button {
    height: 42px;
    padding: 0 18px;
    border: 0;
    background: #ffffff;
    color: #080a0f;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.lead-run-button:hover {
    background: #24e98a;
}

/* Summary */
.lead-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #242832;
    margin-bottom: 22px;
}

.lead-summary-card {
    padding: 14px 16px;
    border-right: 1px solid #242832;
    background: #0f1218;
}

.lead-summary-card:last-child {
    border-right: 0;
}

.lead-summary-card span {
    display: block;
    margin-bottom: 8px;
    color: #818a99;
    font-size: 12px;
    font-weight: 500;
}

.lead-summary-card strong {
    display: block;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.04em;
}

/* Browser + Collection */
.lead-browser-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 22px;
    margin-bottom: 22px;
}

.lead-browser-card,
.lead-collection-card,
.lead-console-table-card {
    border: 1px solid #242832;
    background: #0f1218;
}

.lead-browser-topbar {
    height: 48px;
    display: grid;
    grid-template-columns: 70px 1fr;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    border-bottom: 1px solid #242832;
    background: #0b0d12;
}

.lead-browser-dots {
    display: flex;
    gap: 7px;
}

.lead-browser-dots span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #3a4050;
}

.lead-browser-url {
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border: 1px solid #252a34;
    background: #11141b;
    color: #8d96a6;
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lead-browser-page {
    padding: 22px;
}

.lead-browser-page-header span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    margin-bottom: 14px;
    background: #171b23;
    color: #24e98a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.lead-browser-page-header h4 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 22px;
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: -0.055em;
}

.lead-browser-page-header p {
    margin: 0 0 18px;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
}

.lead-browser-highlight-list {
    display: grid;
    gap: 10px;
}

.lead-browser-highlight {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 10px;
    align-items: start;
    padding: 13px;
    border: 1px solid #242832;
    background: #0b0d12;
}

.lead-browser-highlight span {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 999px;
    background: #3a4050;
}

.lead-browser-highlight.is-active {
    border-color: rgba(36, 233, 138, 0.4);
    background: rgba(36, 233, 138, 0.06);
}

.lead-browser-highlight.is-active span {
    background: #24e98a;
}

.lead-browser-highlight p {
    margin: 0;
    color: #cfd5df;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

.lead-collection-header {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 16px;
    border-bottom: 1px solid #242832;
    background: #0b0d12;
}

.lead-collection-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.lead-collection-header span {
    color: #818a99;
    font-size: 12px;
    font-weight: 500;
}

.lead-collection-stream {
    padding: 14px;
    display: grid;
    gap: 10px;
}

.lead-collection-item {
    padding: 13px;
    border: 1px solid #242832;
    background: #0b0d12;
}

.lead-collection-item span {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 8px;
    margin-bottom: 9px;
    background: #171b23;
    color: #24e98a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.lead-collection-item p {
    margin: 0;
    color: #c2c9d4;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 500;
}

/* Tables */
.lead-table-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 18px;
    border-bottom: 1px solid #242832;
}

.lead-table-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.lead-table-header span {
    color: #818a99;
    font-size: 12px;
    font-weight: 500;
}

.lead-table-wrap {
    overflow-x: auto;
}

.lead-results-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

.lead-results-table th,
.lead-results-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #242832;
    text-align: left;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
}

.lead-results-table th {
    color: #798292;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #0b0d12;
}

.lead-results-table td {
    color: #d8dde6;
    font-weight: 500;
}

.lead-results-table tbody tr:last-child td {
    border-bottom: 0;
}

.lead-status-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
}

.lead-status-high {
    background: rgba(36, 233, 138, 0.12);
    color: #24e98a;
}

.lead-status-warm {
    background: rgba(255, 183, 77, 0.13);
    color: #ffbd66;
}

.lead-status-review {
    background: rgba(164, 173, 189, 0.13);
    color: #b9c0cc;
}

/* Source Cards */
.lead-source-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.lead-source-card {
    padding: 20px;
    border: 1px solid #242832;
    background: #0f1218;
}

.lead-source-card span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    background: #171b23;
    color: #24e98a;
    font-size: 12px;
    font-weight: 800;
}

.lead-source-card h4 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.lead-source-card p {
    min-height: 62px;
    margin: 0 0 18px;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
}

.lead-source-card strong {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    background: rgba(36, 233, 138, 0.12);
    color: #24e98a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Outreach */
.lead-outreach-grid {
    display: grid;
    gap: 12px;
}

.lead-outreach-card {
    padding: 18px;
    border: 1px solid #242832;
    background: #0f1218;
}

.lead-outreach-card h4 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.035em;
}

.lead-outreach-card p {
    margin: 0 0 12px;
    color: #aeb6c4;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 500;
}

.lead-outreach-card span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    background: rgba(36, 233, 138, 0.12);
    color: #24e98a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Skeleton */
.lead-view-skeleton {
    display: none;
}

.lead-view-skeleton.is-active {
    display: block;
}

.lead-skeleton-line,
.lead-skeleton-grid div,
.lead-skeleton-table div {
    position: relative;
    overflow: hidden;
    background: #151922;
}

.lead-skeleton-line::after,
.lead-skeleton-grid div::after,
.lead-skeleton-table div::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06),
        transparent
    );
    animation: leadSkeleton 1.15s infinite;
}

@keyframes leadSkeleton {
    100% {
        transform: translateX(100%);
    }
}

.lead-skeleton-small {
    width: 170px;
    height: 14px;
    margin-bottom: 15px;
}

.lead-skeleton-title {
    width: min(520px, 90%);
    height: 52px;
    margin-bottom: 16px;
}

.lead-skeleton-copy {
    width: min(680px, 94%);
    height: 18px;
    margin-bottom: 28px;
}

.lead-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid #242832;
    margin-bottom: 22px;
}

.lead-skeleton-grid div {
    height: 72px;
    border-right: 1px solid #242832;
}

.lead-skeleton-grid div:last-child {
    border-right: 0;
}

.lead-skeleton-table {
    display: grid;
    border: 1px solid #242832;
}

.lead-skeleton-table div {
    height: 58px;
    border-bottom: 1px solid #242832;
}

.lead-skeleton-table div:last-child {
    border-bottom: 0;
}

/* Mobile */
@media (max-width: 980px) {
    .lead-agent-modal {
        padding: 14px;
    }

    .lead-agent-frame {
        height: calc(100vh - 28px);
    }

    .lead-agent-body {
        grid-template-columns: 1fr;
    }

    .lead-agent-sidebar {
        display: none;
    }

    .lead-agent-topbar {
        grid-template-columns: auto 1fr 42px;
        gap: 12px;
        padding: 0 14px;
    }

    .lead-agent-brand span {
        display: none;
    }

    .lead-agent-search-wrap {
        max-width: none;
    }

    .lead-agent-content {
        padding: 20px;
    }

    .lead-agent-content-header {
        display: block;
    }

    .lead-run-button {
        margin-top: 16px;
    }

    .lead-summary-row,
    .lead-browser-grid,
    .lead-source-grid,
    .lead-skeleton-grid {
        grid-template-columns: 1fr;
    }

    .lead-summary-card {
        border-right: 0;
        border-bottom: 1px solid #242832;
    }

    .lead-summary-card:last-child {
        border-bottom: 0;
    }
}