/* Portal. Desktop: feste Seitenleiste. Schmal: Kopfband oben, Tab-Leiste unten.
   Abstände folgen dem 8-px-Raster aus base.css. Zwischen Blöcken trägt allein `gap`. */

/* ---- Rahmen ------------------------------------------------------------------ */

.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }

.side {
  position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s3);
  padding: var(--s3) var(--s2); background: var(--brand); color: #fff;
}
.side-logo { font-size: 19px; padding: 4px 4px 0; }
.side-logo img { width: 26px; height: 26px; }

.side-tenant { display: grid; gap: 6px; padding: 0 4px; }
.side-tenant label, .side-label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--leaf); }
.side-tenant select {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #5d8f77; border-radius: var(--r-sm);
  background: var(--brand-deep); color: #fff; font-size: 15px;
}
.side-tenant-name { font-size: 16px; font-weight: 600; line-height: 24px; overflow-wrap: anywhere; }

.side-nav ul { display: grid; gap: 2px; font-size: 15px; font-weight: 500; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  border-radius: var(--r-sm); color: var(--on-brand); text-decoration: none;
}
.side-nav a:hover { background: var(--brand-2); color: #fff; }
.side-nav a[aria-current="page"] { background: var(--brand-2); color: #fff; }
.side-nav svg { display: none; flex-shrink: 0; }
.nav-label { flex: 1 1 auto; min-width: 0; }
.lbl-short { display: none; }
.nav-badge { padding: 0 8px; border-radius: 999px; background: var(--leaf); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 20px; }

/* Adminportal: Gruppen statt flacher Liste (nur Desktop) */
.side-nav-flat, .side-tenant { display: none; }
.side-groups { display: grid; gap: var(--s3); }
.side-groups nav > .side-label { padding: 0 4px; margin-bottom: 4px; }
.side-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; }
.side-label-row .side-label { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 4px; text-decoration: none; }
.side-label-row .side-label:hover { color: #fff; }
.box-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s2); margin-bottom: var(--s2); }
.box-head-row .box-title { margin-bottom: 0; }
.save-area { display: grid; gap: var(--s2); margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line-soft); }
.save-area > * { margin: 0; }
.save-area .stack-btns { margin: 0; }
.save-area > :empty { display: none; }
.save-area .hint { margin: -8px 0 0; }
.nav-count { margin-left: auto; font-size: 12px; color: var(--leaf); }
.side-list { display: grid; gap: 2px; font-size: 15px; font-weight: 500; }
.side-list a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--on-brand); text-decoration: none; }
.side-list a:hover, .side-list a[aria-current="page"] { background: var(--brand-2); color: #fff; }
.side-tg { border-radius: var(--r-sm); }
.side-tg + .side-tg { margin-top: 2px; }
.side-tg summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); cursor: pointer; list-style: none; font-weight: 600; font-size: 15px; }
.side-tg summary::-webkit-details-marker { display: none; }
.side-tg summary::after { content: "▾"; margin-left: auto; font-size: 12px; color: var(--leaf); transition: transform .15s; }
.side-tg:not([open]) summary::after { transform: rotate(-90deg); }
.side-tg summary .nav-badge { order: 2; }
.side-tg summary:hover { background: var(--brand-2); }
.side-tg .side-list { padding: 2px 0 6px 8px; }

