/* Report layout, shared by the app and the printed PDFs. */
.rpt { --r-text: var(--text, #1d2a1d); --r-muted: var(--muted, #5f6b5f); --r-line: var(--line, #dfe5da); --r-soft: var(--soft, #f3f6ef);
  --r-accent: var(--accent, #2f6b2f); --r-neg: var(--neg, #a3341c); --r-pos: var(--pos, #2f6b2f); --r-warn: var(--warn-bg, #fff4d6);
  color: var(--r-text); font-variant-numeric: tabular-nums; }
.rpt-head { margin: 0 0 10px; }
.rpt-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.rpt-sub { margin: 2px 0 0; color: var(--r-muted); }
.rpt-unit { margin: 2px 0 0; color: var(--r-muted); font-size: 0.8rem; }
.rpt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 14px; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rpt-table th, .rpt-table td { padding: 6px 8px; border-bottom: 1px solid var(--r-line); text-align: left; vertical-align: top; }
.rpt-table thead th { font-size: 0.8rem; font-weight: 600; color: var(--r-muted); border-bottom: 2px solid var(--r-line); white-space: nowrap; }
@media (max-width: 600px) { .rpt-table { font-size: 0.85rem; } .rpt-table th, .rpt-table td { padding: 6px 5px; } .rpt-table .ind { padding-left: 12px; } }
.rpt-table .num { text-align: right; white-space: nowrap; }
.rpt-table .c { text-align: center; }
.rpt-table .note { width: 3.5em; text-align: center; color: var(--r-muted); }
.rpt-table .ind { padding-left: 22px; }
.rpt-table .ind2 { padding-left: 40px; }
.rpt-table.fa th, .rpt-table.fa td { padding-left: 5px; padding-right: 5px; }
.rpt-table.fa thead th { white-space: normal; text-align: right; vertical-align: bottom; }
.rpt-table.fa thead th.c { text-align: center; border-bottom: 1px solid var(--r-line); }
.rpt-table .sec td { background: var(--r-soft); font-weight: 700; letter-spacing: 0.02em; }
.rpt-table .grp td { font-weight: 650; padding-top: 10px; }
.rpt-table .grp-line td { font-weight: 600; }
.rpt-table .total td { font-weight: 700; border-top: 1px solid var(--r-text); }
.rpt-table .grand td { font-weight: 800; border-top: 2px solid var(--r-text); border-bottom: 3px double var(--r-text); }
.rpt-table .warn td { background: var(--r-warn); }
.rpt-table .muted, .rpt .muted { color: var(--r-muted); }
.rpt-table .sub { color: var(--r-muted); font-size: 0.8rem; margin-top: 2px; }
.rpt-table .sub.guide { font-style: italic; }
.rpt-table .strong, .rpt-table td.strong { font-weight: 700; }
.rpt-table .nowrap { white-space: nowrap; }
.rpt-table .qty { color: var(--r-muted); font-size: 0.8rem; }
.rpt-table .tag { display: inline-block; min-width: 1.6em; font-size: 0.7rem; font-weight: 700; color: var(--r-muted); }
.rpt-table .neg { color: var(--r-neg); }
.rpt-table .pos { color: var(--r-pos); }
.rpt-table tr.cancelled td { text-decoration: line-through; color: var(--r-muted); }
.rpt-table .r-name { font-weight: 600; }
.rpt-table.t-format td:nth-child(4), .rpt-table.t-format th:nth-child(4) { border-left: 2px solid var(--r-line); }
.rpt-table.t-format .inner { color: var(--r-muted); }
.rpt-table.t-format td.th { font-weight: 600; }
.rpt-table.t-format td.strong { font-weight: 700; }
.rpt a.acc, .rpt a.vno { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--r-muted); }
.rpt a.vno { white-space: nowrap; }
.rpt-notes { margin-top: 18px; }
.notes-title { font-size: 1rem; margin: 18px 0 6px; }
.rpt-note h3, .t-title { font-size: 0.95rem; margin: 14px 0 6px; }
.rpt-note .note-table { max-width: 720px; }
.rpt-foot { color: var(--r-muted); font-size: 0.8rem; margin: 4px 0 12px; }
.rpt-alert { background: var(--r-warn); padding: 8px 10px; border-radius: 6px; font-weight: 600; }
.rpt .assume { margin: 0 0 12px 1.1em; padding: 0; font-size: 0.88rem; }
.rpt .assume li { margin: 3px 0; }
/* Charts. Colours validated for colour-blind separation in both modes. */
.chart { --surface: var(--paper, #ffffff); --c-income: #2a7f5a; --c-expense: #c0841a; --c-profit: #2a7f5a; --c-context: #a3aca5; --c-cash: #2a78d6;
  --c-loss: #a3341c; --c-seq: #2f7d32; --c-other: #a3aca5;
  --s1: #2f7d32; --s2: #2a78d6; --s3: #e07b1f; --s4: #c2398a; --s5: #8c6d1f; --s6: #5e3fb5;
  margin: 0 0 22px; break-inside: avoid; min-width: 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chart { --c-income: #3a9a6a; --c-expense: #d9772a; --c-profit: #3a9a6a; --c-context: #5d6b62; --c-cash: #3987e5;
    --c-loss: #f08a72; --c-seq: #4f9f45; --c-other: #5d6b62; --s1: #4f9f45; --s2: #3987e5; --s3: #d9772a; --s4: #d55181; --s5: #b08a2c; --s6: #9085e9; }
}
body.print .chart { --surface: #ffffff; }
.chart-title { font-weight: 650; font-size: 0.95rem; margin: 0 0 8px; color: var(--text, #1d2a1d); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line, #e3ebe4); stroke-width: 1; }
.chart .base { stroke: var(--rule, #c9d6cc); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--muted, #5b6b60); }
.chart .value { font-size: 11px; font-weight: 600; fill: var(--text, #1d2a1d); }
.chart .label { font-size: 12px; fill: var(--text, #1d2a1d); }
.chart .donut-total { font-size: 22px; font-weight: 650; fill: var(--text, #1d2a1d); }
.chart .c-income { color: var(--c-income); } .chart .c-expense { color: var(--c-expense); } .chart .c-profit { color: var(--c-profit); }
.chart .c-context { color: var(--c-context); } .chart .c-cash { color: var(--c-cash); } .chart .c-loss { color: var(--c-loss); }
.chart .c-seq { color: var(--c-seq); } .chart .c-other { color: var(--c-other); }
.chart .s1 { color: var(--s1); } .chart .s2 { color: var(--s2); } .chart .s3 { color: var(--s3); } .chart .s4 { color: var(--s4); } .chart .s5 { color: var(--s5); } .chart .s6 { color: var(--s6); }
.chart svg path, .chart svg rect, .chart svg circle { fill: currentColor; }
.chart svg .slice { stroke: var(--surface); stroke-width: 2px; }
.chart svg circle[stroke-width] { fill: none; stroke: currentColor; }
.chart svg .line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart svg .area { stroke: none; opacity: 0.1; }
.chart svg .dot { stroke: var(--surface); stroke-width: 2; }
.chart svg .hit { fill: transparent; }
.chart [data-tip] { cursor: default; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.82rem; color: var(--muted, #5b6b60); margin-top: 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: currentColor; flex: none; margin-right: 6px; vertical-align: -1px; }
.chart-note { font-size: 0.8rem; color: var(--muted, #5b6b60); margin: 4px 0 0; }
.chart-empty { color: var(--muted, #5b6b60); }
.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.donut-wrap .donut { width: 190px; flex: none; }
.chart-table { flex: 1 1 240px; border-collapse: collapse; font-size: 0.86rem; }
.chart-table td { padding: 4px 4px; border-bottom: 1px solid var(--line, #e3ebe4); color: var(--text, #1d2a1d); }
.chart-table td.num { text-align: right; white-space: nowrap; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 36px; }
@media (min-width: 1100px) { .chart-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
body.print .chart-grid { grid-template-columns: 1fr 1fr; gap: 0 24px; }
body.print .chart svg { max-height: 62mm; }
body.print .donut-wrap .donut { width: 38mm; }
.hbars { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; gap: 4px 12px; align-items: center; }
.hbars .hb-row { display: contents; }
.hbars .hb-label { font-size: 0.85rem; color: var(--text, #1d2a1d); line-height: 1.25; }
.hbars.pairs .hb-row .hb-label { grid-row: span 2; }
.hbars.pairs { row-gap: 2px; }
.hbars .hb { width: 100%; height: 16px; display: block; overflow: visible; }
.hbars.pairs .hb + .hb { margin-bottom: 8px; }
.hbars .hb .value { font-size: 11px; }
@media (max-width: 700px) {
  .chart .axis, .chart svg:not(.hb) .value { font-size: 19px; }
  .chart .label { font-size: 20px; }
  .hbars { grid-template-columns: minmax(80px, 38%) 1fr; }
}
body.print .hbars .hb-label { font-size: 8pt; }
.chart-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink, #1c2a22); color: var(--paper, #fff); padding: 6px 10px; border-radius: 8px; font-size: 0.85rem; box-shadow: var(--shadow); max-width: 260px; }
.voucher .v-ref, .voucher .narr { margin: 4px 0; }
.voucher .words { font-style: italic; margin: 6px 0; }
.voucher .signs { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; }
.voucher .signs div { flex: 1; border-top: 1px solid var(--r-text); padding-top: 4px; text-align: center; font-size: 0.8rem; color: var(--r-muted); }

/* Printed documents */
body.print { margin: 0; font-family: "Noto Sans", "DejaVu Sans", "Liberation Sans", Arial, sans-serif; font-size: 9.5pt; color: #1d2a1d;
  --text: #1d2a1d; --muted: #5f6b5f; --line: #d5dccf; --soft: #eef3e8; --accent: #2f6b2f; --neg: #a3341c; --pos: #2f6b2f; --warn-bg: #fff4d6;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body.print .rpt-scroll { overflow: visible; }
body.print .rpt-table { font-size: 8.6pt; }
body.print .rpt-table th, body.print .rpt-table td { padding: 3.5px 6px; }
body.print .rpt-table tr { break-inside: avoid; }
body.print .rpt-table.fa { font-size: 7.2pt; }
.rpt-table tr.memo td { font-style: italic; color: var(--r-muted); }
body.print .rpt-table thead { display: table-header-group; }
body.print .rpt a.acc, body.print .rpt a.vno { border: 0; }
body.print .rpt-head h2 { font-size: 14pt; color: #1f4d1f; }
body.print .rpt-note { break-inside: avoid-page; }
body.print .rpt-notes { break-before: auto; }
body.print .section-break { break-before: page; }
.letterhead { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #2f6b2f; padding-bottom: 8px; margin-bottom: 14px; }
.letterhead .lh-logo { height: 42px; width: auto; }
.letterhead .lh-name { font-size: 13pt; font-weight: 700; color: #1f4d1f; }
.letterhead .lh-addr { font-size: 8pt; color: #5f6b5f; }
.cover { break-after: page; text-align: center; padding-top: 30mm; min-height: 240mm; position: relative; }
.cover .cover-logo { height: 70px; width: auto; display: block; margin: 0 auto 10px; }
.cover .cover-logo.kn { height: 52px; margin-bottom: 26px; }
.cover h1 { font-size: 24pt; margin: 6px 0 2px; color: #1f4d1f; }
.cover .cover-addr { color: #5f6b5f; margin: 0 0 40px; }
.cover .cover-title { font-size: 18pt; font-weight: 700; margin-top: 20mm; }
.cover .cover-sub { font-size: 12pt; color: #5f6b5f; margin-top: 4px; }
.cover .contents { text-align: left; display: inline-block; margin: 18mm auto 0; font-size: 10.5pt; line-height: 1.7; }
.cover .cover-foot { position: absolute; bottom: 0; left: 0; right: 0; color: #888; font-size: 8pt; }
footer.sign { margin-top: 28px; display: flex; justify-content: flex-end; break-inside: avoid; }
footer.sign div { display: flex; flex-direction: column; align-items: center; gap: 36px; font-size: 9pt; }
footer.sign .sign-line { border-top: 1px solid #1d2a1d; padding-top: 3px; min-width: 200px; text-align: center; }
