/* Strukturierter Markt-Report-Viewer (/reports).
   Alle Regeln unter .report-view gescoped. NEUTRALE Palette — keine
   Wertungsfarben (kein Rot/Gruen, kein Kauf/Verkauf). Honesty / No-Guidance:
   die Report-Ansicht darf keine Richtungs-Affordanz einfaerben.
   Angelehnt an assets/market_v3.css (slate/blue neutral). */

.report-view {
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Header ──────────────────────────────────────────────────────── */
.report-view .report-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.report-view .report-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
}

.report-view .report-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* ── KPI Cards Row ───────────────────────────────────────────────── */
.report-view .report-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.report-view .report-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.report-view .report-kpi-card .card-body {
    padding: 0.75rem 0.875rem;
}

.report-view .report-kpi-label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.3rem;
}

.report-view .report-kpi-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.report-view .report-kpi-change {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ── Zusammenfassung Callout ─────────────────────────────────────── */
.report-view .report-callout {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.report-view .report-callout-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.report-view .report-callout-body {
    color: #334155;
    font-size: 0.88rem;
}

.report-view .report-callout-body p:last-child {
    margin-bottom: 0;
}

/* ── Section Cards ───────────────────────────────────────────────── */
.report-view .report-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.report-view .report-section-card .card-body {
    padding: 0.875rem 1rem;
}

.report-view .report-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f1f5f9;
}

.report-view .report-section-body p:last-child {
    margin-bottom: 0;
}

/* ── Datenanhang (Rohdaten-Accordion) ────────────────────────────── */
.report-view .report-appendix {
    margin-bottom: 1rem;
}

.report-view .report-appendix .accordion-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.report-view .report-appendix .accordion-button {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #1e3a5f;
    background: #f1f5f9;
    box-shadow: none;
}

/* Kein blauer/gruener Bootstrap-Fokus-/Active-Akzent: neutral halten. */
.report-view .report-appendix .accordion-button:not(.collapsed) {
    color: #1e3a5f;
    background: #e2e8f0;
    box-shadow: none;
}

.report-view .report-appendix .accordion-button:focus {
    border-color: #cbd5e1;
    box-shadow: 0 0 0 0.15rem rgba(148, 163, 184, 0.35);
}

.report-view .report-appendix .accordion-body {
    padding: 0.875rem 1rem;
}

.report-view .report-appendix-section {
    margin-bottom: 1.25rem;
}

.report-view .report-appendix-section:last-child {
    margin-bottom: 0;
}

.report-view .report-appendix-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #f1f5f9;
}

/* ── Beobachtungen / Kontext ─────────────────────────────────────── */
.report-view .report-context {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}

.report-view .report-context-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.report-view .report-context-list {
    margin: 0;
    padding-left: 1.15rem;
    color: #475569;
}

.report-view .report-context-list li {
    margin-bottom: 0.3rem;
}

.report-view .report-context-list li:last-child {
    margin-bottom: 0;
}

.report-view .report-context-empty {
    color: #94a3b8;
}

/* ── Empty / neutral states ──────────────────────────────────────── */
.report-view.report-empty,
.report-view .report-empty {
    color: #64748b;
    padding: 0.75rem 0;
}

/* ── Tables (dcc.Markdown-gerenderte GFM-Tabellen) ───────────────── */
.report-view table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: #475569;
    margin: 0.5rem 0 0.75rem;
}

.report-view th {
    text-align: left;
    font-weight: 600;
    color: #1e3a5f;
    background: #f1f5f9;
    padding: 0.45rem 0.65rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.75rem;
}

.report-view td {
    padding: 0.4rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
}

.report-view tbody tr:nth-child(even) {
    background: #f8fafc;
}

.report-view tbody tr:last-child td {
    border-bottom: none;
}

/* ── Markdown-Fallback (Legacy .md ohne Sidecar) ─────────────────── */
.report-view.report-markdown h1,
.report-view.report-markdown h2,
.report-view.report-markdown h3 {
    color: #1e3a5f;
}

/* ── Kombinierter Milchmarktbericht (mehrere Provider-Bloecke) ────── */
.report-view.report-combined {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Card-artige Trennung je Produkt/Provider-Sektion. Neutrale Palette;
   page-friendly (bricht nicht mitten im Block beim Drucken). */
.report-view.report-combined .report-provider-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Klare, neutrale Zwischenueberschrift je Block — KEINE Wertungsfarbe. */
.report-view.report-combined .report-provider-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid #e2e8f0;
}

/* ── PDF-Download-Button (Abstand zum Selector) ──────────────────── */
.report-download-btn {
    margin-left: 0.5rem;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .report-view .report-kpi-row {
        grid-template-columns: 1fr;
    }
}