.side-foot { margin-top: auto; padding: var(--s2) 4px 0; border-top: 1px solid var(--brand-2); font-size: 13px; line-height: 20px; color: var(--leaf); display: grid; gap: 4px; }
.side-repo { color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.side-branch { font-weight: 400; color: var(--leaf); }
.link-btn {
  justify-self: start; min-height: 32px; padding: 4px 0; border: 0; background: none; cursor: pointer;
  color: var(--leaf); font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: #fff; }
.main .link-btn { color: var(--brand); font-size: 14px; }
.main .link-btn:hover { color: var(--accent); }

.main { min-width: 0; padding: var(--s4) clamp(20px, 3vw, 40px) var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.main:focus { outline: none; }

/* ---- Allgemein ------------------------------------------------------------------ */

.center { min-height: 100dvh; display: grid; place-items: center; padding: var(--s3) var(--gutter); }
.loading, .loading-row { color: var(--muted); }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); }
.box-flush { padding: 0; overflow: hidden; }
.box-title { margin-bottom: var(--s2); font-size: 18px; line-height: 28px; }
.box-sub { margin: var(--s2) 0 var(--s1); font-size: 13px; font-weight: 600; color: var(--muted); }
.box-foot { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 20px; color: var(--muted); }
.box > p + p, .box > p + .facts { margin-top: var(--s1); }
.empty { padding: var(--s3); color: var(--muted); }
.box.empty { display: grid; gap: var(--s1); }
.box:not(.box-flush) > .empty { padding: 0; }

.notice { padding: var(--s2) var(--s3); border: 1px solid; border-radius: var(--r-sm); font-size: 15px; line-height: 24px; }
.notice p + p, .notice details { margin-top: var(--s1); }
.notice ul { margin-top: 4px; padding-left: var(--s2); list-style: disc; }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.notice-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.notice-ok { background: var(--ok-bg); border-color: var(--line-strong); color: var(--ok-ink); }
.notice-info { background: var(--info-bg); border-color: #b9cfe6; color: var(--info-ink); }
.notice a { color: inherit; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s2) var(--s3); }
.page-title { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; overflow-wrap: anywhere; }
.page-meta { margin-top: 4px; font-size: 14px; line-height: 22px; color: var(--muted); }
.head-pills { display: flex; flex-wrap: wrap; gap: var(--s1); }
.crumbs { margin-bottom: calc(var(--s2) * -1); font-size: 14px; line-height: 22px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.sect { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.sect-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--s2); }
.sect-head h2 { font-size: 21px; line-height: 28px; overflow-wrap: anywhere; }
.sect-head a { font-size: 14px; font-weight: 600; }
.lead-sm { font-size: 14px; line-height: 22px; color: var(--muted); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--s4) var(--s3); align-items: start; }
.cols-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .cols-wide { grid-template-columns: minmax(0, 1fr); } }
.stack-col { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.stack-col > .box { min-width: 0; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s2); }
.stats-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3); min-width: 0; }
.stat-warn { border-color: var(--warn-line); }
.stat-label { margin-bottom: var(--s1); font-size: 13px; line-height: 20px; font-weight: 600; color: var(--muted); }
.stat-label.is-warn { color: var(--warn-ink); }
.stat-value { font-size: 32px; line-height: 1.1; font-weight: 700; color: var(--brand); }
.stat-small { font-size: 21px; line-height: 1.25; color: var(--ink); }
.stat-mono { font-family: var(--mono); font-size: 26px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.stat-sub { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--muted); }
.is-warn { color: var(--warn-ink); }
.is-bad { color: var(--bad-ink); }

/* Offene Freigaben */
.approvals { display: grid; gap: var(--s2); }
.approval-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3);
  padding: var(--s3); background: var(--card); border: 1px solid var(--warn-line); border-radius: var(--r-md);
}
.item-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3);
  padding: var(--s3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
}
.item-card .btn { min-width: 160px; }
.head-actions { display: flex; flex-wrap: wrap; gap: var(--s1); }
.actions-cell { white-space: nowrap; }
.actions-cell .btn + .btn { margin-left: var(--s1); }
.app-tag { margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: var(--brand-2); color: var(--leaf); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; align-self: center; }
a.link-btn { display: inline-flex; align-items: center; }
.approval-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 280px; }
.approval-text h2 { font-size: 19px; line-height: 28px; }
.approval-text p:first-child { margin-bottom: 4px; }

