/*
 * PIT20-687 — Ajánlattükör.
 *
 * ⚠️ Az első oszlop RAGAD. Öt ajánlattevőnél a táblázat vízszintesen görget, és e nélkül
 * nem látszana, melyik tételről van szó — vagyis pont az összehasonlítás veszne el.
 */

.quoteComparisonTableWrapper {
    overflow-x: auto;
    max-height: 60vh;
    overflow-y: auto;
}

.quoteComparisonTable {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.quoteComparisonTable th,
.quoteComparisonTable td {
    vertical-align: top;
    white-space: nowrap;
}

.quoteComparisonTable .quoteStickyCol {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: var(--planit-surface, #fff);
    min-width: 260px;
    max-width: 320px;
    white-space: normal;
}

.quoteComparisonTable thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: var(--planit-surface, #fff);
}

.quoteComparisonTable thead .quoteStickyCol {
    z-index: 4;
}

/* A legolcsóbb ár soronként — kiemelve, de nem harsányan: a legolcsóbb nem
   automatikusan a legjobb (lásd lefedettség és fedezet). */
.quoteCell.quoteCheapest .quoteCellPrice {
    font-weight: 700;
}

.quoteCell.quoteCheapest {
    background-color: rgba(76, 175, 80, .10);
}

/* Kiugró ár MINDKÉT irányban. A "low" nem dicséret, hanem figyelmeztetés: a gyanúsan
   olcsó ár általában félreértett tételt jelent, és pótmunkaként jön vissza. */
.quoteCell.quoteOutlierHigh {
    box-shadow: inset 3px 0 0 #ff7043;
}

.quoteCell.quoteOutlierLow {
    box-shadow: inset 3px 0 0 #ffa726;
}

/* Nincs ár — háromféle okból, háromféle jelöléssel. */
.quoteCell.quoteDeclined,
.quoteCell.quoteMissing,
.quoteCell.quoteUnpriced {
    background-color: rgba(0, 0, 0, .03);
}

.quoteCell.quoteDeclined .quoteCellState {
    color: #e53935;
}

.quoteCell.quoteMissing .quoteCellState,
.quoteCell.quoteUnpriced .quoteCellState {
    color: #fb8c00;
}

/* Hiányos ajánlat oszlopa — a végösszege nem hasonlítható a teljesekhez. */
.quoteColumn.quoteIncomplete {
    background-color: rgba(255, 152, 0, .08);
}

.quoteCoverageIncomplete {
    color: #ef6c00;
    font-weight: 600;
}

/* Negatív fedezet: ezen a tételen VESZTENÉNK. */
.quoteMarginNegative {
    color: #e53935;
    font-weight: 600;
}

.quoteMarginPositive {
    color: #2e7d32;
}

/* Kiegészítő tétel — nincs hozzá saját árunk, tehát fedezet sem. */
.quoteComparisonRow.quoteExtraItem .quoteStickyCol {
    border-left: 3px solid #90a4ae;
}

.quoteScoreRow {
    display: flex;
    align-items: center;
    padding: 2px 0;
}

.quoteScoreBar {
    height: 6px;
    border-radius: 3px;
    background-color: #26a69a;
    margin-left: 8px;
}

/* ── PIT20-1472 — anyag (A) és munkadíj (D) külön ──────────────────────────────────
   A két összetevő saját jelvényt kap, a tükör minden helyén ugyanazt: fejléc, saját ár,
   ajánlati cella, döntés. Áttetsző háttér, hogy világos és sötét témában is olvasható
   legyen. */
.quoteComponentBadge {
    display: inline-block;
    min-width: 1.5rem;
    margin-right: .5rem;
    text-align: center;
    border: 1px solid transparent;
}

.quoteComponentBadge.quoteComponentMaterial {
    background-color: rgba(33, 150, 243, .14);
    border-color: rgba(33, 150, 243, .45);
    color: #1e88e5;
}

.quoteComponentBadge.quoteComponentWork {
    background-color: rgba(255, 152, 0, .14);
    border-color: rgba(255, 152, 0, .5);
    color: #ef6c00;
}

.quoteComponentLine {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    line-height: 1.6;
}

/* Kiugró ár ÖSSZETEVŐNKÉNT — a gyanúsan olcsó nem dicséret. */
.quoteComponentLine.quoteComponentOutlierLow .quoteComponentValue {
    border-bottom: 2px solid #ffa726;
}

.quoteComponentLine.quoteComponentOutlierHigh .quoteComponentValue {
    border-bottom: 2px solid #ff7043;
}

/* Egyéb díjak: a küszöb fölötti díjarány és a nem kért díj kiemelve. */
.quoteFeeRatioHigh {
    color: #ef6c00;
    font-weight: 600;
}

.quoteFeeNotRequested {
    color: #e53935;
    font-weight: 600;
}

.quoteFeeCell.quoteFeeCellUnrequested {
    background-color: rgba(229, 57, 53, .06);
}

.quoteComparisonTable .quoteFeeSection th {
    border-top: 2px solid rgba(0, 0, 0, .12);
    padding-top: .75rem;
}

.quoteComparisonTable .quoteFootRow th {
    font-weight: 400;
}

/* Tételenkénti döntés: összetevőnként egy választó. */
.quoteAwardPicker .select2-container {
    min-width: 12rem;
}

/* PIT20-1473 — az A és D jelvények egymás alatt, oszloponként egy vonalban.
   A sor jobbra igazít, tehát a jelvény helye az érték szélességétől függött („nem kértük"
   szélesebb, mint „8 000 Ft"). Az érték fix minimális szélességű, jobbra zárt dobozban áll —
   így a jelvény a fejlécben, a saját árnál és minden cellában ugyanott van. */
.quoteComponentValue {
    display: inline-block;
    min-width: 7.5rem;
    text-align: right;
}

/* PIT20-1474 — a ragadó fejléc NEM lehet átlátszó. A hiányos ajánlat jelölése a
   háttérszínt egy áttetsző narancsra írta felül, és görgetéskor a tételsorok átlátszottak
   a fejlécen. Az árnyalat ezért rétegként (background-image) ül az átlátszatlan alapon. */
.quoteComparisonTable thead th,
.quoteComparisonTable thead .quoteColumn.quoteIncomplete {
    background-color: var(--planit-surface, #fff);
}

.quoteComparisonTable thead .quoteColumn.quoteIncomplete {
    background-image: linear-gradient(rgba(255, 152, 0, .08), rgba(255, 152, 0, .08));
}
