/* Report style — applies inside the portal frame and in the sent file.
   No fixed pixel widths in layout containers; tables in scrollable wrappers;
   breakpoints 1280/1024/768 are provided for, but not yet worked out. */

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

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

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

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

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

.report .section {
    margin-top: 2.25rem;
}

.report .header-data {
    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);
}

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

.report .header-data dd {
    margin: .15rem 0 0;
    font-weight: 600;
}

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

.report .intro,
.report .note {
    color: var(--ink-2);
    font-size: .92rem;
}

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

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

.report .tile .value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.report .tile .label {
    font-size: .8rem;
    color: var(--ink-2);
}

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

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

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

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

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

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

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

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

.report .findings {
    padding-left: 1.2rem;
}

.report .findings li {
    margin: .25rem 0;
}

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

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

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

.report details.evidence .evidence-body {
    padding: 0 .9rem .75rem;
}

.report .methodology dt {
    font-weight: 700;
    margin-top: .75rem;
}

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

/* Work kind bars */
.report .kind-bar {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin: .5rem 0 1rem;
}

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

.report .kind-track {
    background: var(--fill);
    border-radius: 999px;
    height: .7rem;
    overflow: hidden;
    display: block;
}

.report .kind-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

/* Bug red, change orange, feature green — the same assignment as the badges in
   the portal (WorkItemKindBadge). If the two diverge, the same bar in the
   report reads differently from the list it came from. */
.report .kind-feature { background: var(--green); }
.report .kind-change { background: var(--amber); }
.report .kind-bug { background: var(--red); }
.report .kind-none { background: var(--ink-3); }

.report .kind-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--ink-2);
}

.report h4 {
    font-size: .85rem;
    margin: .9rem 0 .35rem;
    color: var(--ink-2);
}

.report .mut {
    color: var(--ink-3);
}

/* Traffic light of a key figure (2026-10-23) — green good, yellow fair, red poor, from the
   value itself (KeyFigure.Rate). Shared by „Auf einen Blick", the trend charts and the tiles. */
.report .rating {
    display: inline-block;
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--fill-2);
    color: var(--ink-2);
}

.report .rating.good { background: var(--green-soft); color: var(--green); }
.report .rating.warn { background: var(--amber-soft); color: var(--amber); }
.report .rating.bad { background: var(--red-soft); color: var(--red); }

.report td.rated.good { color: var(--green); font-weight: 700; }
.report td.rated.warn { color: var(--amber); font-weight: 700; }
.report td.rated.bad { color: var(--red); font-weight: 700; }

/* The comparison with the previous period — a hint next to the traffic light, never the
   judgement itself. */
.report .trend-hint { color: var(--ink-3); font-size: .82rem; }
.report .trend-hint.good { color: var(--green); }
.report .trend-hint.bad { color: var(--red); }

/* Trend charts — one card per key figure */
.report .trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: .75rem;
}

.report .trend-card {
    margin: 0;
    padding: .8rem .9rem .6rem;
    background: var(--fill);
    border-radius: var(--r-tile);
    border-left: 4px solid var(--stroke-2);
}

.report .trend-card.good { border-left-color: var(--green); }
.report .trend-card.warn { border-left-color: var(--amber); }
.report .trend-card.bad { border-left-color: var(--red); }
.report .trend-card.good .trend-value { color: var(--green); }
.report .trend-card.warn .trend-value { color: var(--amber); }
.report .trend-card.bad .trend-value { color: var(--red); }

.report .trend-card figcaption {
    display: grid;
    gap: .1rem;
}

.report .trend-name {
    font-size: .78rem;
    color: var(--ink-2);
    font-weight: 600;
}

