/* Symbio Intelligence · Oberfläche. Tokens in drei Zuständen: System (nur prefers-color-scheme),
   explizit hell, explizit dunkel. Komponenten greifen ausschließlich auf Tokens zu. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/Manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ground: #fbfcf7;          /* Symbio Off-White */
  --surface: #ffffff;
  --surface-2: #f3f4ef;
  --ink: #0e0d0e;             /* Symbio Fast-Schwarz */
  --ink-2: #3a3f45;
  --muted: #5d6c7b;           /* Symbio Slate */
  --line: #e4e5dc;
  --line-strong: #cfd1c5;
  --brand: #af00af;           /* Brombeere */
  --brand-ink: #ffffff;
  --brand-soft: #f7e6f7;
  --derived: #6a4ff3;         /* Herkunft: hergeleitet (Violett, nur dafür) */
  --derived-soft: #ece8ff;
  --good: #1a8f56;
  --good-soft: #dff7e9;       /* Mint-Tint */
  --warn: #9a6b0f;
  --warn-soft: #fff1d6;
  --crit: #c8102e;
  --crit-soft: #ffdede;       /* Symbio Hellrot */
  --info: #2d40ea;            /* Symbio Blau */
  --info-soft: #e7e9ff;
  --focus: #2d40ea;
  --shadow: 0 1px 2px rgba(14, 13, 14, .06), 0 8px 24px -12px rgba(14, 13, 14, .18);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 236px;
  --font: "Manrope", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0e0d0e;
    --surface: #171618;
    --surface-2: #1f1e21;
    --ink: #f3f2ee;
    --ink-2: #c9c7c0;
    --muted: #9aa4ad;
    --line: #2a292c;
    --line-strong: #3a393d;
    --brand: #d64bd6;
    --brand-ink: #0e0d0e;
    --brand-soft: #2b122b;
    --derived: #b3a6ff;
    --derived-soft: #231d45;
    --good: #5de598;
    --good-soft: #10301f;
    --warn: #f0b64a;
    --warn-soft: #33260c;
    --crit: #ff7676;
    --crit-soft: #3a1518;
    --info: #8b96ff;
    --info-soft: #1c2050;
    --focus: #8b96ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0e0d0e;
  --surface: #171618;
  --surface-2: #1f1e21;
  --ink: #f3f2ee;
  --ink-2: #c9c7c0;
  --muted: #9aa4ad;
  --line: #2a292c;
  --line-strong: #3a393d;
  --brand: #d64bd6;
  --brand-ink: #0e0d0e;
  --brand-soft: #2b122b;
  --good: #5de598;
  --good-soft: #10301f;
  --warn: #f0b64a;
  --warn-soft: #33260c;
  --crit: #ff7676;
  --crit-soft: #3a1518;
  --info: #8b96ff;
  --info-soft: #1c2050;
  --focus: #8b96ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -16px rgba(0, 0, 0, .7);
}

