/* Look aller Seiten (Jens 21.10.2026), geladen von views/layout.php.
   Hellgrauer Grund, weisse Flaechen, feste Leiste oben, Menue links. Farben als Variablen,
   damit eine Aenderung nur hier passiert. Farben fuer Veraenderungen: app.css (ofri-ton-*). */
body.lk {
  --lk-grund: #f3f5f8;
  --lk-flaeche: #ffffff;
  --lk-linie: #e2e6ec;
  --lk-tinte: #172030;
  --lk-leise: #5a6577;        /* 5.6:1 auf Weiss */
  --lk-akzent: #0d6efd;       /* Bootstrap-Blau, passt zu den Knoepfen */
  --lk-akzent-hell: #e8f0fe;
  --lk-top: 56px;
  --lk-seite: 248px;
  --bs-body-bg: var(--lk-grund);
  --bs-body-color: var(--lk-tinte);
  --bs-border-color: var(--lk-linie);
  --bs-secondary-color: var(--lk-leise);
  background: var(--lk-grund);
  color: var(--lk-tinte);
  font-size: .9375rem;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Leiste oben ---------- */
.lk-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1040; height: var(--lk-top);
  display: flex; align-items: center; gap: 1rem; padding: 0 1rem 0 1.25rem;
  background: var(--lk-flaeche); border-bottom: 1px solid var(--lk-linie);
}
.lk-marke { white-space: nowrap; display: flex; align-items: center; gap: .6rem; font-weight: 650; color: var(--lk-tinte); text-decoration: none; letter-spacing: -.01em; }
.lk-logo {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--lk-akzent); color: #fff; font-weight: 700; font-size: .9rem;
}
.lk-top-rechts { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

/* ---------- Suche oben ---------- */
/* Ab lg ist die Marke so breit wie das Menue, damit die Suche buendig mit dem Inhalt beginnt */
.lk-suche { position: relative; flex: 0 1 26rem; }
@media (min-width: 992px) {
  .lk-marke { min-width: calc(var(--lk-seite) - 2.25rem); }
  .lk-suche { margin-left: 1rem; }
}
.lk-suche input {
  width: 100%; height: 36px; padding: 0 2.2rem 0 2.1rem; border: 1px solid var(--lk-linie); border-radius: 8px;
  background: var(--lk-grund); color: var(--lk-tinte); font-size: .875rem;
}
.lk-suche input::placeholder { color: var(--lk-leise); }
.lk-suche input:hover { border-color: #c9d0da; }
.lk-suche input:focus { outline: none; background: var(--lk-flaeche); border-color: var(--lk-akzent); box-shadow: 0 0 0 3px var(--lk-akzent-hell); }
.lk-suche input::-webkit-search-cancel-button { display: none; }
.lk-suche-lupe { position: absolute; left: .7rem; top: 10px; width: 16px; height: 16px; color: var(--lk-leise); pointer-events: none; }
.lk-suche-taste {
  position: absolute; right: .55rem; top: 8px; padding: 0 .35rem; font-size: .7rem; line-height: 20px;
  color: var(--lk-leise); background: var(--lk-flaeche); border: 1px solid var(--lk-linie); border-radius: 4px; pointer-events: none;
}
.lk-suche input:focus ~ .lk-suche-taste { display: none; }
.lk-suche-liste {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 70vh; overflow-y: auto; padding: .35rem;
  background: var(--lk-flaeche); border: 1px solid var(--lk-linie); border-radius: 10px;
  box-shadow: 0 12px 32px -12px rgba(23, 32, 48, .3);
}
.lk-suche-abschnitt { padding: .5rem .6rem .2rem; font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--lk-leise); }
.lk-suche-treffer {
  display: flex; align-items: baseline; gap: .6rem; padding: .4rem .6rem; border-radius: 7px;
  color: var(--lk-tinte); text-decoration: none; font-size: .875rem;
}
.lk-suche-treffer:hover, .lk-suche-treffer.an { background: var(--lk-akzent-hell); color: var(--lk-tinte); }
.lk-suche-treffer mark { padding: 0; background: none; color: inherit; font-weight: 650; }
.lk-suche-extra { margin-left: auto; font-size: .75rem; color: var(--lk-leise); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lk-suche-leer { padding: .6rem; font-size: .875rem; color: var(--lk-leise); }
.lk-warnung {
  white-space: nowrap; font-size: .8125rem; font-weight: 600; text-decoration: none; color: #7a4a00;
  background: #fff4d6; border: 1px solid #f2d27a; border-radius: 999px; padding: .2rem .7rem;
}
.lk-warnung:hover { background: #ffecb3; color: #5c3700; }
.lk-daten {
  align-items: center; gap: .4rem; white-space: nowrap; font-size: .8125rem; color: var(--lk-leise);
  text-decoration: none; padding: .2rem .6rem; border-radius: 999px;
}
.lk-daten:hover { background: var(--lk-grund); color: var(--lk-tinte); }
.lk-daten-punkt { width: 7px; height: 7px; border-radius: 50%; background: var(--ofri-plus); }
.lk-daten-punkt.lk-daten-alt { background: #e0a400; }
.lk-icon, .lk-menueknopf {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px;
  color: var(--lk-leise); background: none; border: 0;
}
.lk-icon svg, .lk-menueknopf svg { width: 19px; height: 19px; }
.lk-icon:hover, .lk-menueknopf:hover { background: var(--lk-grund); color: var(--lk-tinte); }
.lk-icon-an { color: var(--lk-akzent); background: var(--lk-akzent-hell); }
.lk-konto {
  display: flex; align-items: center; gap: .5rem; border: 0; background: none;
  padding: .25rem .5rem; border-radius: 8px; color: var(--lk-tinte); font-size: .875rem;
}
.lk-konto:hover { background: var(--lk-grund); }
.lk-konto-an { background: var(--lk-akzent-hell); }
.lk-avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--lk-akzent-hell); color: var(--lk-akzent); font-weight: 700; font-size: .8rem;
}
.lk :focus-visible { outline: 2px solid var(--lk-akzent); outline-offset: 2px; }

/* ---------- Menue links ---------- */
.lk-seite { background: var(--lk-flaeche); }
@media (min-width: 992px) {
  .lk-seite {
    position: fixed; top: var(--lk-top); bottom: 0; left: 0; width: var(--lk-seite);
    border-right: 1px solid var(--lk-linie); overflow-y: auto; z-index: 1030;
  }
}
.lk-seite-innen { padding: .9rem .75rem 4rem; display: flex; flex-direction: column; gap: 1px; }
.lk-gruppe, .lk-gruppe-kopf {
  display: flex; align-items: center; gap: .55rem; margin: 1rem 0 .2rem; padding: .2rem .6rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--lk-leise);
}
.lk-gruppe { width: 100%; border: 0; background: none; border-radius: 7px; text-align: left; }
.lk-gruppe:hover { background: var(--lk-grund); color: var(--lk-tinte); }
.lk-pfeil { width: 14px; height: 14px; margin-left: auto; flex: none; transition: transform .15s; }
.lk-gruppe[aria-expanded="false"] .lk-pfeil { transform: rotate(-90deg); }
.lk-gruppe[aria-expanded="false"] + .lk-gruppe-inhalt { display: none; }
.lk-gruppe-inhalt, .lk-zuletzt-liste { display: flex; flex-direction: column; gap: 1px; }
@media (prefers-reduced-motion: reduce) { .lk-pfeil { transition: none; } }
.lk-sym { width: 16px; height: 16px; flex: none; }
.lk-link {
  display: flex; align-items: center; gap: .55rem; padding: .38rem .6rem; border-radius: 7px;
  color: var(--lk-tinte); text-decoration: none; font-size: .875rem; line-height: 1.3;
}
.lk-link.lk-unter { padding-left: 2.25rem; }      /* buendig unter dem Gruppentext */
.lk-link:hover { background: var(--lk-grund); color: var(--lk-tinte); }
.lk-link.active { background: var(--lk-akzent-hell); color: var(--lk-akzent); font-weight: 600; }
.lk-zahl { margin-left: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: #d63a2f; color: #fff; font-size: .72rem; font-weight: 700; text-align: center; }
.lk-stand { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.lk-zahl + .lk-stand { margin-left: .4rem; }
.lk-stand-gruen { background: #2f9e62; }
.lk-stand-orange { background: #e8890c; }

/* ---------- Inhalt ---------- */
.lk-inhalt { padding: calc(var(--lk-top) + 1.75rem) 1rem 4rem; }
@media (min-width: 576px) { .lk-inhalt { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 992px) { .lk-inhalt { margin-left: var(--lk-seite); padding-left: 2rem; padding-right: 2rem; } }
.lk-ohne-menue .lk-inhalt { margin-left: 0; }
/* Seitentitel ueberall gleich, egal ob die View h3, h4 oder h5 gesetzt hat */
.lk-inhalt h1.h3, .lk-inhalt h1.h4, .lk-inhalt h1.h5 { font-size: 1.5rem; font-weight: 650; letter-spacing: -.015em; }
.lk-inhalt > * { max-width: 1480px; }

.lk-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.25rem; }
.lk-kopf h1 { font-size: 1.5rem; font-weight: 650; letter-spacing: -.015em; margin: 0 0 .2rem; }
.lk-kopf p { margin: 0; color: var(--lk-leise); font-size: .875rem; }
.lk-abschnitt { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin: 2rem 0 .75rem; }
.lk-abschnitt h2 { font-size: 1.0625rem; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.lk-abschnitt .lk-sub { color: var(--lk-leise); font-size: .8125rem; }

.lk .card {
  --bs-card-border-color: var(--lk-linie);
  --bs-card-border-radius: 12px;
  --bs-card-inner-border-radius: 11px;
  background: var(--lk-flaeche);
  box-shadow: 0 1px 2px rgba(23, 32, 48, .04);
}
.lk a.card:hover, .lk .dash-card:hover { border-color: #c5cfdd; box-shadow: 0 4px 14px rgba(23, 32, 48, .07); }

/* Kennzahl-Kacheln: Etikett, grosse Zahl, eine Zeile Zusammenhang */
.lk-kz { height: 100%; padding: 1rem 1.15rem; }
.lk-kz-etikett { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--lk-leise); }
.lk-kz-zahl { font-size: 1.9rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; margin: .3rem 0 .25rem; font-variant-numeric: tabular-nums; }
.lk-kz-zeile { font-size: .8125rem; color: var(--lk-leise); }
.lk-kz-ziel { height: 4px; border-radius: 2px; background: var(--lk-grund); margin-top: .6rem; overflow: hidden; }
.lk-kz-ziel > span { display: block; height: 100%; border-radius: 2px; }
.lk-spark { position: relative; height: 28px; margin-top: .6rem; }
.lk-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lk-spark polygon { fill: var(--lk-akzent-hell); }
.lk-spark polyline { fill: none; stroke: var(--lk-akzent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.lk-spark-ende {
  position: absolute; right: -4px; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: var(--lk-akzent); box-shadow: 0 0 0 2px var(--lk-flaeche);
}
/* Balken zum Ziel in der Farbe der Skala (app.css) */
.lk-ziel-plus   { background: var(--ofri-plus); }
.lk-ziel-mittel { background: #e0a400; }
.lk-ziel-minus  { background: var(--ofri-minus); }
.lk-ziel-null   { background: var(--ofri-aus); }

/* Tabellen: leise Kopfzeile, viel Luft */
.lk .table { --bs-table-bg: transparent; --bs-table-hover-bg: #f6f8fb; margin-bottom: 0; }
.lk .table > thead th {
  font-size: .75rem; font-weight: 600; color: var(--lk-leise); border-bottom-color: var(--lk-linie);
  padding-top: .35rem; padding-bottom: .45rem; white-space: nowrap;
}
.lk .table > tbody td { border-color: #eef1f5; padding-top: .45rem; padding-bottom: .45rem; }
.lk .table > tbody tr:last-child td { border-bottom: 0; }
.lk .table a { text-decoration: none; }
.lk .table a:hover { text-decoration: underline; }

/* Umschalter als Segment */
.lk-segment { display: inline-flex; padding: 3px; gap: 2px; background: #e9edf2; border-radius: 9px; }
.lk-segment .btn { border: 0; border-radius: 7px; padding: .25rem .7rem; font-size: .8125rem; font-weight: 500; color: var(--lk-leise); background: none; }
.lk-segment .btn[aria-pressed="true"] { background: var(--lk-flaeche); color: var(--lk-tinte); box-shadow: 0 1px 2px rgba(23, 32, 48, .12); }
.lk-segment .btn:hover:not([aria-pressed="true"]) { color: var(--lk-tinte); }

/* Pillen in den Gruppen-Karten etwas leiser */
.lk .badge.bg-body-tertiary { background: var(--lk-grund) !important; border-color: var(--lk-linie) !important; font-weight: 500; }

/* Erklaerblock: ruhiger, ohne blauen Rahmen */
.lk [data-hilfe] { --bs-card-border-color: var(--lk-linie); }

/* „Was steht an?“ als kompakte Kacheln */
.lk .dash-num { font-size: 1.75rem; letter-spacing: -.02em; }
.lk .toast-container { top: calc(var(--lk-top) + .75rem); }

/* ---------- Tabellenkopf unter der Leiste ----------
   Die Kopie baut app.js, sobald der echte Kopf hinausgescrollt ist. kw_inbox klebt selbst
   (ki-scroll) und braucht nur den Abstand zur Leiste. */
.lk-kopf-klon {
  position: fixed; z-index: 1030; overflow: hidden; background: var(--lk-grund);
  box-shadow: 0 1px 0 var(--lk-linie), 0 6px 10px -8px rgba(23, 32, 48, .35);
}
.lk-kopf-klon.lk-kopf-klon-karte { background: var(--lk-flaeche); }
.lk-kopf-klon table { margin: 0; table-layout: fixed; }
.lk .ki-scroll thead th { top: var(--lk-top); }

/* ---------- Keyword-Fenster (app.js, Klick auf data-kw-id) ---------- */
.lk-kw-fenster { --bs-offcanvas-width: 460px; }
.lk-kw-kz { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.lk-kw-kz > div { padding: .6rem .75rem; border: 1px solid var(--lk-linie); border-radius: 8px; }
.lk-kw-zahl { font-size: 1.4rem; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lk-kw-svg { display: block; width: 100%; height: auto; font-size: 10px; font-variant-numeric: tabular-nums; }
.lk-kw-gitter { stroke: var(--lk-linie); }
.lk-kw-seite1 { stroke: var(--lk-leise); stroke-dasharray: 4 3; }
.lk-kw-achse { fill: var(--lk-leise); }
.lk-kw-linie { fill: none; stroke: var(--lk-akzent); stroke-width: 2; stroke-linejoin: round; }
.lk-kw-punkt { fill: var(--lk-akzent); stroke: var(--lk-flaeche); stroke-width: 2; }
.lk-kw-balken { fill: #d9730d; }
.lk-kw-kreuz { stroke: var(--lk-tinte); stroke-width: 1; opacity: .35; }
.lk-kw-tip { min-height: 1.5em; font-variant-numeric: tabular-nums; }
[data-kw-id] { cursor: pointer; }
