/* ----------------------------------------------------------
   Listing Automation - shared styles
   Used by: CandidateDetailsDialog, SnapshotTuning, and child components
   ---------------------------------------------------------- */

/* - Confidence badges ------------------ */

.confidence-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
    min-width: 2.5rem;
    text-align: center;
}

.confidence-high { background: #dcfce7; color: #166534; }
.confidence-mid  { background: #fef9c3; color: #854d0e; }
.confidence-low  { background: #fee2e2; color: #991b1b; }

.confidence-badge[data-pw-tooltip] {
    cursor: help;
}

/* - Stat cards ---------------------- */

.la-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.la-stat-card {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--rz-primary);
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.la-stat-label {
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
}

.la-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.la-subsection-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.4rem 0 0.2rem 0;
    color: #555;
}

.la-no-data {
    padding: 2rem;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* - Price Rationale ------------------- */

.rationale {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.rat-sect {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
}

.rat-hdr {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 0.3rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #e2e8f0;
}

.rat-text {
    font-size: 0.78rem;
    color: #334155;
}

.rat-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--rz-primary);
    margin-bottom: 0.25rem;
}

.rat-weights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.rat-wt {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 2px 6px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 0.72rem;
    flex: 1 1 45%;
}

.rat-wt-name { color: #64748b; font-weight: 500; }
.rat-wt-calc { color: #334155; }

.rat-base {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #475569;
}

.rat-factor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.rat-factor {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
}

.rat-factor-name {
    font-weight: 600;
    color: var(--rz-primary);
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #f1f5f9;
}

.rat-factor-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.15rem 0.25rem;
}

.rat-factor-stat {
    font-size: 0.71rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rat-factor-reason {
    font-size: 0.68rem;
    color: #94a3b8;
    font-style: italic;
    padding-top: 3px;
    border-top: 1px dashed #e2e8f0;
    margin-top: 3px;
    white-space: normal;
}

.rat-blend-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.75rem;
}

.rat-blend-name { font-weight: 500; color: #475569; }
.rat-blend-val { color: #334155; }

.rat-blend-result {
    margin-top: 0.2rem;
    padding-top: 0.2rem;
    border-top: 1px solid #cbd5e1;
    font-size: 0.78rem;
    color: #334155;
}

.rat-pair {
    display: flex;
    gap: 0.4rem;
}

.rat-pair > .rat-sect {
    flex: 1;
    min-width: 0;
}

.rat-metric {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.75rem;
}

.rat-metric-name { color: #64748b; }
.rat-metric-val { font-weight: 600; color: #334155; }

.rat-final {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

/* -- Quantity rationale ----------------------------------- */

.qty-rationale {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.qty-rat-summary {
    font-size: 0.8rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

.qty-rat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.qty-rat-stat {
    display: flex;
    gap: 0.3rem;
    align-items: baseline;
}

.qty-rat-label {
    color: #64748b;
    font-size: 0.75rem;
}

.qty-rat-val {
    font-weight: 600;
    color: #334155;
    font-size: 0.75rem;
}