/* Versionen */
.ver, code.ver { font-family: var(--mono); }
.ver-warn { color: var(--warn-ink); font-weight: 600; }
.ver-strong { font-weight: 600; }
.pill-link { text-decoration: none; }
.pill-link:hover { background: #f8e2c8; color: var(--warn-ink); }

/* ---- Tabellen ---------------------------------------------------------------------- */

table.data { font-size: 15px; line-height: 24px; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
table.data thead th { padding-block: 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13px; line-height: 20px; font-weight: 600; color: var(--muted); }
table.data tbody tr:last-child td { border-bottom: 0; }
.data-plain th, .data-plain td { padding-inline: 12px; }
.data-plain td:first-child code { overflow-wrap: normal; white-space: nowrap; }
.data-plain thead th { padding-block: 10px; }
.row-title { font-weight: 600; text-decoration: none; }
.row-title:hover { text-decoration: underline; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.small { font-size: 13px; line-height: 20px; }
/* position: relative, damit auch .sr-only-Zellen vom Scrollbereich abgeschnitten werden
   und die Seite nicht seitlich aufmachen. */
.table-scroll { position: relative; overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
.table-scroll .data { min-width: 460px; }

table.kv { font-size: 14px; line-height: 22px; table-layout: fixed; }
.kv th, .kv td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv th { width: 36%; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.th-sub { display: block; font-weight: 400; }
.kv code { font-size: 12.5px; }

/* Listen */
.rowlist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s1); padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.rowlist li:first-child { padding-top: 0; }
.rowlist li:last-child { padding-bottom: 0; border-bottom: 0; }
.row-main { flex: 1 1 200px; min-width: 0; display: grid; font-size: 15px; font-weight: 500; line-height: 24px; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; line-height: 20px; font-weight: 400; color: var(--muted); }
.row-date { font-size: 13px; color: var(--muted); }
.rowlist li > code:first-child { flex: 1 1 auto; }

/* Ringe */
.rings { display: grid; gap: var(--s3); }
.ring-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s1); margin-bottom: var(--s1); }
.ring-head h3 { flex: 1 1 auto; font-size: 16px; line-height: 24px; text-transform: capitalize; }
.ring-head .muted { font-size: 13px; }
.bar { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.bar-fill.is-done { background: var(--brand); }
.ring-note { margin-top: 6px; font-size: 13px; line-height: 20px; color: var(--muted); }

/* Prozesse und Fakten */
.proc-pill { margin-bottom: var(--s1); }
.proc-text { font-size: 14px; line-height: 22px; color: var(--muted); }
.proc-list { margin: var(--s2) 0; font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: var(--s2); font-size: 14px; line-height: 22px; }
.step > .facts > div:last-child { grid-column: 1 / -1; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { font-weight: 600; overflow-wrap: anywhere; }
.facts dd code { font-weight: 400; }

/* Diff */
.diff-fig { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.diff-fig figcaption { padding: 12px var(--s2); border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.diff-fig .empty { padding: var(--s2); }
.diff { overflow-x: auto; background: var(--card); }
.box .diff { margin-top: var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.box .diff-fig .diff { margin: 0; border: 0; border-radius: 0; }
.diff pre { padding: var(--s1) 0; font-size: 12.5px; line-height: 22px; min-width: max-content; }
.d { display: block; padding: 0 var(--s2) 0 0; }
.d-sign { display: inline-block; width: 28px; text-align: center; user-select: none; }
.d-add { background: var(--ok-bg); color: var(--ok-ink); }
.d-del { background: var(--bad-bg); color: var(--bad-ink); }
.d-ctx { color: var(--muted); }
.d-gap { color: var(--muted); text-align: center; background: var(--surface); }

/* Schritte, Listen */
.numbered { display: grid; gap: 12px; counter-reset: n; font-size: 14px; line-height: 22px; }
.numbered > li { position: relative; padding-left: 36px; counter-increment: n; }
.numbered > li::before {
  content: counter(n); position: absolute; left: 0; top: -1px; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--ok-bg); color: var(--brand); font-size: 13px; font-weight: 700;
}
.steps .step-body { display: grid; gap: 2px; }
.step-list { display: grid; gap: 8px; margin-top: 4px; }
.step-list li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); color: var(--muted); }
.step-list b { color: var(--text, inherit); font-weight: 600; }
.step-link { flex: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.numbered > li.is-alert::before { padding-bottom: 1px; line-height: 1; content: "!"; background: var(--bad-bg); color: var(--bad-ink); }
.bullets { margin-bottom: var(--s1); padding-left: 20px; list-style: disc; font-size: 14px; line-height: 22px; }
.bullets li + li { margin-top: 2px; }

/* Callout */
.callout { background: var(--ok-bg); border-color: var(--line-strong); }
.callout .eyebrow { margin-bottom: var(--s1); }
.callout > p { font-size: 15px; line-height: 24px; }
.callout .box-foot { border-top-color: #c3d6c9; color: #2c4a3c; }
.callout-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin-top: var(--s2); }
.callout-bar .box-title { margin-bottom: 4px; }
.callout-bar .stack-btns { display: flex; flex-wrap: wrap; margin: 0; }
.callout-bar .stack-btns .btn { width: auto; }
.callout-dark { background: var(--brand); border-color: var(--brand); color: #fff; }
.callout-dark .box-title { color: #fff; }
.callout-dark > p { color: var(--on-brand); }
.stack-btns { display: grid; gap: var(--s1); margin: var(--s2) 0 0; }
.stack-btns .btn { width: 100%; }

/* Statuszeile */
.status { min-height: 24px; margin-top: var(--s1); font-size: 14px; line-height: 24px; color: var(--muted); }
.status:empty { min-height: 0; margin: 0; }
.status-ok { color: var(--ok-ink); }
.status-bad { color: var(--bad-ink); font-weight: 500; }
.status-info { color: var(--info-ink); }
.callout .status-bad { color: var(--bad-ink); }

/* ---- Formulare ------------------------------------------------------------------------ */

.form { display: grid; gap: var(--s2); }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2); margin-top: var(--s2); }
.field { display: grid; gap: 6px; align-content: start; flex: 1 1 160px; min-width: 0; }
.field-wide { flex: 2 1 280px; }
.field-narrow { flex: 0 1 140px; }
.field label { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font-size: 15px;
}
.hint { font-size: 13px; line-height: 20px; color: var(--muted); }
.field-error { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--bad-ink); }
.field-error:empty { display: none; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--bad-ink); box-shadow: inset 0 0 0 1px var(--bad-ink); }

/* Neues Produkt */
.form-grid { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.form-grid > .field { flex: 1 1 200px; }
.form-grid > .field-wide { flex: 2 1 320px; }
.field-set { display: grid; gap: 6px; margin: 0 0 var(--s2); }
.field-set legend { float: none; margin: 0 0 6px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.switch-light { display: flex; gap: 12px; align-items: center; min-height: 44px; margin-bottom: var(--s2); font-size: 15px; cursor: pointer; }
.step > .hint { margin-bottom: var(--s2); }
.step > .hint + .form-grid, .step > .form-grid + .hint { margin-top: 0; }
.yaml-preview { max-height: 420px; overflow: auto; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 12.5px; line-height: 20px; }
.yaml-preview code { font-size: inherit; overflow-wrap: normal; white-space: pre; }
.box > .hint { margin-top: var(--s1); }
.notice-links { display: flex; flex-wrap: wrap; gap: 4px var(--s3); }

/* Kunden, Benutzer, Rechte */
.table-scroll .rights { min-width: 680px; }
.rights .right-col { width: 112px; text-align: center; }
.rights th.right-col { font-size: 12px; line-height: 16px; vertical-align: bottom; }
.rights td.right-col input { margin: 0 auto; }
.legend { display: grid; gap: var(--s1); font-size: 14px; line-height: 22px; margin-bottom: var(--s2); }
.legend dt { font-weight: 600; }
.legend dd { color: var(--muted); }
.form-sub { margin: var(--s3) 0 0; font-size: 16px; line-height: 24px; }
.ring-row { align-items: flex-start; }
.ring-row .link-btn { align-self: center; }
.can-list { display: grid; gap: 8px; font-size: 15px; line-height: 24px; }
.can-list li { display: flex; gap: 10px; align-items: baseline; }
.can-list .no { color: var(--muted); }
.edit-row { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.edit-row input { width: 88px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s1); }

.step { display: block; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) 12px; margin-bottom: var(--s2); }
.step-head h2 { flex: 1 1 auto; font-size: 19px; line-height: 28px; }
.step .step-no { display: grid; place-items: center; width: 28px; height: 28px; margin: 0; border-radius: var(--r-sm); background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; }
.step > p { font-size: 15px; line-height: 24px; color: var(--muted); margin-bottom: var(--s2); }
.step > .facts { margin-top: 0; }

.prods { display: grid; gap: var(--s1); }
.prod { border: 1px solid var(--line); border-radius: var(--r-sm); }
.prod.is-removed { border-color: var(--bad-line); background: var(--bad-bg); }
.prod input[type="checkbox"] { appearance: none; position: relative; width: 20px; height: 20px; border: 2px solid #8a9a90; border-radius: 5px; background: #fff; }
.prod input[type="checkbox"]:checked { border-color: var(--brand); background: var(--brand); }
.prod input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 50%; top: 50%; box-sizing: content-box; width: 4px; height: 9px; border: solid #fff; border-width: 0 3px 3px 0; transform: translate(-50%, -68%) rotate(45deg); }
.is-removed input[type="checkbox"] { border-color: var(--bad-ink); background: var(--bad-ink); }
.is-removed input[type="checkbox"]::before, .is-removed input[type="checkbox"]::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 3px; border: 0; border-radius: 1px; background: #fff; transform: translate(-50%, -50%) rotate(45deg); }
.is-removed input[type="checkbox"]::after { transform: translate(-50%, -50%) rotate(-45deg); }
.tone-ok { color: var(--ok-ink); }
.tone-bad { color: var(--bad-ink); }
.bullets.tight { margin-bottom: 0; }
.prod.is-on { border-color: var(--line-strong); background: #f6faf7; }
.prod-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; padding: 8px var(--s2); }
.prod-main label { flex: 1 1 8em; min-width: 0; font-weight: 600; cursor: pointer; padding: 6px 0; }
.prod-sum { font-size: 13px; color: var(--muted); }
input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--brand); cursor: pointer; }
.prod-body { display: grid; gap: 12px; padding: 4px var(--s2) var(--s2); border-top: 1px solid #d5e3d9; margin: 0 var(--s2); padding-left: 0; padding-right: 0; padding-top: var(--s2); }
.opt-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s1) var(--s2); align-items: start; }
.opt-label { padding-top: 7px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--muted); }
.opt-ctrl { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.prod-body .chip { position: relative; min-height: 36px; padding: 0 14px; font-weight: 500; }
.prod-body .chip input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: inherit; }
.prod-body .chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.prod-body .chip:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.prod-body .chip:has(input:disabled) { opacity: .85; }
.ring-lines { display: grid; gap: 8px; }
.ring-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.group-check { display: inline-flex; align-items: center; gap: 10px; flex: 1 1 14em; min-width: 0; min-height: 44px; font-size: 13px; line-height: 20px; color: var(--muted); cursor: pointer; }
.group-check.has-group { color: var(--ink); font-weight: 600; }
.group-check.is-removed { color: var(--bad-ink); }
.group-check span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .opt-row { grid-template-columns: minmax(0, 1fr); } .opt-label { padding-top: 0; } }
.prod-opts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); padding: 0 var(--s2) var(--s2) calc(var(--s2) + 32px); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
legend { float: left; margin-right: 4px; padding: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; cursor: pointer; }
.chip:has(input:checked) { background: var(--ok-bg); border-color: var(--line-strong); }
.chip:has(input:disabled) { cursor: not-allowed; }

