/* CRM-Ergänzungen zum Design-System (site.css). Eine erhabene Karte, ein blauer Knopf, Felder eingedrückt mit Rand. */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html, body { min-height: 100%; }
body { display: flex; flex-direction: column; }
[hidden] { display: none !important; }

.stage { flex: 1; display: grid; place-items: center; padding-block: var(--space-5); }
.login { width: min(100%, 480px); display: grid; gap: var(--space-3); padding: clamp(24px, 5vw, 40px); }
.login-head { display: flex; gap: var(--space-2); align-items: center; }
.login-head .mark { width: 52px; height: 52px; }
.login-head .mark svg { width: 28px; height: 28px; }
.eyebrow { font-size: 17px; line-height: 22px; color: var(--ink-muted); font-weight: 700; }
.eyebrow b { display: block; color: var(--ink); font-size: 20px; }
.login h1 { font-size: 34px; line-height: 40px; letter-spacing: -.01em; }
.lead { color: var(--ink-muted); }
.view { display: grid; gap: var(--space-2); }
.view:focus { outline: none; }

.f { display: grid; gap: var(--space-1); font-weight: 700; }
.f-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.field { display: block; width: 100%; min-height: 56px; padding: 12px var(--space-2); background: var(--surface); color: var(--ink);
  border: 2px solid var(--linie); border-radius: var(--radius-md); box-shadow: var(--neu-inset); font: 400 19px/1.4 var(--font-sans); }
.field:focus { outline: 3px solid var(--blau); outline-offset: 2px; }
.field[aria-invalid="true"] { border-color: var(--akzent); }
.pw { position: relative; }
.pw .field { padding-right: 120px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 44px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); color: var(--ink); border: 2px solid var(--linie); box-shadow: var(--neu-raised-sm); font: 700 17px/1 var(--font-sans); cursor: pointer; }
.pw-toggle:active { box-shadow: var(--neu-inset); }
.code { font: 700 32px/1 var(--font-sans); letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; min-height: 72px; }

.msg { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius-md); padding: var(--space-2); font-size: 17px; line-height: 26px; border: 2px solid var(--linie); }
.msg .i { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.msg-err { border-color: var(--akzent); }
.msg-err .i { color: var(--akzent); }
.msg-info { background: var(--blau-tint); }
.msg-info .i { color: var(--blau); }
.msg-ok .i { color: var(--gruen); }
.msg ul { margin: 4px 0 0; padding-left: 1.1em; }
.hint { font-size: 17px; line-height: 26px; color: var(--ink-muted); font-weight: 400; }
.caps { color: var(--akzent); font-size: 17px; font-weight: 700; }
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 17px; line-height: 26px; font-weight: 400; color: var(--ink-muted); }
.rules li { display: flex; gap: 8px; align-items: center; }
.rules li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--linie); flex: none; }
.rules li.ok { color: var(--gruen); }
.rules li.ok::before { background: var(--gruen); border-color: var(--gruen); }

.alt { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-2); font-size: 17px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blau); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; cursor: pointer; text-align: left; }
.btn[disabled] { opacity: .65; cursor: progress; }
.secure { display: flex; gap: var(--space-1); align-items: center; justify-content: center; font-size: 17px; color: var(--ink-muted); }
.secure .i { width: 20px; height: 20px; }

.steps-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: s; }
.steps-mini li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; counter-increment: s; }
.steps-mini li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; box-shadow: var(--neu-raised-sm); display: grid; place-items: center; font-weight: 700; color: var(--blau); }
.qr { justify-self: center; width: min(220px, 70vw); padding: 12px; background: #ffffff; border-radius: var(--radius-md); border: 2px solid var(--linie); }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font: 700 19px/1.5 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; word-break: break-all; padding: 12px var(--space-2);
  border-radius: var(--radius-md); box-shadow: var(--neu-inset); border: 2px solid var(--linie); user-select: all; }
.codes { list-style: none; padding: var(--space-2); margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px var(--space-2);
  font: 700 19px/1.4 ui-monospace, "SF Mono", Menlo, monospace; border-radius: var(--radius-md); box-shadow: var(--neu-inset); border: 2px solid var(--linie); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; line-height: 26px; font-weight: 400; }