.report .trend-value {
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.report .trend-delta {
    font-size: .76rem;
    color: var(--ink-3);
}

.report .trend-delta.good { color: var(--green); }
.report .trend-delta.bad { color: var(--red); }

.report .trend-svg {
    width: 100%;
    height: auto;
    margin-top: .5rem;
    overflow: visible;
}

/* The bands behind the line — faint, so the line stays the figure. */
.report .trend-zone { opacity: .1; }
.report .trend-zone.good { fill: var(--green); }
.report .trend-zone.warn { fill: var(--amber); }
.report .trend-zone.bad { fill: var(--red); }

.report .trend-base { stroke: var(--stroke); stroke-width: 1; }
.report .trend-line { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linejoin: round; }
.report .trend-dot { fill: var(--brand); stroke: var(--fill); stroke-width: 1.5; }
.report .trend-dot.good { fill: var(--green); }
.report .trend-dot.warn { fill: var(--amber); }
.report .trend-dot.bad { fill: var(--red); }

.report .trend-label {
    font-size: 8.5px;
    fill: var(--ink-2);
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
}

.report .trend-label.last {
    font-weight: 700;
    fill: var(--ink);
}

.report .trend-axis {
    font-size: 8.5px;
    fill: var(--ink-3);
    font-family: var(--font);
}

/* Work kind ring */
.report .donut {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin: .5rem 0 1rem;
}

.report .donut-svg {
    width: 9.5rem;
    height: 9.5rem;
    flex: none;
}

.report .donut-track { fill: none; stroke: var(--fill-2); stroke-width: 6; }
.report .donut-seg { fill: none; stroke-width: 6; }
.report .donut-seg.kind-feature { stroke: var(--green); }
.report .donut-seg.kind-change { stroke: var(--amber); }
.report .donut-seg.kind-bug { stroke: var(--red); }
.report .donut-seg.kind-none { stroke: var(--ink-3); }

.report .donut-total {
    font-size: 5.5px;
    font-weight: 700;
    fill: var(--ink);
    font-family: var(--font);
}

.report .donut-unit {
    font-size: 3px;
    fill: var(--ink-3);
    font-family: var(--font);
}

.report .donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .4rem;
    flex: 1 1 14rem;
    font-size: .88rem;
}

.report .donut-legend li {
    display: grid;
    grid-template-columns: .8rem minmax(0, 1fr) auto;
    gap: .55rem;
    align-items: center;
}

.report .swatch {
    width: .8rem;
    height: .8rem;
    border-radius: 3px;
    display: block;
}

/* Planned, tracked, available */
.report .plan-bars {
    display: grid;
    gap: .55rem;
    margin: .25rem 0 1.1rem;
}

.report .plan-row {
    display: grid;
    grid-template-columns: minmax(5rem, 6.5rem) minmax(0, 1fr) minmax(5rem, auto);
    gap: .2rem .7rem;
    align-items: center;
    font-size: .88rem;
}

.report .plan-name { font-weight: 600; }

.report .plan-track {
    background: var(--fill);
    border-radius: 999px;
    height: .8rem;
    overflow: hidden;
    display: flex;
}

.report .plan-fill {
    display: block;
    flex: none;
    height: 100%;
}

/* Commitment and inserted items side by side in the planned bar (2026-10-23). */
.report .plan-planned { background: var(--purple); }
.report .plan-inserted { background: var(--amber); }

.report .plan-key {
    display: inline-block;
    width: .6rem;
    height: .6rem;
    border-radius: 2px;
    vertical-align: -.05rem;
}

.report .plan-over { color: var(--red); }
.report .plan-tracked { background: var(--brand); }
.report .plan-available { background: var(--ink-3); }

.report .plan-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.report .plan-hint {
    grid-column: 2 / -1;
    font-size: .76rem;
    color: var(--ink-3);
}

/* Daily trend sparkline */
.report .daily-trend {
    width: 100%;
    max-width: 42rem;
    height: auto;
    margin: .25rem 0 1rem;
}

.report .daily-trend .axis {
    font-size: 10px;
    fill: var(--ink-3);
    font-family: var(--font);
}

/* Filter chips above the overall table (portal only) */
.report .filter-chips {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin: 0 0 .75rem;
}

.report .filter-chips 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;
}

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

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

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

/* Printing produces the file version in A4 out of every view, never the portal
   frame. Evidence sections expand automatically when printing. */
@media print {
    @page {
        size: A4;
        margin: 18mm 15mm;
    }

    body {
        background: #fff;
    }

    .portal-frame,
    .sidebar,
    nav {
        display: none !important;
    }

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

    .report details.evidence {
        border: none;
    }

    .report details.evidence > summary {
        list-style: none;
    }

    .report details.evidence:not([open]) .evidence-body,
    .report details.evidence .evidence-body {
        display: block !important;
    }

    .report .section {
        break-inside: avoid-page;
    }

    .report .table-wrap {
        overflow: visible;
    }
}

/* The report is also read on the phone. The grid columns already stand on
   auto-fit/minmax, only the inner spacing is missing — 1.5 rem is about a sixth
   of the width on 390 px. Tables lie in .table-wrap anyway and scroll there for
   themselves. */
@media (max-width: 480px) {
    .report {
        padding: 1rem .75rem 2rem;
    }
}

/* ===== Charts added on 2026-10-23 =====
   Colours only from the tokens (carelogic style guide): in the folder brand, outside purple,
   inserted amber as in the planned bar, outside-done grey, open and not tracked as a pale
   hatched fill. Every chart names its parts in a legend or next to the mark — the colour
   never carries the meaning alone. */
