/* Huntercockpit – handgeschriebenes Stylesheet. Farbwelt: Graphit / Stein / Signal-Orange. */

@font-face {
  font-family: "Barlow";
  src: url("/static/fonts/barlow-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/static/fonts/barlow-semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/static/fonts/barlow-condensed-semibold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --graphit: #171A1C;
  --graphit-hell: #2A2F33;
  --stein: #F5F3EF;
  --stein-dunkel: #E8E4DC;
  --orange: #FF5A1F;
  --orange-dunkel: #D94A15;
  --orange-hell: #FFEDE5;
  --gruen: #2E9E5B;
  --text: #23272A;
  --text-dezent: #6B7176;
  --radius: 10px;
  --schatten: 0 2px 12px rgba(23, 26, 28, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Barlow", system-ui, sans-serif;
  background: var(--stein);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
}

h1, h2, h3 {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}
h1 { font-size: 1.8rem; margin: 0.6rem 0 1rem; }
h2 { font-size: 1.3rem; margin: 1.6rem 0 0.6rem; }
.mono, .lead-telefon { font-family: "IBM Plex Mono", monospace; }
.dezent { color: var(--text-dezent); font-weight: 400; }

/* ---------- Kopfzeile ---------- */
.kopf {
  background: var(--graphit);
  color: var(--stein);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1rem;
  flex-wrap: wrap;
}
.logo {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--stein);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.logo span { color: var(--orange); }
.logo-gross { font-size: 2rem; display: block; text-align: center; margin-bottom: 1.2rem; }
.kopf-aktionen { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.inline { display: inline; }

/* ---------- Aufklappmenü ---------- */
.menu { position: relative; }
.menu-knopf {
  list-style: none;
  cursor: pointer;
  color: var(--stein);
  background: transparent;
  border-radius: var(--radius);
  padding: 0.5rem 0.8rem;
  font-size: 1.3rem;
  line-height: 1;
  user-select: none;
}
.menu-knopf::-webkit-details-marker { display: none; }
.menu-knopf::marker { content: ""; }
.menu-knopf:hover, .menu[open] .menu-knopf { background: var(--graphit-hell); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  min-width: 200px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  z-index: 45;
}
.menu-panel a {
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 0.8rem;
  border-radius: 7px;
  font-weight: 600;
}
.menu-panel a:hover { background: var(--stein); }
.menu-panel a.aktiv { color: var(--orange); }
.menu-abmelden {
  border-top: 1px solid var(--stein-dunkel);
  margin-top: 0.3rem;
  padding-top: 0.3rem;
}
.menu-abmelden button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-dezent);
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  border-radius: 7px;
  cursor: pointer;
}
.menu-abmelden button:hover { background: var(--stein); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--stein-dunkel);
  color: var(--text);
  text-decoration: none;
  text-align: center;
}
.btn:hover { filter: brightness(0.96); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dunkel); filter: none; }
.btn-ghost { background: transparent; color: inherit; opacity: 0.8; }
/* Löschen ist bewusst unauffällig, aber eindeutig als Rückbau erkennbar */
.btn-loeschen { background: transparent; color: #B3261E; border: 2px solid currentColor; }
.btn-loeschen:hover { background: #B3261E; color: var(--stein); filter: none; }
.btn-ghost:hover { opacity: 1; background: rgba(0,0,0,0.06); filter: none; }
.kopf .btn-ghost { color: var(--stein); }
.kopf .btn-ghost:hover { background: var(--graphit-hell); }
.btn-breit { width: 100%; }
.btn-klein { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.taste {
  display: inline-block;
  background: rgba(0,0,0,0.18);
  border-radius: 5px;
  padding: 0 0.45em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85em;
  margin-right: 0.3em;
}
.btn-ghost .taste, .queue-leer .taste { background: var(--stein-dunkel); color: var(--text); }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 900px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.zurueck { color: var(--text-dezent); text-decoration: none; }

/* ---------- Gauges ---------- */
.gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin: 0.5rem 0 1.2rem;
}
.gauges-2 { grid-template-columns: repeat(2, 1fr); }
.gauge {
  background: #fff;
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  box-shadow: var(--schatten);
}
.gauge-wert {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.7rem;
  line-height: 1.1;
}
.gauge-ziel { font-size: 1rem; color: var(--text-dezent); }
.gauge-label { color: var(--text-dezent); font-size: 0.85rem; margin-top: 0.15rem; }
.gauge-balken {
  height: 5px;
  background: var(--stein-dunkel);
  border-radius: 3px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.gauge-fuellung { height: 100%; background: var(--orange); border-radius: 3px; }

/* ---------- Lead-Karte ---------- */
.lead-karte {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1.4rem;
  border-left: 5px solid transparent;
}
@keyframes blitz-gruen { 0% { border-left-color: var(--gruen); } 100% { border-left-color: transparent; } }
@keyframes blitz-orange { 0% { border-left-color: var(--orange); } 100% { border-left-color: transparent; } }
.blitz-gruen { animation: blitz-gruen 0.9s ease-out; }
.blitz-orange { animation: blitz-orange 0.9s ease-out; }

.karte-meta { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.badge {
  background: var(--stein-dunkel);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.badge-wv { background: var(--orange); color: #fff; }
.position { color: var(--text-dezent); font-size: 0.85rem; }
.lead-name { font-size: 2.2rem; margin: 0.7rem 0 0.1rem; }
.lead-branche { color: var(--text-dezent); font-size: 1.05rem; margin-top: 0.15rem; }
.tabelle .nicht-umbrechen { white-space: nowrap; }
.lead-telefon {
  display: inline-block;
  font-size: 1.7rem;
  color: var(--graphit);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 3px solid var(--orange);
  margin: 0.4rem 0 0.8rem;
  word-break: break-all;
}
.lead-telefon-klein { font-size: 1.2rem; }

/* Ansprechpartner der Firma – die aktive Auswahl landet im Call-Log */
.personen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0.2rem 0 0.6rem;
}
/* Hält Name und Durchwahl zusammen, damit beim Umbruch nichts verrutscht */
.person-block { display: inline-flex; align-items: center; gap: 0.35rem; }
.person {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 2px solid var(--stein-dunkel);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
}
.person input { position: absolute; opacity: 0; width: 0; height: 0; }
.person:has(input:checked) { border-color: var(--orange); background: var(--orange-hell); }
.person:has(input:focus-visible) { outline: 2px solid var(--graphit); outline-offset: 2px; }
.person-name { font-weight: 600; }
.person-rolle { color: var(--text-dezent); font-size: 0.85rem; }
.person-tel {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--orange-dunkel);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.person-formular {
  border-top: 1px solid var(--stein-dunkel);
  padding-top: 0.8rem;
  margin-top: 0.8rem;
}
.person-aktionen { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.lead-notiz {
  background: var(--stein);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 0.6rem 0;
  white-space: pre-wrap;
}
.historie summary { cursor: pointer; color: var(--text-dezent); margin: 0.5rem 0; }
.historie ul, .historie-liste { list-style: none; margin: 0.4rem 0; }
.historie li, .historie-liste li { padding: 0.25rem 0; border-bottom: 1px solid var(--stein-dunkel); font-size: 0.95rem; }

.notiz-zeile { margin: 0.8rem 0 0; }
.notiz-zeile input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--orange);
  border-radius: 8px;
  font: inherit;
}

.log-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 1.1rem;
}
.btn-log { padding: 1rem 0.5rem; font-size: 1.05rem; min-height: 58px; }
.btn-grau { background: var(--stein-dunkel); }
.btn-dunkel { background: var(--graphit); color: var(--stein); }
.sekundaer-aktionen {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

/* ---------- Queue leer ---------- */
.queue-leer {
  text-align: center;
  padding: 3.5rem 1rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
.leer-symbol {
  width: 64px; height: 64px;
  line-height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--gruen);
  color: #fff;
  font-size: 2rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  background: var(--graphit);
  color: var(--stein);
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  box-shadow: var(--schatten);
  display: flex;
  gap: 0.8rem;
  align-items: center;
  z-index: 40;
  max-width: min(92vw, 560px);
}
.toast-undo {
  background: none;
  border: none;
  color: var(--orange);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

/* ---------- Formulare ---------- */
.formular { margin: 1rem 0; max-width: 640px; }
.formular-raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem 1rem;
}
label { display: block; margin-bottom: 0.7rem; font-weight: 600; font-size: 0.92rem; }
input, select, textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--stein-dunkel);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  background: #fff;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}
.fehler { color: #C0261B; margin: 0.6rem 0; font-weight: 600; }
.erfolg { color: var(--gruen); margin: 0.6rem 0; font-weight: 600; }
.hinweis { color: var(--orange-dunkel); margin: 0.6rem 0; }
.inline-form { display: flex; gap: 0.4rem; align-items: center; }
.inline-form input { margin-top: 0; width: auto; }

/* ---------- Overlay (Schnellerfassung) ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 26, 28, 0.55);
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem;
  overflow-y: auto;
}
.overlay[hidden] { display: none; }
.overlay-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1.3rem;
  width: 100%;
  max-width: 460px;
}
.overlay-kopf { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.overlay-buttons { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }

dialog {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1.3rem;
  width: min(92vw, 380px);
}
dialog::backdrop { background: rgba(23, 26, 28, 0.55); }
dialog h3 { margin-bottom: 0.8rem; }
.wv-schnell { margin-top: 0.6rem; }
.wv-zeit { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Tabellen ---------- */
.tabellen-scroll { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--schatten); }
.tabelle { width: 100%; border-collapse: collapse; min-width: 560px; }
.tabelle th, .tabelle td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--stein-dunkel); }
.tabelle thead th {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  color: var(--text-dezent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tabelle tfoot th { border-top: 2px solid var(--graphit); }
.tabelle a { color: inherit; font-weight: 600; text-decoration: none; }
.zeile-klickbar { cursor: pointer; }
.zeile-klickbar:hover { background: var(--stein); }
.leer-zeile { color: var(--text-dezent); text-align: center; padding: 2rem !important; }
.faellig td { background: #FFF1EA; }
.status-punkt {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 0.45em;
  background: var(--text-dezent);
}
.status-neu { background: #3D7BD9; }
.status-wiedervorlage { background: var(--orange); }
.status-termin { background: var(--gruen); }
.status-kein_interesse { background: var(--graphit); }
.status-archiviert { background: var(--stein-dunkel); }
.filter-zeile { display: flex; gap: 0.6rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.filter-zeile input { flex: 1; min-width: 200px; margin-top: 0; }
.filter-zeile select { width: auto; margin-top: 0; }
.balken-zelle { width: 30%; min-width: 90px; }
.balken { height: 10px; background: var(--orange); border-radius: 5px; min-width: 2px; }

/* ---------- Login ---------- */
.login-seite {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--graphit);
}
.login-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  width: min(92vw, 380px);
  box-shadow: var(--schatten);
}

/* ---------- Offline ---------- */
.offline-hinweis {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: #C0261B;
  color: #fff;
  text-align: center;
  padding: 0.5rem;
  z-index: 60;
  font-weight: 600;
}

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
  .kopf { padding: 0.5rem 0.7rem; gap: 0.5rem; }
  .inhalt { padding: 0.8rem 0.8rem 7.5rem; }
  .lead-name { font-size: 1.7rem; }
  .lead-telefon { font-size: 1.45rem; }
  /* Ergebnis-Buttons daumenerreichbar am unteren Rand */
  .log-buttons {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--stein);
    padding: 0.6rem 0.8rem calc(0.6rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(23, 26, 28, 0.15);
    margin: 0;
    z-index: 30;
  }
  .btn-log { min-height: 60px; font-size: 0.98rem; padding: 0.6rem 0.3rem; }
  .toast { bottom: 6.2rem; }
  .gauge-wert { font-size: 1.35rem; }
  .gauge { padding: 0.55rem 0.65rem; }
}
