/* ============================================================
   raport-print.css
   Stiluri pentru raportul PDF generat de renderRaportFinal().
   Extras integral din stilurile inline originale — nicio valoare
   nu a fost modificată, doar mutată aici ca regulă CSS.
   ============================================================ */

/* ── Document wrapper ─────────────────────────────────────── */
.rpt-doc {
    background: white;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #0f172a;
}

/* ── Pagină (wrapper flexbox de print) ────────────────────── */
.report-page {
    padding: 10mm 10mm 10mm 10mm;
    box-sizing: border-box;
    background: white;
    width: 100%;
    min-height: 296mm;
    display: flex;
    flex-direction: column;
}
.report-page--break   { page-break-after: always; }
.report-page--nobreak { page-break-after: auto; }

.rpt-content {
    flex: 1;
    display: block;
    width: 100%;
    padding-bottom: 40px;
}

/* ── Header pagină ─────────────────────────────────────────── */
.rpt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #cbd5e1;
    padding-bottom: 12px;
    margin-bottom: 20px;
    page-break-inside: avoid;
    width: 100%;
}
.rpt-header-title {
    margin: 0;
    font-size: 18pt;
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.rpt-header-subtitle {
    margin: 6px 0 0 0;
    font-size: 8pt;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}
.rpt-header-badge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-left: 12px;
}
.rpt-badge {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 8pt;
    font-weight: 700;
}
.rpt-header-date {
    margin-top: 8px;
    font-size: 8pt;
    color: #94a3b8;
    font-weight: 600;
}

/* ── Footer pagină ─────────────────────────────────────────── */
.rpt-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    page-break-inside: avoid;
    width: 100%;
}
.rpt-footer-left {
    font-size: 7.5pt;
    color: #94a3b8;
    font-weight: 600;
}
.rpt-footer-page {
    font-size: 7.5pt;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 12px;
}

