/* Berichtsstil — gilt im Portalrahmen und in der versendeten Datei.
   Keine festen Pixelbreiten in Layout-Behältern; Tabellen in scrollbaren
   Hüllen; Bruchpunkte 1280/1024/768 sind vorgesehen, aber noch nicht
   ausgearbeitet. */

.bericht {
    max-width: 60rem;
    margin: 0 auto;
    padding: 1.5rem;
    font-family: var(--font);
    color: var(--ink);
    line-height: 1.55;
    background: var(--surface);
}

.bericht h1 {
    font-size: 1.6rem;
    letter-spacing: -.02em;
    margin: 0 0 .25rem;
}

.bericht h2 {
    font-size: 1.15rem;
    margin: 0 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--stroke);
}

.bericht h3 {
    font-size: .95rem;
    margin: 1.25rem 0 .5rem;
}

.bericht .untertitel {
    color: var(--ink-2);
    margin: 0 0 1rem;
}

.bericht .abschnitt {
    margin-top: 2.25rem;
}

.bericht .kopfdaten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .75rem;
    margin: 0;
    padding: 1rem;
    background: var(--fill);
    border-radius: var(--r-tile);
}

.bericht .kopfdaten dt {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-3);
}

.bericht .kopfdaten dd {
    margin: .15rem 0 0;
    font-weight: 600;
}

.bericht .baseline-vermerk {
    margin-top: .75rem;
    padding: .6rem .9rem;
    background: var(--amber-soft);
    border-radius: var(--r-ctrl);
    color: var(--ink);
    font-size: .9rem;
}

.bericht .einleitung,
.bericht .hinweis {
    color: var(--ink-2);
    font-size: .92rem;
}

.bericht .kennzahlen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: .75rem;
    margin: 0 0 1rem;
}

.bericht .kachel {
    padding: .9rem 1rem;
    background: var(--fill);
    border-radius: var(--r-tile);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.bericht .kachel .wert {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bericht .kachel .beschriftung {
    font-size: .8rem;
    color: var(--ink-2);
}

.bericht .tabelle-huelle {
    overflow-x: auto;
    border: 1px solid var(--stroke);
    border-radius: var(--r-ctrl);
    margin: .5rem 0 1rem;
}

.bericht table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.bericht th,
.bericht td {
    text-align: left;
    padding: .45rem .7rem;
    border-bottom: 1px solid var(--stroke);
    vertical-align: top;
}

.bericht thead th {
    background: var(--fill);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-2);
}

.bericht tbody tr:last-child td {
    border-bottom: none;
}

.bericht tfoot td {
    font-weight: 700;
    background: var(--fill);
}

.bericht .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bericht .grund {
    color: var(--ink-2);
    font-size: .84rem;
}

.bericht .befunde {
    padding-left: 1.2rem;
}

.bericht .befunde li {
    margin: .25rem 0;
}

.bericht details.nachweis {
    border: 1px solid var(--stroke);
    border-radius: var(--r-ctrl);
    margin: .5rem 0;
    background: var(--surface);
}

.bericht details.nachweis summary {
    cursor: pointer;
    padding: .6rem .9rem;
    font-weight: 600;
    font-size: .9rem;
}

.bericht details.nachweis .anzahl {
    color: var(--ink-3);
    font-weight: 500;
    margin-left: .4rem;
    font-variant-numeric: tabular-nums;
}

.bericht details.nachweis .nachweis-inhalt {
    padding: 0 .9rem .75rem;
}

.bericht .methodik dt {
    font-weight: 700;
    margin-top: .75rem;
}

.bericht .methodik dd {
    margin: .15rem 0 0;
    color: var(--ink-2);
}

/* Arbeitstypen-Balken */
.bericht .typen-balken {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin: .5rem 0 1rem;
}

.bericht .typ-zeile {
    display: grid;
    grid-template-columns: minmax(5.5rem, 8rem) minmax(0, 1fr) minmax(8rem, auto);
    gap: .7rem;
    align-items: center;
    font-size: .88rem;
}

.bericht .typ-spur {
    background: var(--fill);
    border-radius: 999px;
    height: .7rem;
    overflow: hidden;
    display: block;
}

.bericht .typ-fuellung {
    display: block;
    height: 100%;
    border-radius: 999px;
}

/* Bug rot, Change orange, Feature grün — dieselbe Zuordnung wie die Marken im
   Portal (AufgabenArt). Weichen die beiden voneinander ab, liest sich derselbe
   Balken im Bericht anders als die Liste, aus der er entstanden ist. */
.bericht .typ-feature { background: var(--green); }
.bericht .typ-change { background: var(--amber); }
.bericht .typ-bug { background: var(--red); }
.bericht .typ-ohne { background: var(--ink-3); }

.bericht .typ-wert {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--ink-2);
}

/* Tagesverlauf-Sparkline */
.bericht .tagesverlauf {
    width: 100%;
    max-width: 42rem;
    height: auto;
    margin: .25rem 0 1rem;
}

.bericht .tagesverlauf .achse {
    font-size: 10px;
    fill: var(--ink-3);
    font-family: var(--font);
}

/* Filterchips über der Gesamttabelle (nur Portal) */
.bericht .filterchips {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin: 0 0 .75rem;
}

.bericht .filterchips button {
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--ink-2);
    border-radius: 999px;
    padding: .3rem .8rem;
    font: 600 .78rem var(--font);
    cursor: pointer;
}

.bericht .filterchips button[aria-pressed="true"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.bericht a {
    color: var(--brand);
    text-decoration: none;
}

.bericht a:hover {
    text-decoration: underline;
}

/* Drucken erzeugt aus jeder Ansicht die Dateifassung in A4, nie den
   Portalrahmen. Nachweise klappen beim Drucken automatisch auf. */
@media print {
    @page {
        size: A4;
        margin: 18mm 15mm;
    }

    body {
        background: #fff;
    }

    .portalrahmen,
    .seitenleiste,
    nav {
        display: none !important;
    }

    .bericht {
        max-width: none;
        padding: 0;
    }

    .bericht details.nachweis {
        border: none;
    }

    .bericht details.nachweis > summary {
        list-style: none;
    }

    .bericht details.nachweis:not([open]) .nachweis-inhalt,
    .bericht details.nachweis .nachweis-inhalt {
        display: block !important;
    }

    .bericht .abschnitt {
        break-inside: avoid-page;
    }

    .bericht .tabelle-huelle {
        overflow: visible;
    }
}

/* Der Bericht wird auch auf dem Telefon gelesen. Die Rasterspalten stehen
   bereits auf auto-fit/minmax, es fehlt nur der Innenabstand — 1,5 rem sind
   auf 390 px rund ein Sechstel der Breite. Tabellen liegen ohnehin in
   .tabelle-huelle und scrollen dort für sich. */
@media (max-width: 480px) {
    .bericht {
        padding: 1rem .75rem 2rem;
    }
}
