/* Vertriebsliste teamwerk – eigenes Stylesheet, keine externen Abhängigkeiten. */

:root {
  --blau: #1f3a5f;
  --blau-hell: #2f5a8f;
  --bg: #f4f6f9;
  --karte: #ffffff;
  --rand: #dfe4ea;
  --text: #1f2d3d;
  --text-grau: #6b7785;
  --gruen: #1f8a4c;
  --rot: #c0392b;
  --orange: #e08e0b;
  --orange-bg: #fdf3e2;
  --schatten: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--blau-hell); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--blau);
  color: #fff;
  box-shadow: var(--schatten);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { color: #fff; font-weight: 700; font-size: 18px; }
.brand span { color: #9fc1e8; font-weight: 400; }
.brand:hover { text-decoration: none; }
.mainnav { display: flex; gap: 6px; flex: 1; }
.mainnav a {
  color: #cdd9e6;
  padding: 6px 12px;
  border-radius: 6px;
}
.mainnav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.mainnav a.active { background: rgba(255,255,255,0.18); color: #fff; }
.user-area { display: flex; align-items: center; gap: 14px; }
.user-name { color: #cdd9e6; font-size: 14px; }

/* ---------- Layout ---------- */
.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.footer {
  text-align: center;
  color: var(--text-grau);
  font-size: 13px;
  padding: 20px;
}
.page-title { margin: 0 0 20px; font-size: 24px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.page-head .page-title { margin: 0; }
.page-actions { display: flex; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blau); color: #fff; }
.btn-primary:hover { background: var(--blau-hell); }
.btn-secondary { background: #fff; color: var(--blau); border-color: var(--blau); }
.btn-secondary:hover { background: #eef3f9; }
.btn-ghost { background: transparent; color: var(--text-grau); border-color: var(--rand); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--rot); color: #fff; }
.btn-danger:hover { background: #a93224; }
.btn-block { width: 100%; }
.btn-mini { padding: 3px 10px; font-size: 13px; background: var(--blau); color: #fff; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 70vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px;
  padding: 36px; width: 360px; box-shadow: var(--schatten);
}
.login-title { margin: 0 0 4px; font-size: 22px; color: var(--blau); }
.login-title span { color: var(--blau-hell); font-weight: 400; }
.login-sub { margin: 0 0 22px; color: var(--text-grau); }

/* ---------- Formularfelder ---------- */
.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label { font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-grau); }
.input {
  padding: 8px 10px; border: 1px solid var(--rand); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; width: 100%;
}
.input:focus { outline: none; border-color: var(--blau-hell); box-shadow: 0 0 0 2px rgba(47,90,143,0.15); }
textarea.input { min-height: 90px; resize: vertical; }
.field-error { color: var(--rot); font-size: 12px; margin-top: 4px; }

/* ---------- Flash ---------- */
.flash-area { margin-bottom: 18px; }
.flash {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 14px;
  border: 1px solid transparent;
}
.flash-success { background: #e7f6ed; color: var(--gruen); border-color: #bce4cc; }
.flash-danger  { background: #fbeaea; color: var(--rot);   border-color: #f0c4c0; }
.flash-warning { background: var(--orange-bg); color: var(--orange); border-color: #f3dcad; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.kpi {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px;
  padding: 18px 20px; box-shadow: var(--schatten);
}
.kpi-zahl { font-size: 28px; font-weight: 700; color: var(--blau); }
.kpi-label { color: var(--text-grau); font-size: 13px; margin-top: 4px; }
.kpi-wide { grid-column: span 2; }

/* ---------- Karten / Spalten ---------- */
.dash-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px; margin-bottom: 18px;
}
.card {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px;
  padding: 18px 20px; box-shadow: var(--schatten);
}
.card-title { margin: 0 0 14px; font-size: 16px; }

/* ---------- Balken ---------- */
.balken-liste { list-style: none; margin: 0; padding: 0; }
.balken-liste li {
  display: grid; grid-template-columns: 150px 1fr 36px; align-items: center;
  gap: 10px; margin-bottom: 8px;
}
.balken-label { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balken-track { background: #eef1f5; border-radius: 4px; height: 14px; overflow: hidden; }
.balken-fill { display: block; height: 100%; background: var(--blau-hell); border-radius: 4px; min-width: 2px; }
.balken-wert { text-align: right; font-size: 13px; font-weight: 600; }

/* ---------- Mini-Listen ---------- */
.mini-liste { list-style: none; margin: 0; padding: 0; }
.mini-liste li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--rand);
}
.mini-liste li:last-child { border-bottom: none; }
.datum { color: var(--text-grau); font-size: 13px; }
.datum-rot { color: var(--rot); font-weight: 600; font-size: 13px; }
.leer { color: var(--text-grau); font-style: italic; }

/* ---------- Filterbar ---------- */
.filterbar {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  margin-bottom: 16px; box-shadow: var(--schatten);
}
.filter-feld { display: flex; flex-direction: column; }
.filter-feld label { font-size: 12px; font-weight: 600; color: var(--text-grau); margin-bottom: 4px; }
.filter-feld select, .filter-feld input {
  padding: 7px 9px; border: 1px solid var(--rand); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; min-width: 150px;
}
.filter-suche input { min-width: 220px; }
.filter-buttons { flex-direction: row; gap: 8px; }
.ergebnis-zahl { color: var(--text-grau); font-size: 13px; margin: 0 0 10px; }

/* ---------- Tabelle ---------- */
.tabelle-wrap { overflow-x: auto; }
.lead-tabelle {
  width: 100%; border-collapse: collapse; background: var(--karte);
  border: 1px solid var(--rand); border-radius: 10px; overflow: hidden;
  box-shadow: var(--schatten); font-size: 14px;
}
.lead-tabelle th, .lead-tabelle td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rand);
  white-space: nowrap;
}
.lead-tabelle thead th { background: #eef2f7; font-size: 13px; }
.lead-tabelle th.num, .lead-tabelle td.num { text-align: right; }
.lead-tabelle tbody tr:hover { background: #f7f9fc; }
.lead-tabelle .klickbar { cursor: pointer; }
.sortlink { color: var(--text); font-weight: 600; }
.zeile-link { font-weight: 600; }
.wv-rot { color: var(--rot); font-weight: 700; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap; color: #fff;
}
.badge-neu          { background: #7b8794; }
.badge-brief        { background: #2f80ed; }
.badge-nachfass     { background: #8e44ad; }
.badge-erreicht     { background: #16a085; }
.badge-termin       { background: #0a8754; }
.badge-unterlagen   { background: #2d9cdb; }
.badge-angebot      { background: #d68910; }
.badge-abschluss    { background: #1f8a4c; }
.badge-kein-interesse { background: #c0392b; }
.badge-wiedervorlage { background: #e08e0b; }
.badge-aufnahme-ja  { background: var(--gruen); }
.badge-aufnahme-nein { background: #7b8794; }

.warn-pill {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 10px;
  background: var(--orange-bg); color: var(--orange); font-size: 11px; font-weight: 700;
  border: 1px solid #f3dcad;
}

/* ---------- Hinweis-Box ---------- */
.hinweis {
  border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
}
.hinweis-orange { background: var(--orange-bg); border: 1px solid #f3dcad; color: #92610a; }

.badge-zeile { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.anruf-box { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-grau); }
.inline-form { display: inline; }

/* ---------- Lead-Formular ---------- */
.lead-form {
  background: var(--karte); border: 1px solid var(--rand); border-radius: 10px;
  padding: 22px 24px; box-shadow: var(--schatten);
}
.form-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px;
}
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: span 3; }
.form-actions { margin-top: 14px; display: flex; gap: 10px; }
.loesch-form { margin-top: 24px; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2, .form-grid .span3 { grid-column: span 1; }
  .kpi-wide { grid-column: span 1; }
}

/* ---------- Legende ---------- */
.legende-intro { color: var(--text-grau); margin: -8px 0 20px; max-width: 760px; }
.card p { font-size: 14px; line-height: 1.55; margin: 0 0 12px; }
.legende-steps, .legende-bullets { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.legende-steps li, .legende-bullets li { margin-bottom: 6px; }
.legende-status { list-style: none; margin: 0; padding: 0; }
.legende-status li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--rand);
}
.legende-status li:last-child { border-bottom: none; }
.legende-status .badge { flex: 0 0 168px; }
.legende-status-text { font-size: 14px; line-height: 1.5; color: var(--text); }
.legende-farben { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.legende-farben li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.farb-chip { width: 16px; height: 16px; border-radius: 4px; flex: 0 0 16px; }
.chip-rot { background: var(--rot); }
.chip-orange { background: #e08e0b; }
.chip-gruen { background: var(--gruen); }
.chip-grau { background: #7b8794; }

@media (max-width: 760px) {
  .legende-status li { flex-direction: column; gap: 4px; }
  .legende-status .badge { flex: none; }
}

/* ---------- Kontakte / Vorgänge (Kontakt-Umbau) ---------- */
.vorgang-pill {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 10px;
  background: #e8eef6; color: #1f3a5f; font-size: 11px; font-weight: 700;
  border: 1px solid #cdd9e8;
}

.hinweis-info { background: #eef4fb; border: 1px solid #cdd9e8; color: #1f3a5f; }

.card-hinweis { color: var(--text-grau); font-size: 13px; margin: -6px 0 14px; }

/* Kontakt-Kopf auf der Vorgang-Bearbeiten-Seite */
.kontakt-kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 14px 18px; flex-wrap: wrap;
}
.kontakt-kopf-haupt { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.kontakt-kopf-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-grau);
}
.kontakt-kopf-name { font-size: 17px; font-weight: 700; }
.kontakt-kopf-person { color: var(--text-grau); font-size: 14px; }

/* Checkbox-Felder (neuer Kontakt + Produkt-Mehrfachauswahl) */
.field-checkbox { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.field-checkbox label { margin: 0; font-weight: 600; }

.kontakt-suche-block, .neuer-kontakt-block { margin-top: 8px; }

.produkt-checks ul { list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; }
.produkt-checks li { display: flex; align-items: center; gap: 8px; }
.produkt-checks input[type="checkbox"] { width: auto; }
.produkt-checks label { margin: 0; font-weight: 500; }

@media (max-width: 760px) {
  .produkt-checks ul { grid-template-columns: 1fr; }
}