/* ── Utilitare generale ────────────────────────────────────── */
.rpt-avoid   { page-break-inside: avoid; break-inside: avoid; }
.rpt-pb-auto { page-break-inside: auto; }
.ta-c        { text-align: center; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.mb-30       { margin-bottom: 30px; }
.rpt-block   { display: block; }

.fl-1    { flex: 1; }
.fl-1-2  { flex: 1.2; }
.fl-0-8  { flex: 0.8; }
.fl-0-9  { flex: 0.9; }

.w-5  { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-30 { width: 30%; }
.w-40 { width: 40%; }

.txt-blue  { color: #2563eb; }
.txt-red   { color: #ef4444; }
.txt-blue-bold  { color: #2563eb; font-weight: 800; }
.txt-red-bold   { color: #ef4444; font-weight: 800; }
.txt-green-bold { color: #10b981; font-weight: 800; }

/* ── Card / Label generice (fostele variabile CARD / LABEL) ─ */
.rpt-card {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.rpt-label {
    font-size: 7pt;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}
.rpt-label--mb10 { margin-bottom: 10px; }

/* ── KPI (funcția _kpi) ───────────────────────────────────── */
.rpt-kpi {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.rpt-kpi-title {
    font-size: 7.5pt;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.rpt-kpi-val {
    font-size: 14pt;
    font-weight: 800;
    color: #0f172a;
}
.rpt-kpi-unit-inline {
    font-size: 10pt;
    font-weight: 700;
    color: #64748b;
}
.rpt-kpi-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
    page-break-inside: avoid;
}
.rpt-kpi-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
    page-break-inside: avoid;
}
.rpt-kpi-grid-4--mb24 { margin-bottom: 24px; }
.rpt-locatie-val { font-size: 14pt; }

/* ── Secțiune "Centralizator" (camere) ───────────────────── */
.rpt-section-header {
    margin-bottom: 12px;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.rpt-section-title {
    margin: 0;
    font-size: 11.5pt;
    color: #0f172a;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rpt-total-badge {
    font-size: 9pt;
    font-weight: 800;
    color: #0f172a;
}
.rpt-accent-blue { color: #0ea5e9; }

/* ── Zonă / nivel termic ──────────────────────────────────── */
.rpt-zone-header {
    padding-top: 30px;
    margin-bottom: 0px;
    border-bottom: 2px solid #64748b;
    padding-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.rpt-zone-name {
    font-size: 11pt;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #0f172a;
}

/* ── Card cameră ──────────────────────────────────────────── */
.rpt-room-wrap {
    padding-top: 16px;
    page-break-inside: avoid;
    break-inside: avoid;
}
.rpt-room-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.rpt-room-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.rpt-room-name {
    font-weight: 800;
    color: #0f172a;
    font-size: 11pt;
    letter-spacing: -0.3px;
}
.rpt-mult-badge {
    font-size: 8pt;
    background: #0ea5e9;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}
.rpt-room-total {
    font-weight: 800;
    color: #0f172a;
    font-size: 10.5pt;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
}
.rpt-room-stats {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.rpt-stat-label {
    font-size: 6.5pt;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}
.rpt-stat-value {
    font-size: 9.5pt;
    font-weight: 700;
    color: #1e293b;
}
.rpt-room-solution {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.rpt-solution-label {
    font-size: 7pt;
    color: #475569;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.rpt-solution-value {
    font-size: 9pt;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
}

/* ── Bară info (Răcire) ───────────────────────────────────── */
.rpt-infobar {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    page-break-inside: avoid;
}
.rpt-infobar-label {
    font-size: 7.5pt;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}
.rpt-infobar-value {
    font-size: 10pt;
    font-weight: 800;
    color: #0f172a;
}
.rpt-infobar-value--red  { color: #ef4444; }
.rpt-infobar-value--blue { color: #2563eb; }
.rpt-infobar-value--cyan { color: #0ea5e9; }

/* ── Tabel Racire (rânduri flex) ──────────────────────────── */
.rpt-subtitle {
    margin: 0 0 10px 0;
    font-size: 10pt;
    color: #0f172a;
    font-weight: 800;
    text-transform: uppercase;
}
.rpt-table-wrap {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
}
.rpt-table-head-racire {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 4px;
    font-size: 7.5pt;
    font-weight: 800;
    color: #475569;
    text-align: center;
    align-items: center;
}
.rpt-table-row {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 4px;
    page-break-inside: avoid;
    align-items: center;
    font-size: 7.5pt;
    color: #475569;
}
.rpt-table-row--selected {
    background: #f1f5f9;
    font-weight: 800;
    color: #0f172a;
}

/* ── Pagina Consum: KPI-uri mici ──────────────────────────── */
.rpt-kpi-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.rpt-kpi-label {
    font-size: 7pt;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}
.rpt-kpi-value {
    font-size: 18pt;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}
.rpt-kpi-unit {
    font-size: 8.5pt;
    color: #64748b;
    font-weight: 700;
    margin-top: 4px;
}

/* ── Carduri info (Sistem termic / Date climatice) ────────── */
.rpt-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
    page-break-inside: avoid;
}
.rpt-info-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.rpt-info-card-head {
    background: #f8fafc;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}
.rpt-info-card-title {
    font-size: 8.5pt;
    color: #0f172a;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rpt-icon    { font-size: 10pt; }
.rpt-icon-lg { font-size: 16pt; }
.rpt-info-card-body {
    padding: 4px 16px 12px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ── Rând etichetă/valoare (funcția _randModern) ──────────── */
.rpt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px dashed #cbd5e1;
    page-break-inside: avoid;
}
.rpt-row--last { border-bottom: none; }
.rpt-row-label {
    color: #475569;
    font-size: 8pt;
    flex: 1;
    padding-right: 12px;
    line-height: 1.3;
}
.rpt-row-value {
    font-weight: 700;
    color: #0f172a;
    font-size: 8.5pt;
    flex: 1.2;
    text-align: right;
    word-wrap: break-word;
    line-height: 1.3;
}
.rpt-accent-blue-lg { color: #2563eb; font-size: 9.5pt; }
.rpt-accent-red-lg  { color: #ef4444; font-size: 9.5pt; }
.rpt-chip {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 7.5pt;
    border: 1px solid #e2e8f0;
}

/* ── Grafice (canvas → imagine) ───────────────────────────── */
.rpt-chart-img {
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: block;
    height: auto;
}
.rpt-chart-img--large {
    max-height: 210mm;
    object-fit: contain;
    margin: 0 auto;
}
.rpt-chart-placeholder {
    height: 110px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 8pt;
}
.rpt-card--chart {
    margin-bottom: 0;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
.rpt-graphs-wrap {
    margin-top: 0px;
    display: block;
    page-break-inside: avoid;
}
.rpt-graphs-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Analiză termotehnică ─────────────────────────────────── */
.rpt-element-bar {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.rpt-element-value {
    font-size: 12pt;
    font-weight: 800;
    color: #0f172a;
}
.rpt-subtitle-sm {
    font-size: 8pt;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.rpt-strip {
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.rpt-strip-seg {
    height: 100%;
    min-width: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    /* 'flex' și 'background-color' sunt calculate dinamic din datele
       utilizatorului și aplicate prin JS (.style), nu prin style="" în
       marcaj — vezi aplicaStiluriDinamice() din raport.js. */
}
.rpt-strip-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}
.rpt-legend-side {
    font-size: 7.5pt;
    color: #64748b;
    font-weight: 600;
}
.rpt-legend-total {
    font-size: 8.5pt;
    font-weight: 800;
    color: #0f172a;
}

/* ── Tabel straturi element ───────────────────────────────── */
.rpt-table-wrap-flat {
    border: 0px solid #cbd5e1;
    border-radius: 8px;
    page-break-inside: auto;
}
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
    page-break-inside: auto;
}
.rpt-thead-row {
    background: #f8fafc;
    border-bottom: 1px solid #cbd5e1;
    page-break-inside: avoid;
}
.rpt-th {
    padding: 9px 10px;
    text-align: center;
    color: #475569;
    font-weight: 700;
    font-size: 7.5pt;
    text-transform: uppercase;
}
.rpt-th--first { border-radius: 8px 0 0 0; text-align: left; }
.rpt-th--last  { border-radius: 0 8px 0 0; }
.rpt-tr { border-bottom: 1px solid #e2e8f0; page-break-inside: avoid; break-inside: avoid; }
.rpt-td-swatch-cell { padding: 9px 10px; width: 20px; }
.rpt-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* 'background-color' e culoarea stratului de material, aplicată prin JS
       (.style), nu prin style="" în marcaj — vezi aplicaStiluriDinamice(). */
}
.rpt-td-mat {
    padding: 9px 10px;
    font-weight: 600;
    color: #1e293b;
}
.rpt-td-thick {
    padding: 9px 10px;
    text-align: center;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}
.rpt-td-prop { padding: 9px 10px; width: 36%; }
.rpt-prop-track {
    background: #f1f5f9;
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
}
.rpt-prop-fill {
    height: 100%;
    border-radius: 20px;
    /* 'background-color' și 'width' depind de datele fiecărui strat,
       calculate la runtime și aplicate prin JS (.style), nu prin style=""
       în marcaj — vezi aplicaStiluriDinamice(). */
}
.rpt-td-pct {
    padding: 9px 10px;
    text-align: right;
    color: #64748b;
    font-size: 8.5pt;
    font-weight: 700;
}

/* ── Mollier: rânduri puncte ───────────────────────────────── */
.rpt-mollier-row {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 4px;
    page-break-inside: avoid;
    align-items: center;
    font-size: 6.5pt;
}
.rpt-mollier-name {
    text-align: left;
    font-weight: 800;
    padding-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    /* 'color' și 'border-left' sunt culoarea specifică fiecărui punct din
       diagrama psihrometrică, aplicate prin JS (.style), nu prin style=""
       în marcaj — vezi aplicaStiluriDinamice() din raport.js. */
}
.rpt-mollier-cell {
    color: #475569;
    font-weight: 700;
}
.rpt-mollier-head {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #1e293b;
    padding: 8px 4px;
    font-size: 6.5pt;
    font-weight: 800;
    color: #475569;
    text-align: center;
    align-items: center;
}
.rpt-mollier-head-first { text-align: left; padding-left: 4px; }

/* ── Mollier: rânduri procese ──────────────────────────────── */
.rpt-proc-row {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 4px;
    page-break-inside: avoid;
    align-items: center;
    font-size: 7pt;
}
.rpt-proc-name {
    text-align: left;
    padding-left: 4px;
    font-weight: 800;
    color: #475569;
}
.rpt-proc-action {
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
}
.rpt-proc-cell {
    color: #475569;
    font-weight: 700;
}
.rpt-empty-msg {
    padding: 15px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    font-size: 8pt;
}

/* ── Notă legală ───────────────────────────────────────────── */
.rpt-disclaimer {
    page-break-inside: avoid;
    margin-top: 10px;
    margin-bottom: 20px;
    padding: 14px;
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
    background-color: #fef2f2;
    border-radius: 8px;
}
.rpt-disclaimer-title {
    margin: 0 0 6px 0;
    color: #b91c1c;
    font-size: 8pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rpt-disclaimer-text {
    margin: 0;
    font-size: 7.5pt;
    color: #7f1d1d;
    line-height: 1.4;
    text-align: justify;
}
.opacitate_redusa { opacity: 0.5; }

/* ===== MODAL RAPORT: fără bară de scroll, derulare curată ===== */
#modalSelectieRaport,
#modalSelectieRaport > div {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* Edge vechi */
}
#modalSelectieRaport::-webkit-scrollbar,
#modalSelectieRaport > div::-webkit-scrollbar {
    display: none;                  /* Chrome / Edge / Safari */
    width: 0;
    height: 0;
}

#modalSelectieRaport > div {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    margin: auto;
    box-sizing: border-box;
}
/* ============================================================
   Regulile de print — mutate identic din blocul JS
   `styleEl.innerHTML = '@media print {...}'`
   ============================================================ */
@media print {
    :root, html, body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    @page { margin: 0; size: A4 portrait; }
    body > *:not(#reportContainer) { display: none !important; }
    #reportContainer {
        display: block !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}