/* ERIS – Finanzdaten (GuV + Bilanz) Web-Apps, gemeinsames Stylesheet (CSP-strict).
   esc()/erisBack()/erisOpenProfil() aus eris-core.js; Inline-Styles via data-style (CSSOM). */
:root{--hinweis:#8a3a75;--hinweis-tint:#f4ebf2;
  --bg:#f2ede4; --surface:#fff; --blue:#1a5296; --blue2:#0091c8; --blue3:#50a5d2;
  --green:#3d6e1a; --amber:#9e6b00; --neg:#c70d2d; --red:#c70d2d; --text:#28231c; --text-muted:#6e675e;
  --line:#e3ddd2;
  --font-serif:'Lora',Georgia,serif; --font-sans:'Source Sans 3',system-ui,sans-serif;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);font-family:var(--font-sans);color:var(--text)}

.topbar{display:flex;align-items:center;gap:14px;background:var(--surface);color:var(--text);
  border-bottom:1px solid var(--line);padding:0 18px;height:50px;position:sticky;top:0;z-index:20}
.back-link{display:inline-flex;align-items:center;gap:6px;color:var(--text-muted);text-decoration:none}
.back-link:hover{color:var(--blue)}
.topbar-sep{width:1px; background:var(--line)}
.topbar-title{font-family:var(--font-serif); font-weight:600}
.topbar-right{margin-left:auto;display:flex;align-items:center}

.main{max-width:min(94vw,var(--report-max,1320px));margin:0 auto;padding:18px}
.meta{color:var(--text-muted);font-size:13px;margin-bottom:14px}
.meta b{color:var(--text)}

.card{background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:16px 18px;margin-bottom:16px;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.ct{font-family:var(--font-serif);font-size:16px;font-weight:600;color:var(--blue);margin-bottom:12px}
.ct-sub{display:block;font-family:var(--font-sans);font-size:12px;font-weight:400;color:var(--text-muted);margin-top:2px}
.hint{color:var(--text-muted);font-size:12px;margin-top:10px;font-style:italic}
.grid2{display:grid;grid-template-columns:1.5fr 1fr;gap:16px}
@media(max-width:900px){.grid2{grid-template-columns:1fr}}

/* KPI-Strip */
.kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(max(150px,calc((100% - 60px)/6)),1fr));gap:12px;margin-bottom:16px}
@media(max-width:1100px){.kpis{grid-template-columns:repeat(auto-fill,minmax(max(150px,calc((100% - 24px)/3)),1fr))}}
@media(max-width:680px){.kpis{grid-template-columns:repeat(auto-fill,minmax(max(150px,calc((100% - 12px)/2)),1fr))}}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:12px 14px;position:relative}
.kpi .v{font-size:23px;font-weight:700;color:var(--blue);line-height:1.15}
.kpi .v.neg{color:var(--neg)}
.kpi .l{font-size:12px;color:var(--text-muted);margin-top:4px}
.kpi .s{font-size:11px;color:var(--text-muted);margin-top:2px}
.kpi .s .up{color:var(--green)} .kpi .s .down{color:var(--neg)}

/* Charts */
.chart-h{position:relative;height:300px}
.chart-h.sm{height:230px}
.chart-h.donut{height:260px}

/* Toggle-Segmente */
.seg{display:inline-flex;gap:4px}
.seg button{border:1px solid var(--line);background:var(--t-flaeche,#fff);color:var(--text);border-radius:6px;
  padding:4px 10px;font-size:12px;cursor:pointer;font-family:inherit}
.seg button.on{background:var(--blue-flaeche,var(--blue));color:#fff;border-color:var(--blue)}
.ct-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}

/* Kompositions-Legende (Anteilstabelle) */
.komp-leg{margin-top:12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(max(200px,calc((100% - 20px)/2)),1fr));gap:4px 20px}
@media(max-width:640px){.komp-leg{grid-template-columns:1fr}}
.komp-row{display:flex;align-items:center;gap:8px;font-size:12px;padding:2px 0}
.komp-sw{width:11px;height:11px;border-radius:3px;flex:none}
.komp-lbl{flex:1;color:var(--text)}
.komp-val{color:var(--text-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.komp-val b{color:var(--text)}

/* Statement-Tabelle (Kontenbaum × Jahre) */
.stmt-wrap{overflow-x:auto}
table.stmt{border-collapse:collapse;font-size:12px;min-width:100%}
table.stmt th,table.stmt td{padding:4px 8px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap;font-variant-numeric:tabular-nums}
table.stmt th:first-child,table.stmt td:first-child{text-align:left;position:sticky;left:0;background:var(--surface);z-index:1;min-width:280px;white-space:normal}
table.stmt thead th{color:var(--text-muted);font-weight:600;font-size:11px;border-bottom:2px solid var(--line);background:var(--surface);position:sticky;top:0}
table.stmt thead th:first-child{z-index:2}
table.stmt td.neg{color:var(--neg)}
table.stmt th.chg,table.stmt td.chg{border-left:2px solid var(--line);font-weight:600}
table.stmt td.chg-up{color:var(--green)}
table.stmt td.chg-down{color:var(--neg)}
table.stmt tr.e0>td:first-child{font-weight:600}
table.stmt tr.e1>td:first-child{padding-left:26px}
table.stmt tr.e2>td:first-child{padding-left:44px;color:var(--text-muted)}
table.stmt tr.e3>td:first-child{padding-left:62px;color:var(--text-muted)}
/* DIE SUMMENZEILE TRUG EINEN FESTEN HELLWERT. Im Dunkelmodus gemessen:
   132 Zellen mit Text, Kontrast 1,12 : 1 - heller Balken mit heller Schrift,
   also unlesbar, und zwar ausgerechnet in den Zeilen, auf die man schaut.
   --t-neutral-bg traegt im Hellen denselben Ton und im Dunkeln den der
   Karte. Betroffen waren bilanz, guv und jede Seite auf finanz.css. */
table.stmt tr.r-summe td{font-weight:700;background:var(--t-neutral-bg,#f6f3ec);border-top:1px solid var(--line)}
table.stmt tr.r-summe.top td{border-top:2px solid var(--line)}
table.stmt tr.r-ergebnis td{font-weight:700;color:var(--blue)}
table.stmt tr.r-header>td:first-child{font-weight:700;color:var(--blue);background:var(--t-blau-bg,#eef2f7)}
table.stmt tr.r-header td{background:var(--t-blau-bg,#eef2f7)}
table.stmt tr.r-verwendung>td:first-child{color:var(--text-muted);font-style:italic}
