/* Water Maze Opportunity Engine — Phase 1 component styles.
   Most of the Overview reuses the shared kp-lead-* tile/chip/grid styles
   (lead-view.css) and the project-card / card-* mobile styles
   (project-mobile.css). Only the opportunity-specific bits live here.
   Tokens-only per the hex-code regression gate (no raw hex fallbacks). */

/* Inline AI fit-read chip next to the score (Phase 6c-v). */
.opp-fit-read {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-style: italic;
    color: var(--kp-gray-70);
    background-color: var(--kp-gray-bs-100);
    border: 1px solid var(--kp-gray-bs-200);
    border-radius: 12px;
    padding: 2px 10px;
}

/* Score column header + "how it's calculated" info bubble. */
.opp-score-head {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.opp-score-info {
    color: var(--kp-gray-60);
    cursor: help;
}

/* Constrain the tooltip bubble so the formula wraps to a readable width. */
.opp-score-help {
    max-width: 320px;
}

/* Lead-priority / fit score badge (grid + cards + detail header). */
.opp-score {
    display: inline-block;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: var(--kp-gray-bs-200);
    color: var(--kp-gray-90);
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    line-height: 1.4;
}

.opp-muted {
    color: var(--kp-gray-60);
}

/* Phase 4b-iii — analytics panel funnel stat blocks. */
.kp-opp-stat {
    min-width: 84px;
}

.kp-opp-stat__num {
    font-size: 22px;
    font-weight: 700;
    color: var(--kp-gray-90);
    line-height: 1.1;
}

.kp-opp-stat__lbl {
    font-size: 12px;
    color: var(--kp-gray-60);
}

/* Register-as-Project toolbar button — gray secondary (matches the kp-dialog
   Cancel button), so it's clearly visible instead of yellow-on-white, and reads
   as secondary to the yellow Convert-to-Lead primary. Token-based (no hex). */
.mud-button-root.opp-secondary-btn {
    background-color: var(--kp-gray-bs-600);
    color: var(--kp-white);
}
.mud-button-root.opp-secondary-btn:hover {
    background-color: var(--kp-gray-bs-700);
}

/* ===== Quick Action popup — fast call/email/status queue (auto-logged) ===== */
.kp-qa__header {
    margin-bottom: 4px;
}

.kp-qa__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.kp-qa__facility {
    font-size: 16px;
    font-weight: 700;
    color: var(--kp-gray-90);
}

.kp-qa__sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--kp-gray-70);
}

.kp-qa__counter {
    margin-left: auto;
    font-size: 12px;
    color: var(--kp-gray-60);
}

.kp-qa__contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    min-height: 38px;
    margin: 10px 0;
    padding: 8px 0;
    border-top: 1px solid var(--kp-gray-bs-200);
    border-bottom: 1px solid var(--kp-gray-bs-200);
}

.kp-qa__contact-fields {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.kp-qa__field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 180px;
}

.kp-qa__field-label {
    font-size: 11px;
    color: var(--kp-gray-70);
}

.kp-qa__field-label i {
    margin-right: 4px;
    color: var(--kp-gray-60);
}

.kp-qa__contact-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    margin-top: 6px;
}

.kp-qa__contact-item {
    font-weight: 600;
    color: var(--kp-gray-90);
}

.kp-qa__contact-item i {
    margin-right: 6px;
    color: var(--kp-gray-60);
}

.kp-qa__contact-note {
    font-size: 11px;
    font-style: italic;
    color: var(--kp-gray-60);
}

.kp-qa__actions {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.kp-qa__actions .kp-dialog__btn {
    flex: 1;
    justify-content: center;
}

.kp-qa__chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 10px;
}

.kp-qa__chips-label {
    font-size: 12px;
    color: var(--kp-gray-70);
}

.kp-qa__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
}

/* Let the four lifecycle buttons share one line and shrink evenly; they wrap
   to two lines on narrow (phone) widths. */
.kp-qa__status > * {
    flex: 1 1 auto;
}

.kp-qa__recent {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--kp-gray-bs-200);
}

.kp-qa__recent-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--kp-gray-60);
}

/* Scrollable so the rep can see the full logged history without growing the dialog. */
.kp-qa__recent-list {
    max-height: 132px;
    overflow-y: auto;
    padding-right: 4px;
}

.kp-qa__recent-item {
    font-size: 12px;
    color: var(--kp-gray-70);
}

.kp-qa__recent-item + .kp-qa__recent-item {
    margin-top: 2px;
}

.kp-qa__nav-spacer {
    flex: 1;
}
