:root {
    --ink: #172033;
    --muted: #667085;
    --line: #dde4ee;
    --panel: #ffffff;
    --page: #f3f6fb;
    --brand: #e62117;
    --blue: #2563eb;
    --green: #168a5b;
    --amber: #b7791f;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(230, 33, 23, 0.08), transparent 28rem),
        linear-gradient(180deg, #f8fafc 0%, var(--page) 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    width: min(100%, 1720px);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 3rem);
}

.app-nav {
    min-height: 72px;
    background: #151923;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: #fff;
}

.navbar-brand .bi {
    color: var(--brand);
    font-size: 1.55rem;
}

.app-nav .nav-link {
    color: rgba(255, 255, 255, 0.68);
    font-weight: 700;
    padding-inline: 1rem;
}

.app-nav .nav-link:hover,
.app-nav .nav-link.active {
    color: #fff;
}

.hero-panel,
.results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: clamp(1.4rem, 3vw, 2.2rem);
    background:
        linear-gradient(135deg, rgba(230, 33, 23, 0.96), rgba(23, 32, 51, 0.96)),
        #172033;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(23, 32, 51, 0.18);
}

.hero-panel h1,
.results-head h1 {
    max-width: 820px;
    margin: 0.35rem 0 0.65rem;
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 850;
    line-height: 1.03;
    letter-spacing: 0;
}

.hero-panel p {
    max-width: 780px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
}

.eyebrow {
    display: inline-flex;
    color: #ffe2df;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-actions {
    flex: 0 0 auto;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card {
    min-height: 112px;
    padding: 1.2rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.06);
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 0.45rem;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1;
}

.workspace-panel,
.filter-panel,
.lead-table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.06);
}

.workspace-panel,
.filter-panel {
    padding: clamp(1rem, 2vw, 1.5rem);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 850;
}

.panel-head p {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.form-label {
    color: #263244;
    font-weight: 750;
}

.form-control,
.form-select {
    border-color: #ced7e3;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 8px;
    font-weight: 800;
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue);
    border-color: var(--blue);
}

.btn-success {
    background: var(--green);
    border-color: var(--green);
}

.option-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.option-tile {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    min-height: 74px;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
}

.option-tile strong {
    display: block;
    color: var(--ink);
}

.option-tile span {
    color: var(--muted);
    font-size: 0.9rem;
}

.app-alert {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    border-radius: 8px;
    font-weight: 700;
}

.search-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.search-summary div {
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.search-summary strong,
.search-summary span {
    display: block;
}

.search-summary strong {
    font-size: 1.45rem;
}

.search-summary span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 750;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.lead-table-wrap {
    overflow-x: auto;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.lead-table {
    min-width: 1260px;
}

.lead-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f9fc;
    color: #475467;
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.lead-table td,
.lead-table th {
    padding: 1rem;
    border-color: #edf1f6;
}

.channel-cell {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 300px;
}

.channel-cell img,
.thumb-fallback {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 8px;
    object-fit: cover;
    background: #eef2f7;
}

.thumb-fallback {
    display: grid;
    place-items: center;
    color: var(--brand);
}

.channel-cell a {
    color: var(--ink);
    font-weight: 850;
    text-decoration: none;
}

.channel-cell a:hover {
    color: var(--blue);
}

.email-cell {
    max-width: 280px;
    white-space: normal;
    word-break: break-word;
}

.country-pill {
    display: inline-flex;
    min-width: 44px;
    justify-content: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #eef7f2;
    color: #166645;
    font-weight: 850;
}

.empty-row {
    padding: 3rem 1rem;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 992px) {
    .hero-panel,
    .results-head,
    .panel-head,
    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .metric-grid,
    .search-summary,
    .option-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .app-shell {
        padding-inline: 1rem;
    }

    .metric-grid,
    .search-summary,
    .option-strip {
        grid-template-columns: 1fr;
    }

    .hero-panel h1,
    .results-head h1 {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
    }
}