.check input { width: 24px; height: 24px; margin-top: 1px; accent-color: var(--blau); flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row .btn { flex: 1 1 180px; }
.foot { text-align: center; font-size: 17px; color: var(--ink-muted); padding-block: var(--space-3); }

/* App-Rahmen nach der Anmeldung */
.appbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); min-height: 72px; }
.who { text-align: right; font-size: 17px; line-height: 22px; }
.who b { display: block; font-size: 19px; }
.panel { max-width: 720px; margin: var(--space-5) auto 0; display: grid; gap: var(--space-2); }
.panel h1 { font-size: 34px; line-height: 40px; }
.pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--radius-full); box-shadow: var(--neu-inset); font-size: 17px; font-weight: 700; }

@media (max-width: 420px) { .codes { grid-template-columns: 1fr; } }

/* Keine Inline-Styles: die Content-Security-Policy erlaubt nur Stylesheets vom eigenen Server. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.spaced { margin-top: var(--space-1); }
.steps-mini.from-3 { counter-reset: s 2; }
.appbar .row { flex-wrap: nowrap; align-items: center; }
.appbar .row .btn { flex: none; }
/* Überschriften bekommen per Skript den Fokus (für Screenreader), sollen aber keinen Rahmen zeigen */
.view h1:focus, .panel h1:focus { outline: none; }
@media (max-width: 520px) { .who { display: none; } }

/* ── Anfragen-Ansicht ── */
body.app { display: block; }
.appnav { display: flex; gap: var(--space-3); font-weight: 700; font-size: 17px; }
.appnav a { color: var(--ink); }
.appnav a[aria-current="page"] { color: var(--blau); }
.appnav .soon { color: var(--ink-muted); opacity: .7; }
.board { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; padding-block: var(--space-3) var(--space-5); }
.board:has(.detail-pane[hidden]) { grid-template-columns: minmax(0, 1fr); }
.list-pane { display: grid; gap: var(--space-2); min-width: 0; }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); }
.list-head h1 { font-size: 34px; line-height: 40px; }
.search { flex: 1 1 260px; max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 16px; border-radius: var(--radius-full); background: var(--surface); color: var(--ink);
  border: 2px solid var(--linie); box-shadow: var(--neu-raised-sm); font: 700 17px/1 var(--font-sans); cursor: pointer; }
.chips button[aria-pressed="true"] { box-shadow: var(--neu-inset); border-color: var(--blau); color: var(--blau); }
.leads { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lead-row { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; text-align: left;
  padding: var(--space-2); background: var(--surface); color: var(--ink); border: 2px solid transparent; border-radius: var(--radius-md);
  box-shadow: var(--neu-raised-sm); font: inherit; cursor: pointer; }
.lead-row:hover, .lead-row.on { border-color: var(--blau); }
.lead-main { display: grid; gap: 2px; min-width: 0; }
.lead-main span { color: var(--ink-muted); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-meta { display: grid; justify-items: end; gap: 2px; font-size: 15px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: var(--radius-full); font-size: 15px; font-weight: 700;
  box-shadow: var(--neu-inset); white-space: nowrap; }
.s-neu { color: var(--akzent); }
.s-zugewiesen, .s-kontaktiert { color: var(--blau); }
.s-termin, .s-konvertiert { color: var(--gruen); }
.s-disqualifiziert { color: var(--ink-muted); }
.tag { font-weight: 700; color: var(--blau); }
.empty { display: grid; gap: var(--space-1); }
.empty h2 { font-size: 25px; }
.empty p { color: var(--ink-muted); }
.detail-pane { display: grid; gap: var(--space-2); position: sticky; top: 96px; min-width: 0; }
.detail-head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: flex-start; }
.detail-head h2 { font-size: 28px; line-height: 34px; }
.detail-pane h3 { font-size: 19px; margin-top: var(--space-1); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--space-2); margin: 0; font-size: 17px; line-height: 26px; }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.consents { margin: 0; padding-left: 1.1em; font-size: 17px; }
.actions { display: grid; gap: var(--space-2); padding-top: var(--space-2); border-top: 2px solid var(--schatten-dunkel); }
.close { min-height: 44px; padding: 0 14px; font-size: 17px; }
@media (max-width: 900px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .detail-pane { position: static; }
  .appnav { display: none; }
}
@media (max-width: 520px) {
  .lead-row { grid-template-columns: minmax(0, 1fr); }
  .lead-meta { justify-items: start; grid-auto-flow: column; justify-content: start; gap: 12px; }
  .facts { grid-template-columns: 1fr; }
}
@media (min-width: 901px) { .detail-pane { max-height: calc(100vh - 120px); overflow-y: auto; } }
