/* 504Labs CRM: Regeln aus DESIGN.md der Website. Schwarz, Weiß, zwei Grautöne, Hanken Grotesk.
   Keine Karten: Einträge sind Zeilen mit Haarlinien. Rundung nur für Bedienung (999px)
   und das eine Objekt, das Lead-Blatt (18px) auf schwarzer Fläche. */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --black: #000;
  --white: #fff;
  --quiet: #5c5c5c;
  --line: #d9d9d9;
  --gutter: clamp(1rem, 3.5vw, 3rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem; line-height: 1.5; background: var(--white); color: var(--black);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
::selection { background: var(--black); color: var(--white); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { padding-inline: var(--gutter); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

/* Bedienung */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.5rem; padding: 0 1.25rem; border: 1px solid var(--black); border-radius: 999px;
  background: var(--black); color: var(--white); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--white); color: var(--black); }
.btn-line { background: transparent; color: var(--black); }
.btn-line:hover { background: var(--black); color: var(--white); }
.link { font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; }
.link:hover { text-decoration-thickness: 2px; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 1.5rem; height: 4.25rem; padding-inline: var(--gutter); }
.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--black); text-decoration: none; font-weight: 600; }
.brand img { filter: invert(1); width: 7.25rem; height: auto; display: block; }
.brand span { padding-left: 0.75rem; border-left: 1px solid var(--line); font-size: 1.0625rem; }
.nav-tools { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.suche input {
  width: 14rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit;
  padding: 0.35rem 0; transition: box-shadow 0.15s, border-color 0.15s; border-radius: 0;
}
.suche input:focus { outline: none; border-color: var(--black); box-shadow: 0 1px 0 var(--black); }

/* Felder */
.feld { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.feld > span { font-weight: 500; font-size: 0.9375rem; }
.feld input, .feld select, .feld textarea {
  font: inherit; color: inherit; width: 100%; background: transparent; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--line); padding: 0.4rem 0; transition: box-shadow 0.15s, border-color 0.15s;
}
.feld textarea { resize: vertical; min-height: 5.5rem; line-height: 1.5; }
.feld select {
  appearance: none; padding-right: 1.5rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23000' stroke-width='1.2'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.2rem center;
}
.feld input:focus, .feld select:focus, .feld textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 1px 0 var(--black); }
.hinweis { color: var(--quiet); font-size: 0.9375rem; min-height: 1.4em; }

/* Anmeldung */
.login { padding-block: clamp(4rem, 12vh, 8rem); max-width: 40rem; }
.login h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; }
.lead { margin-top: 1.5rem; font-size: clamp(1.125rem, 2vw, 1.375rem); color: var(--quiet); letter-spacing: -0.012em; }
.login-form { margin-top: 2.5rem; display: grid; gap: 1.5rem; max-width: 24rem; justify-items: start; }
.login-form .feld { width: 100%; }

