/* SEMA-CI, Variante A ("Grünes Band") — abgeleitet aus sema-soft.com:
   Grün #97C00E, dunkles #121212 auf hellem Grund, Rubik-Versalien für Überschriften,
   Hind Vadodara als Fließschrift, 15px Radius an Schaltflächen, 10px an Karten.
   Die Marken-Schriften werden bewusst NICHT von einem fremden Server geladen (Datenschutz);
   liegen sie lokal vor oder liefert SEMA die Webfont-Dateien, hier ein @font-face ergänzen. */
:root {
  --gruen: #97C00E;
  --gruen-dunkel: #7CA00B;
  --gruen-text: #4F6B07;
  --ink: #121212;
  --soft: #3A3F35;
  --muted: #6B7263;
  --line: #E2E5DB;
  --paper: #F4F5F0;
  --tint: #F1F7DF;
  --weiss: #FFFFFF;
  --warn: #B23B30;
  --warn-bg: #FBEEEC;
  --amber: #8A6400;
  --amber-bg: #FBF3DF;
  --font-head: "Rubik", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --font-body: "Hind Vadodara", "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-head); text-transform: uppercase; letter-spacing: -0.4px; font-weight: 500; margin: 0; color: var(--ink); }
h1 { font-size: 34px; line-height: 1.07; }
h2 { font-size: 20px; line-height: 1.15; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--gruen-text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
.wrap { max-width: 620px; margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: 1180px; }

/* Kopf: Wortmarke, darunter das grüne Band */
header.top { background: var(--weiss); }
header.top .bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; max-width: 620px; margin: 0 auto; }
header.top.wide .bar { max-width: 1180px; }
header.top .band { height: 5px; background: var(--gruen); }
.logo { display: block; height: 30px; color: var(--gruen); }
.logo svg { display: block; height: 100%; width: auto; }
.kicker { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; }

main { padding: 44px 0 32px; }
main.admin { padding: 26px 0 32px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.lead { font-size: 17px; line-height: 1.55; color: var(--soft); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--weiss); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.hinweis { display: flex; align-items: flex-start; gap: 12px; background: var(--tint); border-radius: 10px; padding: 15px 18px; font-size: 15px; line-height: 1.45; color: var(--soft); }
.hinweis svg { flex-shrink: 0; margin-top: 2px; }
.alert { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 13px 16px; font-size: 15px; }
.ok { background: var(--tint); color: var(--gruen-text); border-radius: 10px; padding: 14px 18px; font-size: 15px; line-height: 1.5; }
.ok strong { color: var(--ink); }

/* Formular */
.feld { display: flex; flex-direction: column; gap: 7px; }
.feld.kurz { max-width: 220px; }
label { font-size: 14px; font-weight: 600; color: var(--soft); letter-spacing: 0.2px; }
input, textarea { width: 100%; font-family: inherit; font-size: 17px; color: var(--ink); background: var(--weiss); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 16px; outline: none; }
input { height: 50px; padding: 0 16px; }
input:focus, textarea:focus { border-color: var(--gruen-dunkel); box-shadow: 0 0 0 3px rgba(151, 192, 14, 0.25); }
input[readonly] { background: var(--paper); color: var(--muted); }
.was { font-size: 13px; color: var(--muted); }
.err { font-size: 13px; color: var(--warn); font-weight: 600; }

button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 26px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; letter-spacing: 0.1px;
  background: var(--gruen); color: var(--ink); border: 1.5px solid var(--gruen); border-radius: 15px; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: var(--gruen-dunkel); border-color: var(--gruen-dunkel); }
.button.sekundaer, button.sekundaer { background: var(--weiss); color: var(--ink); border-color: var(--ink); }
.button.sekundaer:hover, button.sekundaer:hover { background: var(--paper); }
button.voll, .button.voll { width: 100%; }
.aktionen { display: flex; gap: 14px; flex-wrap: wrap; }
.aktionen > form, .aktionen > .button { flex: 1 1 200px; }
.aktionen form button { width: 100%; }

/* Datentabelle Kundenseite */
table.daten { width: 100%; border-collapse: collapse; }
table.daten th { text-align: left; width: 42%; padding: 13px 16px 13px 0; font-size: 15px; font-weight: 600; color: var(--muted); vertical-align: top; border-bottom: 1px solid var(--line); }
table.daten td { padding: 13px 0; font-size: 15px; vertical-align: top; border-bottom: 1px solid var(--line); }
table.daten tr:last-child th, table.daten tr:last-child td { border-bottom: 0; }

button:focus-visible, .button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--gruen-text); outline-offset: 2px; }
.nurvorlesen { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
button.alslink { height: auto; padding: 0; background: none; border: none; color: var(--gruen-text); font-size: 14px; font-weight: 400; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
button.alslink:hover { background: none; color: var(--ink); }
footer.fuss { border-top: 1px solid var(--line); padding: 22px 0 30px; }
footer.fuss p { font-size: 13px; color: var(--muted); line-height: 1.5; }
footer.fuss p + p { margin-top: 6px; font-size: 12px; }

/* ---------- Backoffice ---------- */
.adminnav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.adminnav a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; font-size: 15px; }
.adminnav a.active { color: var(--ink); border-bottom-color: var(--gruen); }
.adminnav a:hover { color: var(--ink); }
.adminnav a.right { margin-left: auto; font-weight: 400; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.stat { background: var(--weiss); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; min-width: 130px; font-size: 14px; color: var(--muted); }
.stat .n { font-family: var(--font-head); font-size: 28px; font-weight: 500; color: var(--ink); line-height: 1.1; }
.stat.offen .n { color: var(--amber); }
.stat.bestaetigt .n { color: var(--gruen-text); }
.stat.korrigiert .n { color: var(--ink); }
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.filter input { flex: 1 1 280px; height: 44px; font-size: 15px; }
.filter button { height: 44px; padding: 0 18px; }
.filter .links { display: flex; gap: 12px; }
.filter .links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.filter .links a.active { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
table.list { width: 100%; border-collapse: collapse; background: var(--weiss); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--paper); text-transform: uppercase; letter-spacing: 0.4px; }
table.list tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.offen { background: var(--amber-bg); color: var(--amber); }
.badge.bestaetigt { background: var(--tint); color: var(--gruen-text); }
.badge.korrigiert { background: #E8EDF7; color: #274B8A; }
.badge.locked { background: var(--warn-bg); color: var(--warn); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.karten { display: flex; flex-direction: column; gap: 14px; }
.karten .card h2 { margin-bottom: 6px; }
.karten .card p { margin-bottom: 10px; font-size: 15px; color: var(--soft); }
code { background: var(--tint); padding: 1px 6px; border-radius: 4px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }
code.pin { font-size: 22px; letter-spacing: 0.14em; font-weight: 700; color: var(--ink); background: var(--tint); padding: 4px 12px; border-radius: 8px; }
.locklist { margin: 6px 0 10px; padding-left: 20px; font-size: 14px; }
.locklist li { margin: 3px 0; }
.sub { margin: 0; }
.sub + .sub { margin-top: 12px; }

@media (max-width: 760px) {
  h1 { font-size: 27px; }
  main { padding: 28px 0 26px; }
  .wrap { padding: 0 20px; }
  header.top .bar { padding: 16px 20px; }
  .logo { height: 26px; }
  .card { padding: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  table.list { font-size: 14px; }
  table.daten th { width: 45%; font-size: 14px; }
  table.daten td { font-size: 14px; }
}

/* Abstands- und Hilfsklassen — ersetzen Inline-Styles, die die CSP (style-src 'self') sonst verwirft */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-26 { margin-top: 26px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.my-14 { margin: 8px 0 14px; }
.my-16 { margin: 16px 0; }
.gap-16 { gap: 16px; }
.gap-18 { gap: 18px; }
.gap-20 { gap: 20px; }
.tabellenkarte { padding: 6px 28px; }
.schmal { max-width: 420px; }
.linksbuendig { align-self: flex-start; }
.zeile { display: flex; align-items: center; gap: 9px; }
.zeile.oben { align-items: flex-start; }
.kontrollkaestchen { width: 18px; height: 18px; flex: 0 0 auto; }
.normalgewicht { font-weight: 400; color: var(--muted); }
input.datei { height: auto; padding: 12px 16px; }

/* ---- V1: verdeckter PIN, Vergleichstabelle, Rückmeldefeld der HubSpot-Übertragung */

/* Der Unschärfefilter ist reine Anzeige und KEIN Schutz: der echte PIN steht erst nach
   dem Freischalten im HTML. Was hier unscharf steht, ist ein Platzhalter. */
code.pin.verdeckt { filter: blur(5px); user-select: none; color: var(--muted); }

/* Breite Tabellen scrollen in ihrem eigenen Bereich; die Seite selbst bleibt schmal. */
.tabellenraum { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.vergleich { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--weiss); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 15px; }
table.vergleich th, table.vergleich td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.vergleich thead th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--paper); text-transform: uppercase; letter-spacing: 0.4px; }
table.vergleich tbody th { font-weight: 600; color: var(--muted); width: 24%; }
table.vergleich tr:last-child td, table.vergleich tr:last-child th { border-bottom: 0; }

.rueckmeldefeld > h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 10px; }
.rueckmeldefeld .ok, .rueckmeldefeld .alert, .rueckmeldefeld .hinweis { margin-bottom: 10px; }
.rueckmeldefeld .alert:last-child, .rueckmeldefeld .ok:last-child, .rueckmeldefeld .hinweis:last-child { margin-bottom: 0; }
/* Die Herkunft ist die Angabe, die Verwechslungen vermeidet: System, HubSpot oder keine
   Antwort. Sie wird deshalb hervorgehoben und steht nicht im Fließtext. */
.herkunft { font-weight: 600; }
.nowrap { white-space: nowrap; }
button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Gefahrenbereich: der einzige Weg, auf dem Kundendaten aus dieser Anwendung
   verschwinden. Rot, abgesetzt, und hinter einer Rueckfrage. */
.card.gefahr { border-color: var(--warn); background: var(--warn-bg); }
button.gefahr, .button.gefahr { background: var(--warn); border-color: var(--warn); color: var(--weiss); }
button.gefahr:hover, .button.gefahr:hover { background: #8E2E25; border-color: #8E2E25; }

/* Die Rueckfrage ist eine Ueberlagerung ohne JavaScript: sie ist unsichtbar, bis der
   Knopf sie ueber :target anspricht. Die Oberflaeche traegt kein Skript (CSP
   script-src 'none'), ein confirm() waere hier also gar nicht moeglich. */
.ueberlagerung { display: none; }
.ueberlagerung:target { display: flex; position: fixed; inset: 0; z-index: 50;
  align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto;
  background: rgba(18, 18, 18, 0.55); }
.ueberlagerung .dialog { width: 100%; max-width: 640px; padding: 26px; background: var(--weiss);
  border: 1.5px solid var(--warn); border-radius: 10px; }
.ueberlagerung .dialog h2 { margin-top: 0; }

/* Schlagworte im Protokoll. Sie sollen im Ueberfliegen wirken, deshalb je Gruppe eine
   eigene Farbe, aber alle gedeckt: die Liste ist zum Lesen da, nicht zum Leuchten. */
.tagleiste { display: flex; gap: 8px; flex-wrap: wrap; }
.tagleiste .tagfilter { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 12px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--weiss);
  font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.tagleiste .tagfilter:hover { border-color: var(--ink); }
.tagleiste .tagfilter.aktiv { background: var(--ink); border-color: var(--ink); color: var(--weiss); }
.tagleiste .tagfilter.aktiv .muted { color: var(--line); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.2px; white-space: nowrap; background: var(--paper); color: var(--soft); border: 1px solid var(--line); }
.tag-sicherheit { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.tag-anmeldung { background: var(--tint); color: var(--gruen-text); border-color: var(--gruen); }
.tag-kunde { background: var(--weiss); color: var(--ink); border-color: var(--ink); }
.tag-pin { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.tag-import, .tag-export { background: var(--paper); color: var(--soft); border-color: var(--soft); }
.tag-hubspot { background: var(--tint); color: var(--soft); border-color: var(--soft); }
.tag-verwaltung { background: var(--paper); color: var(--muted); border-color: var(--muted); }

/* Der Loeschbereich ist zugeklappt. Er soll gefunden werden, wenn jemand ihn sucht, und
   nicht danebenliegen, wenn jemand nur eine Korrektur durchgeht. <details> kann das ohne
   JavaScript; die Seite traegt kein Skript. */
details.gefahrbereich > summary { display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
  font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--muted);
  list-style: none; }
details.gefahrbereich > summary::-webkit-details-marker { display: none; }
details.gefahrbereich > summary::before { content: "▸"; font-size: 12px; }
details.gefahrbereich[open] > summary { color: var(--warn); border-color: var(--warn); }
details.gefahrbereich[open] > summary::before { content: "▾"; }
details.gefahrbereich > summary:hover { border-color: var(--warn); color: var(--warn); }
details.gefahrbereich > summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