.switch { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--brand-2); border-radius: var(--r-sm); background: var(--brand-deep); font-size: 15px; line-height: 24px; color: #fff; cursor: pointer; }
.switch input { margin-top: 2px; accent-color: var(--leaf); }

.yaml { margin-top: var(--s2); }
.yaml summary, .howto summary, .notice summary { cursor: pointer; font-size: 14px; font-weight: 600; min-height: 32px; display: list-item; }
.yaml textarea { width: 100%; margin-top: var(--s1); padding: var(--s1) 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font: 12.5px/20px var(--mono); resize: vertical; }

/* ---- Verbinden, Dialog ------------------------------------------------------------------ */

.connect { width: min(100%, 520px); display: grid; gap: var(--s2); padding: var(--s4); }
.connect h1 { font-size: 26px; line-height: 1.2; }
.connect-logo { font-size: 20px; margin-bottom: var(--s1); }
.connect-logo img { width: 28px; height: 28px; }
.howto { padding-top: var(--s2); border-top: 1px solid var(--line-soft); font-size: 14px; line-height: 22px; }
.howto > * + * { margin-top: var(--s1); }
.plain { display: grid; gap: 4px; padding-left: 20px; list-style: disc; }

dialog { width: min(440px, calc(100vw - 32px)); padding: var(--s3); border: 0; border-radius: var(--r-md); background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgba(13, 38, 28, .35); }
dialog::backdrop { background: rgba(20, 40, 31, .55); }
dialog h2 { margin-bottom: var(--s1); font-size: 20px; line-height: 28px; }
dialog p + p { margin-top: var(--s1); }
dialog .form-actions { margin-top: var(--s3); justify-content: flex-end; }