/* Kopf mit Kennzahlen und Trichter */
.kopf { padding-top: 2.5rem; padding-bottom: 1.5rem; display: grid; gap: 1.75rem; }
.kopf h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; }
.kennzahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--black); }
.kennzahlen div { padding: 0.9rem 1rem 0 0; }
.kennzahlen div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.kennzahlen dt { font-size: 0.9375rem; color: var(--quiet); }
.kennzahlen dd { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.trichter { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 0.75rem; }
.trichter li { display: grid; gap: 0.35rem; font-size: 0.9375rem; }
.trichter .zeile { display: flex; justify-content: space-between; gap: 0.5rem; }
.trichter .zahl { font-weight: 600; }
.trichter .spur { height: 2px; background: var(--line); }
.trichter .balken { height: 2px; background: var(--black); width: 0; transition: width 0.4s var(--ease); }

/* Board: Spalten mit Haarlinien, Einträge als Zeilen */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15.5rem, 1fr);
  border-top: 1px solid var(--line); overflow-x: auto; min-height: 60vh;
  scroll-snap-type: x proximity; padding-inline: calc(var(--gutter) - 0.75rem);
  scroll-padding-inline: calc(var(--gutter) - 0.75rem);
}
.trichter-titel { font-size: 0.9375rem; color: var(--quiet); margin-bottom: -1rem; }
.spalte { display: flex; flex-direction: column; padding: 0 0.75rem 3rem; scroll-snap-align: start; min-width: 0; transition: background 0.15s; }
.spalte + .spalte { border-left: 1px solid var(--line); }
.spalte.ziel { background: #f2f2f2; }
.spalte header { padding: 1rem 0 0.75rem; border-bottom: 1px solid var(--black); }
.spalte h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; display: flex; justify-content: space-between; }
.spalte h2 span { font-weight: 400; color: var(--quiet); }
.spalte header p { font-size: 0.875rem; color: var(--quiet); min-height: 1.3em; }
.spalte ul { list-style: none; }
.spalte .leer { padding: 1rem 0; color: var(--quiet); font-size: 0.9375rem; }
.eintrag {
  display: block; width: 100%; text-align: left; padding: 0.8rem 0.6rem; margin-inline: -0.6rem; width: calc(100% + 1.2rem);
  border-bottom: 1px solid var(--line); transition: background 0.15s, color 0.15s; cursor: pointer;
}
.eintrag:hover, .eintrag:focus-visible { background: var(--black); color: var(--white); outline: none; }
.eintrag:hover .klein, .eintrag:focus-visible .klein { color: #a6a6a6; }
.eintrag:hover .wv, .eintrag:focus-visible .wv { border-color: var(--white); }
.eintrag:hover .wv.faellig, .eintrag:focus-visible .wv.faellig { background: var(--white); color: var(--black); }
.eintrag.zieht { opacity: 0.35; }
.eintrag strong { display: block; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.klein { display: block; font-size: 0.875rem; color: var(--quiet); line-height: 1.4; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.45rem; }
.wv { font-size: 0.8125rem; padding: 0.05rem 0.55rem; border: 1px solid var(--black); border-radius: 999px; white-space: nowrap; }
.wv.faellig { background: var(--black); color: var(--white); }

/* Lead-Blatt: das eine Objekt auf schwarzer Fläche */
.schicht {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.9);
  display: flex; justify-content: center; align-items: flex-start; overflow-y: auto;
  padding: clamp(0.75rem, 4vh, 3rem) clamp(0.75rem, 3vw, 2rem);
}
.blatt {
  background: var(--white); border-radius: 18px; width: min(52rem, 100%);
  padding: clamp(1.25rem, 4vw, 2.75rem); display: grid; gap: 2rem;
  animation: auf 0.35s var(--ease);
}
@keyframes auf { from { opacity: 0; transform: translateY(12px); } }
.blatt-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.blatt-kopf h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; overflow-wrap: anywhere; }
.blatt-kopf p { color: var(--quiet); margin-top: 0.35rem; }
.schliessen { width: 2.5rem; height: 2.5rem; border-radius: 999px; border: 1px solid var(--black); flex: none; font-size: 1.25rem; line-height: 1; }
.schliessen:hover { background: var(--black); color: var(--white); }
.stufen { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stufe {
  min-height: 2.25rem; padding: 0 1rem; border: 1px solid var(--black); border-radius: 999px; font-size: 0.9375rem; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.stufe:hover { background: #ececec; }
.stufe[aria-pressed="true"] { background: var(--black); color: var(--white); font-weight: 600; }
.abschnitt { display: grid; gap: 1rem; }
.abschnitt > h3 { font-size: 1.0625rem; font-weight: 600; padding-bottom: 0.5rem; border-bottom: 1px solid var(--black); }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; }
.raster .breit { grid-column: 1 / -1; }
.mailto { font-size: 0.875rem; color: var(--quiet); }
.mailto a { color: inherit; }
.fragebogen { white-space: pre-wrap; font-size: 0.9375rem; color: var(--quiet); border-left: 1px solid var(--line); padding-left: 1rem; }
.notiz-form { display: grid; gap: 0.75rem; justify-items: start; }
.notiz-form .feld { width: 100%; }
.verlauf { list-style: none; }
.verlauf li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; }
.verlauf time { font-size: 0.875rem; color: var(--quiet); }
.verlauf .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.verlauf .notiz .text { font-weight: 500; }
.verlauf .sys .text { color: var(--quiet); }
.blatt-fuss { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 1rem; border-top: 1px solid var(--line); }

.meldung {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 1rem); z-index: 60;
  background: var(--black); color: var(--white); border-radius: 999px; padding: 0.55rem 1.25rem; font-size: 0.9375rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.3s var(--ease); max-width: calc(100% - 2rem);
}
.meldung.an { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .suche input { width: 9rem; }
  .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kennzahlen div:nth-child(3) { border-left: 0; padding-left: 0; }
  .trichter { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
  .board { grid-auto-columns: minmax(82vw, 1fr); }
}
@media (max-width: 560px) {
  .nav-in { gap: 0.75rem; }
  .brand img { width: 5.5rem; }
  .brand span { padding-left: 0.5rem; }
  .suche { display: none; }
  .nav-tools { gap: 0.75rem; }
  .btn { padding: 0 1rem; }
  .raster { grid-template-columns: 1fr; }
  .verlauf li { grid-template-columns: 1fr; gap: 0.15rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