/* ---- Grundlagen ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: 1.65rem; font-weight: 800; line-height: 1.15; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3, .subhead { font-size: .85rem; font-weight: 700; color: var(--ink-2); margin: 1rem 0 .4rem; }
p { margin: 0; }
svg { display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.lead { color: var(--ink-2); margin-top: .25rem; }
.prose { white-space: pre-line; color: var(--ink-2); line-height: 1.5; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: .5rem .75rem; border-radius: var(--radius-sm); }
.skip:focus { left: .5rem; top: .5rem; z-index: 50; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- Rahmen: Seitenleiste, Kopfzeile, Inhalt --------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem 1rem; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; padding: .35rem .5rem .1rem; }
.brand__logo { width: 100%; max-width: 168px; height: auto; display: block; }
:root[data-theme="dark"] .brand__logo { filter: brightness(1.25); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand__logo { filter: brightness(1.25); } }
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav__item { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 600; font-size: .92rem; position: relative; }
.nav__item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.nav__item:hover { background: var(--surface-2); color: var(--ink); }
.nav__item.is-active { background: var(--brand-soft); color: var(--ink); }
.nav__item.is-active::before { content: ""; position: absolute; left: -1rem; top: 20%; bottom: 20%; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav__item.is-active svg { opacity: 1; stroke: var(--brand); }
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: .75rem; }
.theme-toggle { display: flex; align-items: center; gap: .55rem; padding: .5rem .7rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--radius-sm); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: inline-block; }
.userchip { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.userchip__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.userchip__text strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__out { margin-left: auto; color: var(--muted); padding: .3rem; border-radius: var(--radius-sm); }
.userchip__out:hover { color: var(--crit); background: var(--surface-2); }
.userchip__out svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--ground); font-size: .72rem; font-weight: 800; letter-spacing: .02em; flex: none; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .85rem 2rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ground) 92%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.search { display: flex; align-items: center; gap: .5rem; flex: 1; max-width: 560px; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; border: 0; background: transparent; color: var(--ink); font: inherit; outline: none; min-width: 0; }
.search input::placeholder { color: var(--muted); }
.search kbd { font: inherit; font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 .35rem; }
.topbar__meta { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.content { padding: 1.75rem 2rem 2.5rem; max-width: 1360px; width: 100%; display: flex; flex-direction: column; gap: 1.5rem; }
.foot { padding: 1rem 2rem 1.5rem; margin-top: auto; border-top: 1px solid var(--line); }

/* ---- Seitenkopf, Brotkrumen --------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.page-head--person { align-items: center; }
.page-head__meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.badges { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.crumbs { display: flex; gap: .5rem; font-size: .82rem; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }

/* ---- Kennzahlen ---------------------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.kpi { display: flex; flex-direction: column; gap: .35rem; padding: 1.05rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kpi__label { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi__value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi__hint { font-size: .8rem; color: var(--muted); }

/* ---- Raster und Panels ------------------------------------------------------------------- */
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.panel__title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.count { font-weight: 600; color: var(--muted); font-size: .85rem; margin-left: .3rem; }
.layout-detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.layout-detail__main, .layout-detail__aside { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.center-card { max-width: 480px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- Tabellen ------------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: .35rem .6rem .55rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: .6rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover td { background: var(--surface-2); }
.table--compact td { padding: .45rem .6rem; }
.table tr.is-failed td { background: var(--crit-soft); }
.table tr.is-muted td { color: var(--muted); }
.link-strong { font-weight: 700; color: var(--ink); }
.link-strong:hover { color: var(--brand); }
.link-quiet { color: var(--ink-2); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.link-quiet:hover { color: var(--ink); text-decoration-color: var(--brand); }

/* ---- Pills, Punkte, Hinweise ------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; }
.pill--green { background: var(--good-soft); color: var(--good); }
.pill--blue { background: var(--info-soft); color: var(--info); }
.pill--amber { background: var(--warn-soft); color: var(--warn); }
.pill--red { background: var(--crit-soft); color: var(--crit); }
.pill--brand { background: var(--brand-soft); color: var(--brand); }
.pill--gray { background: var(--surface-2); color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .5rem; background: var(--muted); vertical-align: middle; }
.dot--green { background: var(--good); } .dot--blue { background: var(--info); } .dot--amber { background: var(--warn); } .dot--brand { background: var(--brand); } .dot--gray { background: var(--muted); } .dot--red { background: var(--crit); }
.notice { padding: .6rem .8rem; border-radius: var(--radius-sm); font-size: .85rem; }
.notice--warn { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--muted); font-size: .9rem; padding: .5rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .8rem; border: 1px solid var(--line); }
.chip--auto { border-style: dashed; background: transparent; }
.chip--quiet { padding: .05rem .5rem; font-size: .72rem; background: transparent; color: var(--ink-3, var(--ink-2)); }
/* Herkunftskennzeichnung (Entscheidung Moritz 2026-09-13, Variante A): Funke in Violett für alles,
   was das System aus den Salesforce-Daten hergeleitet hat; grüner Haken für Hergeleitetes, das eine
   Person bestätigt hat; Salesforce-Inhalte tragen keine Marke. */
.ico { width: 1em; height: 1em; flex: 0 0 auto; }
.mark { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
.mark--derived { color: var(--derived); }
.mark--confirmed { color: var(--good); }
.mark a { color: inherit; }
.tag { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem .1rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.tag--derived { background: var(--derived-soft); color: var(--derived); }
.tag--confirmed { background: var(--good-soft); color: var(--good); }
.pill--derived { background: var(--derived-soft); color: var(--derived); }
.chip--derived { border-color: var(--derived); color: var(--derived); background: transparent; }
.chip--derived.chip--quiet { border-color: transparent; }
.chip--confirmed { border-color: var(--good); }
.chip--confirmed .ico { color: var(--good); }
.foot .mark { font-size: inherit; }
.chip__x { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; line-height: 1; padding: 0 0 0 .3rem; cursor: pointer; }
.chip__x:hover { color: var(--crit); }
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: .75rem; }
.req-forms { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin-top: 1rem; }
.req-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.req-form input[type="text"], .req-form select { font: inherit; font-size: .85rem; color: var(--ink); background: var(--ground); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .35rem .5rem; }
.req-rejected { text-decoration: line-through; }
.ranks { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
/* Anmeldeseite (ohne Seitenleiste) */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; box-sizing: border-box; }
.auth-card { width: min(100%, 420px); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.4rem; padding: 2.75rem 2.25rem 2.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-card__logo { width: 220px; max-width: 220px; }
.auth-card__error { margin: 0; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--crit-soft); color: var(--crit); font-size: .88rem; font-weight: 600; }
.btn--auth { padding: .75rem 1.3rem; font-size: 1rem; gap: .6rem; }
.auth-card__ms { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.cvtext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; line-height: 1.5; color: var(--ink-2); max-height: 36rem; overflow: auto; padding: .75rem .9rem; margin-top: .6rem; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.disclosure > summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--brand); }

/* ---- Pipeline und Balken ------------------------------------------------------------------ */
.pipeline { display: flex; gap: 3px; height: 14px; border-radius: 7px; overflow: hidden; }
.pipeline__seg { flex-basis: 0; min-width: 4px; background: var(--muted); }
.pipeline__seg--green { background: var(--good); } .pipeline__seg--blue { background: var(--info); } .pipeline__seg--amber { background: var(--warn); } .pipeline__seg--brand { background: var(--brand); } .pipeline__seg--gray { background: var(--muted); }
.pipeline__legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .35rem 1rem; font-size: .88rem; }
.pipeline__legend li { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px dashed var(--line); padding: .25rem 0; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.bars li { display: grid; grid-template-columns: 150px 1fr 60px; align-items: center; gap: .75rem; font-size: .88rem; }
.bars__track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bars__fill { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

/* ---- Zeitleiste, Fakten, Listen ----------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 84px 1fr; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline__time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; padding-top: .1rem; }
.timeline__body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.facts { margin: 0; display: flex; flex-direction: column; }
.facts__row { display: grid; grid-template-columns: 130px 1fr; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.facts__row:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }
.list-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list-results li { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.list-results li:last-child { border-bottom: 0; }
.list-results .pill { margin-left: auto; }

/* ---- Filter, Formulare, Buttons ------------------------------------------------------------ */
.filters { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.field { display: flex; flex-direction: column; gap: .3rem; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); min-width: 150px; }
.field--grow { flex: 1 1 260px; }
.field input, .field select, .inline-form select { font: inherit; font-size: .9rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--ground); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .45rem .6rem; }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.inline-form { display: inline; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { filter: brightness(1.08); color: var(--brand-ink); }
.btn--ghost { background: transparent; }
.btn--sm { padding: .3rem .65rem; font-size: .8rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .85rem; padding-top: .25rem; }
.pagination__links { display: flex; gap: .5rem; }
.htmx-request #tabelle { opacity: .55; transition: opacity .15s; }

/* ---- Sync-Kacheln ------------------------------------------------------------------------- */
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.spec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.spec--failed { border-color: var(--crit); }
.spec__head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.spec__head h2 { font-size: .95rem; }
.spec__value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.spec__unit { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: .35rem; }
.spec__meta { margin: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; }
.spec__meta div { display: flex; justify-content: space-between; gap: .75rem; }
.spec__meta dt { color: var(--muted); } .spec__meta dd { margin: 0; text-align: right; }
.spec__error { font-size: .82rem; color: var(--crit); background: var(--crit-soft); padding: .45rem .6rem; border-radius: var(--radius-sm); overflow-wrap: anywhere; }

/* ---- Responsiv ---------------------------------------------------------------------------- */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .layout-detail { grid-template-columns: 1fr; } .grid--2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .75rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand__logo { max-width: 130px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav__item.is-active::before { display: none; }
  .sidebar__foot { margin-left: auto; flex-direction: row; align-items: center; }
  .userchip { border: 0; padding: 0; } .userchip__text { display: none; }
  .topbar, .content, .foot { padding-left: 1rem; padding-right: 1rem; }
  .bars li { grid-template-columns: 110px 1fr 50px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* ---- Matching v0 (M0): Shortlist und passende Aufträge ------------------------------------- */
.shortlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.match { display: grid; grid-template-columns: 2.2rem 1fr 6.5rem; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.match:last-child { border-bottom: 0; }
.match__rank { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; padding-top: .15rem; }
.match__head { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.match__score { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.match__score .bars__track { width: 100%; display: block; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.reasons { list-style: none; margin: .35rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .6rem; }
.reason { display: inline-flex; gap: .35rem; align-items: baseline; font-size: .8rem; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: .12rem .45rem; }
.reason--zero { opacity: .6; }
.reason__part { font-weight: 600; color: var(--text); }
.reason__points { font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 600; }
.reason__max { color: var(--muted); font-weight: 500; }
.reason--cap .reason__points { color: var(--crit); }
.matches-compact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.matches-compact li { display: grid; grid-template-columns: 2.6rem 1fr; gap: .5rem; align-items: start; font-size: .9rem; }
@media (max-width: 720px) { .match { grid-template-columns: 1.6rem 1fr; } .match__score { grid-column: 2; flex-direction: row; align-items: center; } }

/* Teams-Erreichbarkeits-Ampel (Ansprechpartner-Detail): Panel oben in der rechten Spalte */
.presence-slot { min-height: 1.6rem; display: flex; align-items: center; }
.aside-link { display: flex; }
.ampel { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.1rem; font-weight: 600; }
.ampel__dot { width: .85rem; height: .85rem; border-radius: 50%; flex: none; background: var(--muted); }
.ampel--green  .ampel__dot { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft);
  animation: ampel-glow 2.4s ease-in-out infinite; }
.ampel--yellow .ampel__dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.ampel--red    .ampel__dot { background: var(--crit); box-shadow: 0 0 0 4px var(--crit-soft); }
.ampel--grey   .ampel__dot { background: var(--muted); }
.ampel--green  .ampel__label { color: var(--good); }
.ampel--yellow .ampel__label { color: var(--warn); }
.ampel--red    .ampel__label { color: var(--crit); }
.ampel--grey   .ampel__label,
.ampel--loading .ampel__label { color: var(--muted); font-weight: 500; }
.ampel--loading .ampel__dot { animation: ampel-pulse 1.1s ease-in-out infinite; }
@keyframes ampel-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
/* leichtes Pulsieren des grünen Punkts (nur bei „verfügbar“) */
@keyframes ampel-glow {
  0%, 100% { box-shadow: 0 0 0 3px var(--good-soft), 0 0 3px 1px var(--good); }
  50%      { box-shadow: 0 0 0 5px var(--good-soft), 0 0 9px 3px var(--good); }
}
.presence-slot--compact { min-height: 1.2rem; }
.presence-slot--compact .ampel { font-size: .9rem; font-weight: 500; }
.presence-slot--compact .ampel__dot { width: .65rem; height: .65rem; }