/* ---- Schmal: Kopfband oben, Tab-Leiste unten ------------------------------------------------ */

@media (max-width: 860px) {
  .shell { display: block; }
  .side-groups { display: none; }
  .side-tenant { display: grid; }
  .side-nav-flat { display: block; }
  .side {
    position: static; height: auto; overflow: visible; gap: 12px;
    padding: var(--s2) var(--gutter) var(--s2);
    display: grid; grid-template-columns: minmax(0, 1fr);
  }
  .side-logo { padding: 0; font-size: 18px; }
  .side-tenant { padding: 0; gap: 2px; }
  .side-tenant .side-label { display: none; }
  .side-tenant-name { font-size: 20px; line-height: 28px; }
  .side-tenant select { font-size: 16px; }
  .side-foot { margin: 0; padding: 12px 0 0; flex-direction: row; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s2); }
  .side-foot p { display: flex; align-items: center; }
  .side-foot .side-note { display: none; }

  .side-nav {
    position: fixed; inset: auto 0 0 0; z-index: 30;
    background: var(--card); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .side-nav ul { display: flex; gap: 0; font-size: 12px; }
  .side-nav li { flex: 1 1 0; min-width: 0; }
  .side-nav .desktop-only { display: none; }
  .side-nav a {
    position: relative; flex-direction: column; justify-content: center; gap: 3px;
    min-height: 60px; padding: 6px 4px; border-radius: 0; color: var(--muted); text-align: center;
  }
  .side-nav a:hover { background: var(--surface); color: var(--brand); }
  .side-nav a[aria-current="page"] { background: transparent; color: var(--brand); font-weight: 600; box-shadow: inset 0 3px 0 var(--brand); }
  .side-nav svg { display: block; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  .nav-label { flex: 0 0 auto; }
  .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; padding: 0 5px; text-align: center; }

  .main { padding: var(--s3) var(--gutter) calc(60px + var(--s4) + env(safe-area-inset-bottom)); gap: var(--s3); }
  .crumbs { margin-bottom: calc(var(--s1) * -1); }
  .box-flush .kv th { width: 40%; }
}

/* Tabellen werden zu Karten */
@media (max-width: 720px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 4px 0; border: 0; }
  table.stack td::before { content: attr(data-label); font-size: 13px; color: var(--muted); }
  table.stack td:first-child { display: block; padding-bottom: 8px; }
  table.stack td:first-child::before { content: none; }
  .stat-value { font-size: 28px; }
  .approval-card .btn { width: 100%; }
  .prod-opts { padding-left: var(--s2); }
}

@media (max-width: 420px) {
  .stats, .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: var(--s2); }
  .stats-3 .stat:last-child { grid-column: 1 / -1; }
  .connect { padding: var(--s3); }
}
