/* ================================================================
   enrichment.css — Enrichments (list, New Enrichment modal, contacts page)
   Builds on discover.css (form, chips, modal, results table).
   ================================================================ */

.enrich-icon,
.enrichment-modal__icon {
    background: #ffedd5;
    color: #c2410c;
}

.enrich-note {
    display: flex;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--clr-accent-light);
    color: var(--clr-text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
}

.enrich-note i {
    color: var(--clr-accent);
    margin-top: 2px;
}

.enrichment-modal .form-section > .form-field + .form-field,
.enrichment-modal .form-section > .form-field + .form-grid {
    margin-top: 14px;
}

.enrich-link {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--clr-accent);
    font-size: 12px;
    cursor: pointer;
}

.enrich-link:hover {
    text-decoration: underline;
}

/* Chips with a live count */
.chip__count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--clr-border);
    color: var(--clr-text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    text-align: center;
}

.chip:has(input:checked) .chip__count {
    background: #dbeafe;
    color: var(--clr-accent);
}

.chip--empty {
    opacity: 0.55;
}

.chip-group--dense .chip {
    padding: 5px 10px;
    font-size: 12.5px;
}

/* Live summary (between the body and the footer) */
.enrich-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    border-top: 1px solid var(--clr-border);
    background: var(--clr-border);
    transition: opacity 0.15s;
}

.enrich-summary.is-loading {
    opacity: 0.55;
}

.enrich-summary__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    background: var(--clr-surface);
    min-width: 0;
}

.enrich-summary__value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: var(--fw-semi, 600);
    color: var(--clr-text-primary);
}

.enrich-summary__label {
    font-size: 11.5px;
    color: var(--clr-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enrich-summary__item--warn {
    background: #fef2f2;
}

.enrich-summary__item--warn .enrich-summary__value,
.enrich-summary__item--warn .enrich-summary__label {
    color: #b91c1c;
}

@media (max-width: 640px) {
    .enrich-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tabs on the contacts page */
.enrich-tabs {
    display: inline-flex;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: var(--clr-border);
}

.enrich-tab {
    padding: 5px 14px;
    border: 0;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    color: var(--clr-text-secondary);
    font-size: 13px;
    font-weight: var(--fw-medium);
    cursor: pointer;
}

.enrich-tab.active {
    background: var(--clr-surface);
    color: var(--clr-text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Small pills: tier, confidence, verification, decision maker */
.enrich-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: var(--fw-semi, 600);
    background: var(--clr-border);
    color: var(--clr-text-secondary);
    white-space: nowrap;
    vertical-align: middle;
}

.enrich-pill--hot { background: #fee2e2; color: #b91c1c; }
.enrich-pill--warm { background: #ffedd5; color: #c2410c; }
.enrich-pill--cold { background: #e0f2fe; color: #0369a1; }
.enrich-pill--dm { background: var(--clr-purple-bg); color: var(--clr-purple-text); margin-left: 4px; }
.enrich-pill--conf-high { background: var(--clr-green-bg); color: var(--clr-green-text); }
.enrich-pill--conf-mid { background: #fef9c3; color: #a16207; }
.enrich-pill--conf-low { background: #fee2e2; color: #b91c1c; }
.enrich-pill--verify-valid { background: var(--clr-green-bg); color: var(--clr-green-text); }

.enrich-error {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-status--default {
    background: var(--clr-border);
    color: var(--clr-text-secondary);
}

/* Sources + their runs (New Enrichment modal) */
.source-blocks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.source-block {
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.source-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.source-block__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 0;
    font-size: 12.5px;
}

.source-block__toggle i {
    font-size: 11px;
    transition: transform 0.15s;
}

.source-block.is-open .source-block__toggle i {
    transform: rotate(180deg);
}

.source-block.has-runs .source-block__toggle {
    font-weight: var(--fw-semi, 600);
}

.run-list {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--clr-border);
}

.run-list__search {
    margin-bottom: 6px;
    padding: 6px 10px;
    font-size: 13px;
}

.run-list__actions {
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.run-list__actions .enrich-link {
    margin-left: 0;
}

.run-list__items {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
}

.run-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
}

.run-item:hover {
    background: var(--hover-bg, #f9fafb);
}

.run-item input {
    flex-shrink: 0;
    accent-color: var(--clr-accent);
}

.run-item__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.run-item__label {
    font-size: 13px;
    color: var(--clr-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-item__meta {
    font-size: 11.5px;
    color: var(--clr-text-muted);
}

.run-item:has(input:checked) .chip__count {
    background: #dbeafe;
    color: var(--clr-accent);
}
