/* ============================================================
   Nabel Outreach CRM — Design „V7 Gold-Rosé — Helle Variante"
   Farben aus Nabels YouTube-Brand (Brand Guide v2.0), hell gedreht:
   Cream #F7EFE9 (Fläche) · Warmweiß-Cards · Ink #1A1517 (Text)
   Gold #E8B741 (CTAs, Verlauf #FFF7EA→#E8B741 sparsam) · Rosé #E5A9B3
   Mauve #6E4550 · Sidebar/Login bleiben Midnight als Brand-Anker.
   Punkte-Textur (Brand) zart in Mauve auf der Cream-Fläche.
   ============================================================ */
:root {
  --bg: #f7efe9;
  --panel: #fffdfa;
  --panel2: #fbf5ef;
  --field: #ffffff;
  --ink: #1a1517;
  --muted: #8a7a7e;
  --line: #eadfd6;
  --line-soft: #f1e8e0;
  --midnight: #121012;
  --deep: #0c0a0b;
  --gold: #e8b741;
  --gold-text: #a67c17;
  --gold-soft: rgba(232, 183, 65, 0.16);
  --gold-glow: rgba(232, 183, 65, 0.28);
  --rose: #e5a9b3;
  --rose-text: #b25b6c;
  --rose-soft: rgba(229, 169, 179, 0.2);
  --mauve: #6e4550;
  --blue: #3b82f6;
  --blue-soft: #e7f0fe;
  --green: #1e9e5a;
  --green-soft: #e4f6ea;
  --green-text: #166534;
  --danger: #cf3a30;
  --danger-soft: #fbe9e6;
  --radius: 14px;
  --radius-s: 9px;
  --shadow-1: 0 1px 2px rgba(26, 21, 23, 0.05), 0 1px 8px rgba(26, 21, 23, 0.04);
  --shadow-2: 0 6px 22px rgba(110, 69, 80, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  /* Brand-Fläche hell: nie flach — zarte Mauve-Punkte + Rosé-Wash + Cream-Verlauf */
  background-image:
    radial-gradient(rgba(110, 69, 80, 0.07) 1px, transparent 1.4px),
    radial-gradient(1100px 640px at 88% -8%, rgba(229, 169, 179, 0.16), transparent 62%),
    linear-gradient(165deg, #fff9f1 0%, #f7efe9 55%, #f0e5dc 100%);
  background-size: 20px 20px, auto, auto;
  background-attachment: fixed;
}

::selection { background: var(--gold); color: #121012; }

/* Dezente warme Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #d8c9be transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #d8c9be; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #c4b2a5; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Sidebar: Midnight-Brand-Anker mit Punkte-Textur ---------- */
.sidebar {
  background-color: var(--midnight);
  background-image:
    radial-gradient(rgba(244, 194, 194, 0.12) 1px, transparent 1.4px),
    linear-gradient(180deg, #201619 0%, #121012 60%, #0c0a0b 100%);
  background-size: 20px 20px, auto;
  color: #f7efe9;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong {
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Monogramm: das eine Gold-Verlauf-Element (Brand-Regel) */
.mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7ea 0%, #e8b741 100%);
  color: #121012;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(232, 183, 65, 0.35), 0 4px 14px rgba(0, 0, 0, 0.4);
}

.brand small,
.muted {
  color: var(--muted);
}

.sidebar .muted,
.sidebar small {
  color: #a08e92;
}

.company-tabs {
  display: grid;
  gap: 8px;
}

.company-tabs button,
.toolbar select,
.toolbar input {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  font: inherit;
}

.company-tabs button {
  min-height: 42px;
  padding: 10px 14px;
  background: rgba(247, 239, 233, 0.06);
  border-color: rgba(247, 239, 233, 0.12);
  color: #f7efe9;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.company-tabs button:hover {
  background: rgba(247, 239, 233, 0.12);
  border-color: rgba(232, 183, 65, 0.45);
}

.company-tabs button.active {
  background: linear-gradient(135deg, #fff7ea 0%, #e8b741 100%);
  border-color: var(--gold);
  color: #121012;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(232, 183, 65, 0.3);
}

.side-panel {
  padding-top: 12px;
  border-top: 1px solid rgba(247, 239, 233, 0.12);
}

.side-panel summary {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.side-panel summary::-webkit-details-marker {
  display: none;
}

.side-panel summary::after {
  content: "+";
  float: right;
  color: var(--gold);
}

.side-panel[open] summary::after {
  content: "-";
}

.side-panel p,
.side-panel li {
  color: rgba(247, 239, 233, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.side-panel ul {
  padding-left: 18px;
}

/* ---------- Hauptfläche ---------- */
main {
  min-width: 0;
  padding: 28px 30px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold-text);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.09em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: 30px;
  font-weight: 900;
  position: relative;
}

/* Rosé-Signaturlinie (Brand-Element) unter dem Seitentitel */
h1::after {
  content: "";
  position: absolute;
  left: 1px;
  bottom: -8px;
  width: 64px;
  height: 3px;
  border-radius: 3px;
  background: var(--rose);
  box-shadow: 0 0 10px rgba(229, 169, 179, 0.6);
}

.toolbar {
  display: flex;
  gap: 10px;
}

.toolbar input,
.toolbar select {
  padding: 11px 14px;
  background: var(--field);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.toolbar input {
  width: min(42vw, 420px);
}

.toolbar input::placeholder { color: var(--muted); }
.toolbar input:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin: 26px 0 22px;
}

.metric,
.stage,
.table-wrap,
.detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.metric {
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}

.metric:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #fff7ea, var(--gold) 45%, var(--rose));
}

.metric small {
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 900;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stage {
  padding: 14px;
  min-height: 120px;
}

.stage h2 {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #4d4247;
}

.pill {
  display: inline-flex;
  min-width: 28px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 800;
}

.stage-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  margin-bottom: 8px;
  cursor: pointer;
  background: var(--field);
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}

.stage-card:hover {
  border-color: var(--gold);
  box-shadow: 0 3px 12px rgba(232, 183, 65, 0.18);
  transform: translateY(-1px);
}

.stage-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.stage-card small {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.table-wrap {
  overflow: hidden;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  list-style: none;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.section-head span { color: var(--muted); font-size: 13px; }

.section-head::-webkit-details-marker {
  display: none;
}

.lead-scroll {
  max-height: 620px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

th:nth-child(1),
td:nth-child(1) {
  width: 72px;
}

th:nth-child(2),
td:nth-child(2) {
  width: auto;
}

th:nth-child(3),
td:nth-child(3) {
  width: 132px;
}

th:nth-child(4),
td:nth-child(4) {
  width: 190px;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--panel2);
  position: sticky;
  top: 0;
  z-index: 2;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(232, 183, 65, 0.08);
}

/* Status-Chips — Farben folgen den Pipeline-Gruppen des Dashboards:
   grau=offen · blau=bereit · gold=kontaktiert · grün=Antwort · rot=raus */
.status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f0eae4;
  color: #6e6266;
  font-weight: 700;
  white-space: nowrap;
}

.status.new,
.status.research_needed {
  background: #f0eae4;
  color: #6e6266;
}

.status.ready_to_contact {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.status.contacted,
.status.follow_up_1,
.status.follow_up_2,
.status.follow_up_3 {
  background: #f9efd4;
  color: #8a6200;
}

.status.replied,
.status.info_requested,
.status.meeting_ready {
  background: var(--green-soft);
  color: var(--green-text);
}

.status.won {
  background: var(--green);
  color: #fff;
}

.status.do_not_contact,
.status.not_interested,
.status.archived {
  background: var(--danger-soft);
  color: var(--danger);
}

.detail {
  padding: 18px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  overflow-wrap: anywhere;
}

.detail dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 8px;
  margin: 16px 0;
}

.quick-actions label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-actions select,
.quick-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  min-width: 0;
}

.quick-actions button {
  align-self: end;
  padding: 0 12px;
  background: var(--gold);
  border-color: var(--gold);
  color: #121012;
  font-weight: 800;
  cursor: pointer;
  transition: box-shadow 0.12s;
}

.quick-actions button:hover { box-shadow: 0 3px 14px var(--gold-glow); }

.btn-report {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
  font-weight: 700;
}

.btn-no-report {
  background: var(--panel2) !important;
  color: var(--muted) !important;
  cursor: not-allowed !important;
}

.report-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
}

.detail dt {
  color: var(--muted);
}

.detail dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail a {
  color: var(--gold-text);
  font-weight: 600;
}

.company-chip {
  display: inline-flex;
  width: 36px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--gold-soft);
  color: var(--gold-text);
  font-weight: 900;
  white-space: nowrap;
}

.lead-meta,
td .muted {
  display: block;
}

.lead-meta {
  margin: 3px 0 2px;
  color: #6e6266;
  font-size: 12px;
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metrics,
  .pipeline,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar,
  .toolbar {
    flex-direction: column;
    width: 100%;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
  }
}

/* ===== Login: bleibt Midnight — der Brand-Moment ===== */
.login-overlay[hidden] {
  display: none;
}
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background-color: var(--midnight);
  background-image:
    radial-gradient(rgba(244, 194, 194, 0.13) 1px, transparent 1.4px),
    radial-gradient(900px 560px at 80% -5%, rgba(229, 169, 179, 0.09), transparent 60%),
    linear-gradient(165deg, #201619 0%, #121012 55%, #0c0a0b 100%);
  background-size: 20px 20px, auto, auto;
}
.login-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  background: #1a1517;
  border: 1px solid rgba(232, 183, 65, 0.25);
  border-radius: 16px;
  padding: 36px 44px;
  min-width: 320px;
  color: #f7efe9;
  box-shadow: 0 0 40px rgba(232, 183, 65, 0.16), 0 24px 60px rgba(0, 0, 0, 0.6);
}
.login-card h2 { margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.login-card .muted { color: #a08e92; }
.login-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #2e2629;
  border-radius: var(--radius-s);
  background: #161215;
  color: #f7efe9;
  font: inherit;
}
.login-card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 183, 65, 0.16); }
.login-card button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-s);
  background: linear-gradient(135deg, #fff7ea 0%, #e8b741 100%);
  color: #121012;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(232, 183, 65, 0.16);
}
.login-error { color: #f2919b; font-size: 13px; min-height: 18px; margin: 0; }

/* ===== Posteingang ===== */
.inbox-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
}
.inbox-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 0;
}
.inbox-list {
  border-right: 1px solid var(--line);
  max-height: 480px;
  overflow: auto;
}
.inbox-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  display: grid;
  gap: 3px;
}
.inbox-item:hover { background: rgba(232, 183, 65, 0.07); }
.inbox-item.active { background: var(--gold-soft); }
.inbox-item.pending { border-left: 3px solid var(--gold); }
.inbox-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.inbox-item .cat {
  font-size: 11px;
  white-space: nowrap;
  color: var(--rose-text);
  font-weight: 700;
}
.inbox-detail { padding: 18px; max-height: 480px; overflow: auto; }
.mail-body {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 12px;
  font-size: 13px;
  white-space: pre-wrap;
  max-height: 160px;
  overflow: auto;
  margin-bottom: 14px;
}
.draft-label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.draft-label input, #draftBody {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.draft-label input:focus, #draftBody:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
#draftBody { resize: vertical; }
.draft-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.btn-send {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.btn-send:hover { box-shadow: 0 3px 14px rgba(30, 158, 90, 0.35); }
.btn-send:disabled { opacity: 0.6; cursor: wait; }
.btn-dismiss {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.btn-dismiss:hover { border-color: var(--muted); }
.sent-banner {
  background: var(--green-soft);
  color: var(--green-text);
  border-radius: var(--radius-s);
  padding: 12px;
  font-weight: 700;
}
.pad { padding: 14px; }

/* ===== Lead-Detail Erweiterungen ===== */
.next-action-edit, .notes-edit { display: grid; gap: 6px; margin: 14px 0; }
.next-action-edit label, .notes-edit label { font-size: 12px; font-weight: 700; color: var(--muted); display: grid; gap: 4px; }
.next-action-edit input, .notes-edit textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.next-action-edit input:focus, .notes-edit textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.next-action-edit button, .notes-edit button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--gold);
  color: #121012;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  justify-self: start;
  padding: 0 14px;
}
.next-action-edit button:hover, .notes-edit button:hover { box-shadow: 0 3px 12px var(--gold-glow); }
.timeline { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.timeline h3 { font-size: 14px; margin-bottom: 10px; }
.timeline-item { margin-bottom: 10px; }
.timeline-item small { color: var(--muted); }
.timeline-item p { margin: 2px 0 0; font-size: 13px; }

/* ===== Aktivität ===== */
.activity-wrap { margin-top: 18px; }
.activity { list-style: none; margin: 0; padding: 8px 16px 16px; max-height: 320px; overflow: auto; }
.activity li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.activity li small { color: var(--muted); margin-right: 8px; }
.event-type {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose-text);
  font-size: 11px;
  font-weight: 800;
  margin-right: 6px;
}