.report .time-in { background: var(--brand); }
.report .time-out { background: var(--purple); }
.report .time-rest { background: var(--fill-2); }
.report .donut-seg.time-in { stroke: var(--brand); }
.report .donut-seg.time-out { stroke: var(--purple); }
.report .donut-seg.time-rest { stroke: var(--fill-2); }

.report .scope-baseline { background: var(--brand); }
.report .scope-test { background: var(--purple); }
.report .scope-inserted { background: var(--amber); }
.report .scope-outside { background: var(--ink-3); }
.report .scope-open {
    background: repeating-linear-gradient(135deg, var(--fill-2) 0 4px, var(--stroke) 4px 6px);
}

/* Two charts side by side, stacking on narrow screens */
.report .chart-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: .75rem 1.25rem;
    margin: .9rem 0 .4rem;
}

.report .chart {
    margin: 0;
}

.report .chart figcaption {
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: .35rem;
}

/* Horizontal bars with label and value */
.report .hbars {
    display: grid;
    gap: .3rem;
    margin: .4rem 0 1rem;
}

.report .hbar-row {
    display: grid;
    grid-template-columns: minmax(6rem, 16rem) minmax(0, 1fr) minmax(4.5rem, auto);
    gap: .7rem;
    align-items: center;
    font-size: .86rem;
}

.report .hbar-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report .hbar-track {
    display: block;
    height: .7rem;
}

.report .hbar-fill {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: 0 4px 4px 0;
}

.report .hbar-row:hover .hbar-fill { filter: brightness(1.12); }

.report .hbar-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.report .hbar-total {
    border-top: 1px solid var(--stroke);
    padding-top: .3rem;
    font-weight: 600;
}

/* One bar split into parts */
.report .stack {
    margin: .6rem 0 1rem;
}

.report .stack-bar {
    display: flex;
    gap: 2px;
    height: 1rem;
    border-radius: 4px;
    overflow: hidden;
    background: var(--fill);
}

.report .stack-seg {
    display: block;
    min-width: 3px;
}

.report .stack-seg:hover { filter: brightness(1.12); }

.report .stack-legend {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1.1rem;
    font-size: .8rem;
    color: var(--ink-2);
}

.report .stack-legend li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.report .stack-legend b {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* Hours per day of one person */
/* Capped in width, so the chart stays flat on a wide screen — it scales with its text. */
.report .daybars {
    width: 100%;
    max-width: 56rem;
    height: auto;
    overflow: visible;
    margin: .3rem 0 0;
    display: block;
}

.report .daybars-base { stroke: var(--stroke); stroke-width: 1; }
.report .daybars-ref { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 3; }

.report .daybars-axis {
    font-size: 9px;
    fill: var(--ink-3);
    font-family: var(--font);
}

.report .daybar-hit { fill: transparent; }
.report .daybar-fill { fill: var(--brand); }
.report .daybar.off .daybar-fill { fill: var(--ink-3); }
.report .daybar.absent .daybar-fill { fill: var(--purple); }
.report .daybar:hover .daybar-fill { filter: brightness(1.15); }
.report .daybar.off .daybar-hit { fill: var(--fill); }

.report .daybar-stub {
    fill: none;
    stroke-width: 1.2;
}

.report .daybar.gap .daybar-stub { stroke: var(--ink-3); stroke-dasharray: 2 2; }
.report .daybar.absent .daybar-stub { stroke: var(--purple); fill: var(--purple-soft); }

.report .daybar-key-booked { background: var(--brand); }
.report .daybar-key-quota { background: transparent; border-top: 1.5px dashed var(--ink-2); height: 0; }
.report .daybar-key-gap { background: transparent; border: 1.2px dashed var(--ink-3); }
.report .daybar-key-absent { background: var(--purple-soft); border: 1.2px solid var(--purple); }

/* Time distribution per person in the table */
.report .timebar-col {
    width: 9rem;
    min-width: 7rem;
}

.report .timebar {
    position: relative;
    display: flex;
    gap: 2px;
    height: .65rem;
}

.report .timebar-cap {
    position: absolute;
    inset: -2px auto -2px 0;
    border: 1px dashed var(--stroke-2);
    border-radius: 3px;
}

.report .timebar-fill {
    position: relative;
    display: block;
    height: 100%;
}

.report .timebar-fill:last-child { border-radius: 0 3px 3px 0; }

/* Small bar inside a table cell */
.report .cellbar {
    display: inline-block;
    width: 3.5rem;
    height: .45rem;
    margin-right: .45rem;
    vertical-align: middle;
    background: var(--fill);
    border-radius: 3px;
    overflow: hidden;
}

.report .cellbar-fill {
    display: block;
    height: 100%;
    background: var(--brand);
}
