﻿/* =============================================================================
   SALES ANALYTICS — map-sources.css
   Map Sources page. Bulk-confirm vendor sources for Retail-classified POS items
   that have no RetailItemVendorSource rows yet.
   ============================================================================= */

.sa-mapsources-meta {
    display: inline-flex;
    align-items: baseline;
    gap: 1rem;
    margin-left: 1rem;
    font-size: .9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

    .sa-mapsources-meta strong {
        color: var(--text-main);
        font-weight: 650;
        font-variant-numeric: tabular-nums;
    }

.sa-mapsources-strong-count,
.sa-mapsources-strong-count strong {
    color: var(--positive);
}

.sa-mapsources-intro {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(37, 99, 235, .04);
    border: 1px solid rgba(37, 99, 235, .10);
    border-radius: 12px;
    font-size: .92rem;
    color: var(--text-main);
    line-height: 1.55;
}

    .sa-mapsources-intro p {
        margin: 0 0 .5rem 0;
    }

        .sa-mapsources-intro p:last-child {
            margin-bottom: 0;
        }

    .sa-mapsources-intro code {
        font-family: var(--font-mono, ui-monospace, monospace);
        font-size: .88em;
        padding: 1px 5px;
        background: rgba(0, 0, 0, .06);
        border-radius: 3px;
    }

.sa-mapsources-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* ── Card ─────────────────────────────────────────────────────────────── */

.sa-mapsource-card {
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--glass-stroke);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: opacity .25s, transform .25s, max-height .35s, padding .35s, margin .35s, border-color var(--t-fast);
    overflow: hidden;
}

    .sa-mapsource-card:hover {
        border-color: rgba(37, 99, 235, .25);
    }

    .sa-mapsource-card.sa-mapsource-busy {
        opacity: .65;
        pointer-events: none;
    }

    .sa-mapsource-card.sa-mapsource-confirmed {
        opacity: 0;
        transform: translateX(20px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin: 0;
        border-color: transparent;
    }

    .sa-mapsource-card.sa-mapsource-hidden {
        display: none;
    }

.sa-mapsource-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}

.sa-mapsource-card-title {
    flex: 1;
    min-width: 0;
}

.sa-mapsource-pos-name {
    margin: 0 0 .15rem 0;
    font-size: 1rem;
    font-weight: 650;
    color: var(--text-main);
    line-height: 1.3;
}

.sa-mapsource-pos-code {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: .03em;
}

.sa-mapsource-skip {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--glass-stroke);
    border-radius: 6px;
    padding: .25rem .65rem;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background var(--t-fast), color var(--t-fast);
}

    .sa-mapsource-skip:hover {
        background: rgba(0, 0, 0, .04);
        color: var(--text-main);
    }

/* ── No suggestions state ─────────────────────────────────────────────── */

.sa-mapsource-no-suggestions {
    padding: .75rem 1rem;
    background: rgba(249, 115, 22, .06);
    border: 1px solid rgba(249, 115, 22, .15);
    border-radius: 8px;
    font-size: .88rem;
    color: var(--warn-strong, #92400e);
    line-height: 1.5;
}

/* ── Suggestion list ──────────────────────────────────────────────────── */

.sa-mapsource-suggestions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.sa-mapsource-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 1rem;
    border-radius: 8px;
    background: rgba(248, 250, 252, .65);
    border: 1px solid rgba(148, 163, 184, .15);
    transition: border-color var(--t-fast), background var(--t-fast);
}

    .sa-mapsource-suggestion.sa-strong {
        background: rgba(34, 197, 94, .05);
        border-color: rgba(34, 197, 94, .20);
    }

    .sa-mapsource-suggestion.sa-weak {
        opacity: .92;
    }

    .sa-mapsource-suggestion:hover {
        border-color: rgba(37, 99, 235, .30);
    }

.sa-mapsource-suggestion-main {
    flex: 1;
    min-width: 0;
}

.sa-mapsource-suggestion-headline {
    display: flex;
    align-items: baseline;
    gap: .65rem;
    margin-bottom: .15rem;
    flex-wrap: wrap;
}

.sa-mapsource-vendor-name {
    font-weight: 650;
    font-size: .92rem;
    color: var(--text-main);
}

.sa-mapsource-confidence {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

    .sa-mapsource-confidence.sa-strong {
        background: rgba(34, 197, 94, .15);
        color: #166534;
    }

    .sa-mapsource-confidence.sa-weak {
        background: rgba(148, 163, 184, .20);
        color: var(--text-muted);
    }

.sa-mapsource-vendor-item {
    font-size: .88rem;
    color: var(--text-main);
    margin-bottom: .25rem;
    line-height: 1.3;
}

.sa-mapsource-suggestion-meta {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

    .sa-mapsource-suggestion-meta strong {
        color: var(--text-main);
        font-weight: 600;
    }

.sa-meta-sep {
    opacity: .5;
}

.sa-mapsource-confirm {
    flex-shrink: 0;
    padding: .45rem .9rem;
    font-size: .85rem;
    font-weight: 600;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: filter var(--t-fast), opacity var(--t-fast);
}

    .sa-mapsource-confirm:hover:not(:disabled) {
        filter: brightness(0.92);
    }

    .sa-mapsource-confirm:disabled {
        opacity: .55;
        cursor: not-allowed;
    }