@media (max-width: 1100px) {
  .inbox-grid { grid-template-columns: 1fr; }
  .inbox-list { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ===== Analysen & Dokumente ===== */
.documents { margin: 16px 0; border-top: 1px solid var(--line); padding-top: 12px; }
.documents h3 { font-size: 14px; margin-bottom: 10px; }
.doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  flex-wrap: wrap;
}
.doc-type {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.doc-webseiten-analyse { background: var(--green-soft); color: var(--green-text); }
.doc-entscheider-analyse { background: #f9efd4; color: #8a6200; }
.doc-neue-webseite { background: var(--rose-soft); color: var(--rose-text); }
.doc-angebot { background: #ffe9dc; color: #b45309; }
.doc-title { flex: 1; min-width: 120px; overflow-wrap: anywhere; }
.doc-open {
  color: #121012 !important;
  background: var(--gold);
  padding: 4px 10px;
  border-radius: var(--radius-s);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.doc-open:hover { box-shadow: 0 2px 10px var(--gold-glow); }

/* ===== Skill-Leitfaden (Häkchen-Liste) ===== */
.skill-steps { position: relative; margin: 4px 0 8px; }
.skill-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0 7px 2px;
  position: relative;
  font-size: 13px;
}
.skill-step::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 30px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}
.skill-step:last-child::before { display: none; }
.step-check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  z-index: 1;
  border: 2px solid var(--line);
  background: var(--field);
  color: #fff;
}
.skill-step.done .step-check { background: var(--green); border-color: var(--green); }
.skill-step.open .step-label, .skill-step.open small { opacity: 0.55; }
.step-label { flex: 1; font-weight: 600; }
.extra-docs { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.extra-docs h4 { font-size: 12px; color: var(--muted); margin: 0 0 6px; }

/* ===== Skill-Fortschritt ===== */
.skill-progress { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.skill-bar { flex: 1; height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.skill-bar > div { height: 100%; background: linear-gradient(90deg, var(--gold), #f4d488); transition: width .3s; }

/* ---------- Heute fällig (Wiedervorlagen + Sequenz-Schritte) ---------- */
.due-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
}
.due-list { padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.due-item {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-s);
  cursor: pointer; background: #fffaf0;
}
.due-item:hover { background: #fdf3da; border-color: var(--gold); }
.due-item.seq { background: #f2f7ff; }
.due-item.seq:hover { border-color: var(--blue); }
.due-tag {
  font-size: 11px; font-weight: 700; color: #8a6200; background: #f9efd4;
  padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.due-item.seq .due-tag { color: #1d4ed8; background: var(--blue-soft); }
.due-item small { color: var(--muted); }

/* ---------- Lead-Detail: Gesperrt- und Sequenz-Hinweise ---------- */
.blocked-badge {
  background: var(--danger-soft); color: var(--danger); border: 1px solid #f3cfc9;
  border-radius: var(--radius-s); padding: 8px 12px; font-size: 13px; font-weight: 600;
}
.seq-badge {
  background: var(--blue-soft); color: #1d4ed8; border: 1px solid #cfe0fb;
  border-radius: var(--radius-s); padding: 8px 12px; font-size: 13px;
}

/* ---------- KI-Chat (FAB bleibt Midnight-Brand-Anker) ---------- */
.chat-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; cursor: pointer;
  font-size: 26px; background: linear-gradient(160deg, #201619, #0c0a0b);
  border: 1px solid rgba(232, 183, 65, 0.55);
  color: #fff; box-shadow: 0 0 20px rgba(232, 183, 65, 0.25), 0 8px 24px rgba(26, 21, 23, 0.35);
  transition: transform 0.12s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-panel {
  position: fixed; right: 26px; bottom: 96px; z-index: 60;
  width: min(420px, calc(100vw - 40px)); height: min(560px, calc(100vh - 140px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(110, 69, 80, 0.3);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: linear-gradient(160deg, #201619, #0c0a0b); color: #f7efe9;
}
.chat-head .muted { flex: 1; font-size: 11px; color: var(--rose); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head button {
  border: none; background: rgba(247, 239, 233, 0.12); color: #f7efe9;
  border-radius: 6px; padding: 4px 9px; cursor: pointer; font-size: 13px;
}
.chat-head button:hover { background: rgba(247, 239, 233, 0.24); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; background: var(--bg);
}
.chat-msg {
  max-width: 88%; padding: 10px 13px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user { align-self: flex-end; background: var(--midnight); color: #f7efe9; border-bottom-right-radius: 4px; }
.chat-msg.assistant { align-self: flex-start; background: var(--field); border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow-1); }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; outline: none;
  background: var(--field); color: var(--ink);
}
.chat-input input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.chat-input button {
  border: none; background: var(--gold); color: #121012; font-weight: 800;
  border-radius: 10px; padding: 0 16px; cursor: pointer; font-size: 16px;
}
.chat-input button:hover { box-shadow: 0 3px 14px var(--gold-glow); }
.chat-input button:disabled { opacity: 0.5; cursor: wait; }

/* ---------- Kanban mit Voll-Ansicht, Suche, Drag & Drop ---------- */
.stage { max-height: 420px; display: flex; flex-direction: column; }
.stage h2 { flex-shrink: 0; }
.stage-search {
  flex-shrink: 0; width: 100%; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 10px; font-size: 12.5px; outline: none;
  background: var(--field); color: var(--ink);
}
.stage-search::placeholder { color: var(--muted); }
.stage-search:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.stage-body { flex: 1; overflow-y: auto; min-height: 0; padding-right: 2px; }
.stage-card:active { cursor: grabbing; }
.stage.drag-over { outline: 2px dashed var(--gold); outline-offset: -4px; background: #fdf6e2; }
.stage-more {
  width: 100%; border: 1px dashed var(--line); background: var(--panel2); color: var(--muted);
  border-radius: var(--radius-s); padding: 8px; cursor: pointer; font-size: 12.5px;
}
.stage-more:hover { border-color: var(--gold); color: var(--gold-text); }
.stage-empty { padding: 6px 2px; font-size: 12.5px; }

/* ---------- Bulk-Aktionen + Tabelle (Bulk-Leiste = Midnight-Anker) ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 14px 10px; padding: 10px 14px;
  background: linear-gradient(160deg, #201619, #0c0a0b);
  border: 1px solid rgba(232, 183, 65, 0.4);
  color: #f7efe9; border-radius: var(--radius);
}
.bulk-bar select {
  border-radius: 6px; border: 1px solid #2e2629; padding: 6px 8px;
  background: #161215; color: #f7efe9;
}
.bulk-bar button {
  border: none; border-radius: 6px; padding: 7px 12px; cursor: pointer;
  background: rgba(247, 239, 233, 0.14); color: #f7efe9; font-size: 12.5px;
}
.bulk-bar button:hover { background: rgba(247, 239, 233, 0.26); }
.bulk-bar .btn-danger { background: var(--danger); color: #fff; }
.bulk-bar .btn-danger:hover { background: #e04c42; }
.table-tools { display: flex; justify-content: flex-end; margin: 0 14px 8px; }
.table-tools button {
  border: 1px solid var(--line); background: var(--field); border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 12.5px; color: var(--muted);
}
.table-tools button:hover { color: var(--gold-text); border-color: var(--gold); }
.sel-cell { width: 34px; text-align: center; }
.sel-cell input { cursor: pointer; }
input[type="checkbox"] { accent-color: var(--gold); }
tr.row-selected { background: #fdf3da !important; }

/* ---------- E-Mail-Compose + Sequenz-Editor im Lead-Detail ---------- */
.compose-box {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-top: 12px; background: var(--panel2);
}
.compose-box h3 { margin: 0 0 10px; font-size: 14px; }
.compose-box input { background: var(--field); color: var(--ink); }
.compose-box textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 9px 11px; font-size: 13px; font-family: inherit; resize: vertical;
  background: var(--field); color: var(--ink);
}
.compose-box textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.seq-step {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; margin: 10px 0;
  background: var(--field);
}
.seq-step legend { font-size: 12px; font-weight: 700; color: var(--rose-text); padding: 0 6px; }

/* ---------- Überblick-Dashboard (Städte × Branchen) ---------- */
.overview-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 20px;
}
.overview-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 10px 18px 4px; font-size: 12px; color: var(--muted);
}
.overview-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Gruppen-Farben (Statusgruppen der Pipeline) */
.g-offen { background: #cfc5bc; }
.g-bereit { background: #7fb2f7; }
.g-kontaktiert { background: #e8b741; }
.g-antwort { background: #47c97d; }
.g-kunde { background: #15803d; }
.g-raus { background: #ef7268; }

.stack-bar {
  display: flex; height: 14px; border-radius: 7px; overflow: hidden;
  background: #efe7df; min-width: 140px;
}
.stack-bar i { display: block; height: 100%; }

.gbadge {
  display: inline-block; min-width: 20px; text-align: center;
  padding: 1px 7px; margin: 1px 2px; border-radius: 20px;
  font-size: 11.5px; font-weight: 800; color: #1a1517;
}
.gbadge.g-kunde, .gbadge.g-raus { color: #fff; }

.ov-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; padding: 12px 18px 18px;
}
.ov-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field);
  padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.ov-card:hover { box-shadow: var(--shadow-2); border-color: var(--gold); transform: translateY(-2px); }
.ov-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.ov-card-head strong { font-size: 15px; font-weight: 800; }
.ov-card-stats { line-height: 1.9; }

.ov-table { width: calc(100% - 36px); margin: 6px 18px 18px; border-collapse: collapse; font-size: 13px; }
.ov-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.ov-table td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.ov-table .num { text-align: right; white-space: nowrap; }
.ov-table .bar-col { width: 24%; min-width: 150px; }
.ov-city { cursor: pointer; }
.ov-city:hover td { background: rgba(232, 183, 65, 0.08); }
.ov-segs > td { background: var(--panel2); padding: 4px 8px 10px; }
.ov-subtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ov-subtable td { padding: 6px 8px; border-bottom: 1px dashed var(--line); color: #4d4247; }
.ov-subtable .bar-col { width: 24%; min-width: 140px; }

/* ---------- Drilldown Branche → Leads + Lead-Detail-Fenster ---------- */
.ov-seg-row { cursor: pointer; }
.ov-seg-row:hover td { background: var(--rose-soft); }
.seg-caret { display: inline-block; width: 14px; color: var(--rose-text); }
.ov-seg-leads > td { background: #f4ece5; padding: 8px 10px 12px; }
.ov-lead-list { display: flex; flex-direction: column; gap: 6px; }
.ov-lead {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 9px 13px; cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ov-lead:hover { border-color: var(--gold); box-shadow: 0 3px 12px rgba(232, 183, 65, 0.2); }
.ov-lead .status { font-size: 11px; }
.ov-lead-seq { font-size: 11px; color: #1d4ed8; background: var(--blue-soft); border-radius: 20px; padding: 1px 8px; }
.ov-lead-block { font-size: 12px; }
.ov-lead-action { margin-left: auto; color: var(--muted); max-width: 40%; text-align: right; }

.lead-modal { position: fixed; inset: 0; z-index: 80; }
.lead-modal[hidden] { display: none; }
.lead-modal-backdrop { position: absolute; inset: 0; background: rgba(26, 21, 23, 0.55); backdrop-filter: blur(2px); }
.lead-modal-card {
  position: relative; margin: 4vh auto; width: min(680px, calc(100vw - 32px));
  max-height: 92vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--gold);
  border-radius: 16px; box-shadow: 0 0 40px rgba(232, 183, 65, 0.2), 0 24px 64px rgba(26, 21, 23, 0.4);
}
.lead-modal-close {
  position: sticky; top: 10px; margin-left: calc(100% - 46px); z-index: 2;
  width: 34px; height: 34px; border: none; border-radius: 50%; cursor: pointer;
  background: var(--midnight); color: #f7efe9; font-size: 15px;
}
.lead-modal-close:hover { background: var(--danger); }
.modal-detail { padding: 0 22px 22px; border: none !important; position: static; max-height: none; box-shadow: none; }

/* ---------- v2.7: Bereichs-Navigation & Organisation ---------- */
.main-nav { display: grid; gap: 6px; }
.main-nav button {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 9px 13px;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: transparent; color: #d8ccc6;
  font: inherit; font-weight: 600; font-size: 14px;
  text-align: left; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.main-nav button:hover { background: rgba(247, 239, 233, 0.08); color: #f7efe9; }
.main-nav button.active {
  background: var(--gold-soft);
  border-color: rgba(232, 183, 65, 0.5);
  color: var(--gold);
}
.main-nav button span { flex: 1; }
.nav-badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--gold); color: #121012;
  font-size: 11px; font-weight: 800; font-style: normal;
}
.side-sep {
  margin-top: 4px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em; color: #a08e92;
}

.view[hidden] { display: none; }
.view-hint {
  background: var(--panel2); border: 1px dashed var(--line);
  border-radius: var(--radius-s); padding: 10px 14px;
  font-size: 13px; color: var(--muted); margin: 0 0 14px;
}

/* Posteingang-Filter-Chips */
.inbox-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px 4px;
}
.chip {
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--field); color: var(--muted);
  padding: 6px 13px; font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: border-color 0.12s, color 0.12s;
}
.chip b { font-weight: 800; color: inherit; }
.chip:hover { border-color: var(--gold); color: var(--gold-text); }
.chip.active { background: var(--gold); border-color: var(--gold); color: #121012; }

/* Kanban: zuklappbare Spalten */
.stage-head { cursor: pointer; user-select: none; }
.stage-head:hover { color: var(--gold-text); }
.stage.collapsed { min-height: 0; max-height: none; padding-bottom: 10px; }
.stage.collapsed .stage-head { margin-bottom: 0; }

/* ---------- v2.7.1: Posteingang Firmen-Chip + KI-Buttons ---------- */
.inbox-company {
  display: inline-block; min-width: 26px; text-align: center;
  padding: 0 6px; margin-right: 4px; border-radius: 5px;
  background: var(--gold-soft); color: var(--gold-text);
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.03em;
}
.ai-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.ai-actions button {
  border: 1px solid var(--gold); border-radius: var(--radius-s);
  background: var(--gold-soft); color: var(--gold-text);
  padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
}
.ai-actions button:hover { background: var(--gold); color: #121012; box-shadow: 0 3px 12px var(--gold-glow); }
.ai-actions button:disabled { opacity: 0.5; cursor: wait; }
