/* Reporting-Plattform · eCrome Group AG · VERTRAULICH
   Farben der Marke kommen aus /brand/brand.css (branding/brand.json); Diagrammfarben sind markenneutral und farbfehlsichtig geprüft. */
:root {
  --brand: #E30613; --brand-dark: #b8050f; --brand-soft: #fdecec;
  /* gleiche Namen wie in der Bewirtschaftungs-App (deren branding/brand.css greift unverändert) */
  --red: var(--brand); --red-dark: var(--brand-dark); --red-soft: var(--brand-soft);
  --ink: #2f2f33; --ink-2: #55565b; --muted: #8a8b90; --bg: #f6f6f7; --side: #ffffff; --logo-grey: #8d8e92;
  --surface: #ffffff; --surface-2: #fafafa; --line: #e6e6e8; --line-2: #f0f0f2;
  --good: #0a7f0a; --good-bg: #e8f5e8; --bad: #c22f2f; --bad-bg: #fbeaea; --warn: #9a6400; --warn-bg: #fff4dc;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; --font-head: var(--font);
  /* Diagramm: aktuelle Periode / Vorjahr (gleicher Farbton, heller) / weitere Reihen */
  --s1: #2a78d6; --s1-soft: #9ec5f4; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --grid: #ececee; --axis: #8a8b90;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,20,30,.05), 0 1px 8px rgba(20,20,30,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --ink: #f1f1f2; --ink-2: #c6c6ca; --muted: #9a9aa0; --bg: #141416; --side: #1b1b1e; --surface: #1f1f23; --surface-2: #26262b;
    --line: #34343a; --line-2: #2b2b30; --good: #4cc24c; --good-bg: #183218; --bad: #ef7676; --bad-bg: #3a1a1a; --warn: #f0b43c; --warn-bg: #3a2c10;
    --brand-soft: #3a1416; --red-soft: #3a1416; --s1: #3987e5; --s1-soft: #1c5cab; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --grid: #2e2e33; --axis: #9a9aa0; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-headings, var(--font-head)); line-height: 1.2; margin: 0; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 235px, var(--line) 235px, var(--line) 236px, transparent 236px); }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: baseline; gap: 1px; text-decoration: none; padding: 2px 10px 4px; }
.logo img { display: block; max-width: 200px; object-fit: contain; }
.side .product { padding: 0 10px 14px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--brand); }
.wordmark sup { font-size: 9px; font-weight: 600; }
.wordmark-add { font-weight: 600; font-size: 13px; color: var(--logo-grey); margin-left: 3px; }
.instance { font-size: 12px; color: var(--muted); padding: 0 8px; margin-top: -10px; }
.nav { display: flex; flex-direction: column; gap: 0; }
.nav a { text-decoration: none; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 1px 0; border-left: 3px solid transparent; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a.on, .nav a.active { background: var(--red-soft); color: var(--red-dark); border-left-color: var(--red); }
@media (prefers-color-scheme: dark) { .nav a.on, .nav a.active { color: #fff; } }
.nav svg { width: 17px; height: 17px; flex: none; }
.nav .sep { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 4px; height: auto; background: none; margin: 0; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 12px 10px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.side-foot button { background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; text-align: left; text-decoration: underline; }
.main:focus { outline: none; }
.main { min-width: 0; padding: 22px 28px 40px; }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 18px; }
.top .title { flex: 1 1 260px; }
.top .title p { margin: 4px 0 0; color: var(--muted); }
.conf { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--brand); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
input[type=date], input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 9px; min-height: 34px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--s1); outline-offset: 1px; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 14px; min-height: 34px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.ok { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 10px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--surface); }

/* Karten und Raster */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card > header .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.section { margin-top: 22px; }
.section > h3 { margin: 0 0 10px; }
.kpi .label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .cmp { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.delta { font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 999px; display: inline-flex; gap: 3px; align-items: center; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--ink-2); background: var(--line-2); }
.info { border: 0; background: none; padding: 0 2px; cursor: help; color: var(--muted); font-size: 12px; line-height: 1; }
.info:hover { color: var(--ink); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.good { background: var(--good-bg); color: var(--good); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.alert { padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); margin-bottom: 14px; }
.alert.ok { background: var(--good-bg); color: var(--good); }
.alert.err { background: var(--bad-bg); color: var(--bad); }

/* Tabellen */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th .arr { font-size: 10px; margin-left: 3px; color: var(--muted); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl tr.click { cursor: pointer; }
.tbl td.bar { min-width: 120px; }
.minibar { height: 8px; border-radius: 4px; background: var(--s1); min-width: 2px; }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line); border-bottom: 0; }

/* Diagramme */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .mark, .chart .mark.hover { opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; vertical-align: 3px; width: 14px; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--surface); padding: 7px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; max-width: 280px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.tip b { font-weight: 650; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* Lieferanten-Dossier */
.dossier-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; }
.dossier-head .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.progress { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; position: relative; }
.progress > span { display: block; height: 100%; background: var(--s1); border-radius: 999px; }
.progress .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.meeting { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
.meeting header { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.meeting h4 { margin: 0; font-size: 14px; }
.items { list-style: none; margin: 8px 0 0; padding: 0; }
.items li { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; border-bottom: 1px dashed var(--line-2); }
.items li:last-child { border-bottom: 0; }
.items li .txt { flex: 1; }
.items li.done .txt { text-decoration: line-through; color: var(--muted); }
.items .kind { width: 92px; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.form-grid label.wide { grid-column: 1 / -1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.inline-form input[type=text] { flex: 1 1 220px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--surface); color: var(--ink); width: min(640px, 94vw); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h2 { margin-bottom: 14px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Anmeldung – Aufbau wie die Bewirtschaftungs-App: Markenfläche links, Formular rechts */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.login-art { background: linear-gradient(145deg, #2c2c30 0%, #1c1c20 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .logo { padding: 0; }
.login-art .logo .wordmark-add { color: #b9babe; }
.login-art h1 { font-size: 34px; line-height: 1.15; max-width: 460px; font-weight: 700; color: #fff; }
.login-art p { color: #c9cacf; max-width: 440px; font-size: 15.5px; }
.login-art ul { color: #c9cacf; padding-left: 18px; max-width: 440px; }
.login-art small { color: #9a9aa0; }
.login-art .stripe { position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; border: 40px solid rgba(227, 6, 19, .85); border-color: color-mix(in srgb, var(--red) 85%, transparent); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--surface); }
.login-form .box { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 22px; margin: 18px 0 4px; }
.login-form form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.login-form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.login-form input[type=email], .login-form input[type=password], .login-form input[type=text] { width: 100%; padding: 9px 10px; }
.login-form .btn.primary { width: 100%; padding: 10px; }
.login-form .err { color: var(--bad); min-height: 18px; font-size: 13px; }
.login-form .msg { color: var(--good); font-size: 13px; }
.login-form .links { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-top: 10px; }
.login-form .links a, .login-form .links button { color: var(--red-dark); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; text-decoration: none; }
.login-form .links a:hover, .login-form .links button:hover { text-decoration: underline; }
input.code { font-size: 26px; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.sso { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.sso > span { text-align: center; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 10px; }
.sso > span::before, .sso > span::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.sso .btn { width: 100%; padding: 10px; gap: 10px; font-weight: 600; }
.sso svg { width: 18px; height: 18px; }
.demo-box { margin-top: 22px; font-size: 12.5px; background: var(--bg); border-radius: 8px; padding: 12px; color: var(--ink-2); }
.login-legal { margin-top: 22px; font-size: 11.5px; color: var(--muted); }
.login-legal .conf { display: block; margin-bottom: 2px; }

/* Konto und Abos */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain li .grow { flex: 1 1 220px; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label { flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 13px !important; color: var(--ink) !important; }
.abo { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface); }
.abo header { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.abo header h3 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); margin: 0; }
.abo .acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.abo.off { opacity: .65; }

/* Datenquellen */
.src { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start; }
.src .caps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.src .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.status-dot.ok { background: var(--good); } .status-dot.bad { background: var(--bad); } .status-dot.warn { background: var(--s4); }

.print-head, .print-foot { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; gap: 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .sep, .instance, .side .product { display: none; }
  .nav a { border-left: 0; }
  .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .main { padding: 16px; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 14mm 12mm 16mm; }
  body { background: #fff; color: #000; font-size: 11px; }
  .side, .filters, .no-print, .btn, .info { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .print-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--brand); padding-bottom: 6px; margin-bottom: 12px; font-size: 11px; }
  .print-foot { display: block; position: fixed; bottom: 0; left: 0; right: 0; text-align: center; font-size: 9px; color: #666; }
  .tbl th { position: static; }
  .cols-2, .cols-3 { grid-template-columns: 1fr 1fr; }
}
@media print { .print-only { display: block !important; } }

/* Faktenliste (Konditionen im Lieferantenzugang) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.items .vis { flex: none; }

/* Formularschutz «Passwort vergessen»: ALTCHA (selbst gehostet) und unsichtbarer Honeypot */
.login-form altcha-widget { display: block; margin: 4px 0 12px; --altcha-max-width: 100%; --altcha-border-radius: 8px; --altcha-color-border: var(--line, #e6e6e9); }
.login-form .hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Sprachwahl (wie Bewirtschaftungs-App: DE · FR · IT · RM · EN) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.side-foot .lang-switch select { width: 100%; margin: 6px 0 2px; padding: 4px 6px; font-size: 12px; border: 1px solid var(--line, #e6e6e9); border-radius: 6px; background: var(--surface, #fff); color: inherit; }
.login-form .lang-login { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.login-form .lang-login select { width: auto; padding: 4px 8px; font-size: 13px; border: 1px solid var(--line, #e6e6e9); border-radius: 6px; background: var(--surface, #fff); color: inherit; }

/* 1.0: verlinkte Kennzahlkachel (Fristenkontrolle im Cockpit), Einstellungen */
.kpi-link { color: inherit; text-decoration: none; display: block; }
.kpi-link > .card { height: 100%; transition: box-shadow .15s, border-color .15s; }
.kpi-link:hover > .card, .kpi-link:focus-visible > .card { border-color: var(--brand); box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
#settings .tbl td { vertical-align: top; }
#settings .tbl input[type=text], #settings .tbl input[type=number] { font: inherit; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; }
