/* ============================================================================
 *  pipeline.css – Lead-Center
 *
 *  Nutzt die Farbwelt des Cockpits (Code Geass: Schwarz, Violett, Gold) aus
 *  styles.css. Hier stehen nur die Ergänzungen für die Lead-Ansicht.
 *
 *  Mobil zuerst: Sinan öffnet das unterwegs, kurz vor einem Besuch. Deshalb
 *  große Tap-Ziele, eine Spalte, und die wichtigsten Angaben ohne Aufklappen.
 * ========================================================================== */

.pl { padding: clamp(1rem, 3vw, 2rem); max-width: 68rem; margin: 0 auto; }

.pl-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.pl-kopf h1 {
  font-family: 'Bricolage', system-ui, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.pl-unter { margin: 0.25rem 0 0; color: var(--text-3); font-size: 0.88rem; }

/* --- Kennzahlen -------------------------------------------------------------- */
.pl-kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 1px;
  background: var(--linie-fein);
  border: 1px solid var(--linie-fein);
  border-radius: var(--r-gross, 16px);
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.pl-kachel { background: var(--fl-1); padding: 0.85rem 0.9rem; }
.pl-kachel b {
  display: block;
  font-family: 'Bricolage', system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pl-kachel span { font-size: 0.72rem; color: var(--text-3); letter-spacing: 0.03em; }
.pl-kachel--hot b { color: var(--gefahr); }

/* --- Filter ------------------------------------------------------------------ */
.pl-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 1rem;
}
.pl-chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-2);
  background: var(--fl-2);
  border: 1px solid var(--linie);
  border-radius: 99px;
  padding: 0.42rem 0.9rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pl-chip:hover { color: var(--text); border-color: var(--akzent-linie); }
.pl-chip.is-an {
  background: var(--akzent-weich);
  color: var(--akzent-hell);
  border-color: var(--akzent-linie);
}
.pl-suche {
  flex: 1 1 10rem;
  min-width: 8rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--fl-2);
  border: 1px solid var(--linie);
  border-radius: 99px;
  padding: 0.42rem 0.95rem;
}
.pl-suche:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }

/* --- Lead-Zeile -------------------------------------------------------------- */
.pl-liste { display: flex; flex-direction: column; gap: 0.5rem; }

.pl-lead {
  background: var(--fl-1);
  border: 1px solid var(--linie-fein);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.pl-lead:hover { border-color: var(--linie); }
.pl-lead.is-offen { border-color: var(--akzent-linie); }

.pl-lead__kopf {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.pl-lead__titel { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.pl-lead__titel strong {
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-meta { font-size: 0.79rem; color: var(--text-3); }
.pl-person { font-size: 0.79rem; color: var(--gold); }

.pl-lead__rechts { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }

/* --- Priorität und Score ----------------------------------------------------- */
.pl-prio {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
}
.pl-prio--HOT { color: var(--gefahr); background: var(--gefahr-weich); }
.pl-prio--HIGH { color: var(--warn); background: var(--warn-weich); }
.pl-prio--MEDIUM { color: var(--text-3); background: var(--fl-3); }
.pl-prio--LOW { color: var(--text-3); background: transparent; }

.pl-score { display: flex; align-items: center; gap: 0.4rem; }
.pl-score__bar {
  width: 42px;
  height: 4px;
  background: var(--fl-3);
  border-radius: 99px;
  overflow: hidden;
}
.pl-score__bar i { display: block; height: 100%; background: var(--akzent); }
.pl-score b {
  font-size: 0.76rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 1.5em;
}

.pl-stufe {
  font-size: 0.72rem;
  color: var(--c, var(--text-2));
  border: 1px solid color-mix(in srgb, var(--c, #666) 40%, transparent);
  border-radius: 5px;
  padding: 0.14rem 0.44rem;
}

/* --- Aufgeklappt ------------------------------------------------------------- */
.pl-lead__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--linie-fein);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.pl-problem { margin: 0.9rem 0 0; font-size: 0.92rem; line-height: 1.55; }
.pl-chance { margin: 0; font-size: 0.86rem; color: var(--text-2); line-height: 1.5; }
.pl-chance span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-3);
  margin-bottom: 0.15rem;
}

.pl-kontakt { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.86rem; }
.pl-kontakt a { color: var(--akzent-hell); text-decoration: none; }
.pl-kontakt a:hover { text-decoration: underline; }
.pl-demo { color: var(--gold) !important; font-weight: 600; }

.pl-feld { display: flex; flex-direction: column; gap: 0.3rem; }
.pl-feld > span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.pl-feld select,
.pl-notiz input {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--fl-2);
  border: 1px solid var(--linie);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  width: 100%;
}
.pl-notiz { display: flex; gap: 0.45rem; }

.pl-btn {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  background: var(--fl-3);
  border: 1px solid var(--linie);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  white-space: nowrap;
}
.pl-btn:hover { border-color: var(--akzent-linie); }
.pl-btn--primaer {
  background: var(--akzent-weich);
  color: var(--akzent-hell);
  border-color: var(--akzent-linie);
}
.pl-btn[disabled] { opacity: 0.6; cursor: default; }

.pl-altnotiz {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-2);
  background: var(--fl-2);
  border-left: 2px solid var(--linie);
  padding: 0.5rem 0.7rem;
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}

.pl-verlauf summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-3);
  padding: 0.2rem 0;
}
.pl-verlauf ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.pl-verlauf li { font-size: 0.82rem; color: var(--text-2); line-height: 1.45; }
.pl-verlauf time { display: block; font-size: 0.72rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

.pl-leer { padding: 2.5rem 1rem; text-align: center; color: var(--text-3); }

/* --- Handy ------------------------------------------------------------------- */
@media (max-width: 620px) {
  .pl-lead__kopf { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .pl-lead__rechts { width: 100%; justify-content: space-between; }
  .pl-lead__titel strong { white-space: normal; }
  .pl-kopf { flex-direction: column; }
  .pl-notiz { flex-direction: column; }
  .pl-btn { width: 100%; }
}

/* Erklaert, warum HOT ueber einer hoeheren Punktzahl steht. Ohne diesen Satz
   wirkt die Liste falsch sortiert - und der Nutzer verliert das Vertrauen in
   die Reihenfolge, nach der er eigentlich arbeiten soll. */
.pl-hinweis {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-2);
  background: var(--fl-2);
  border-left: 2px solid var(--akzent-linie);
  border-radius: 0 8px 8px 0;
}
.pl-hinweis b { color: var(--gefahr); }
.pl-hinweis em { font-style: normal; color: var(--akzent-hell); }

.pl-mehr { margin: 1rem 0 0; text-align: center; font-size: 0.82rem; color: var(--text-3); }


/* --- Recherchetext ------------------------------------------------------------
   Maschinell erzeugt und bei jedem Lauf neu geschrieben - deshalb optisch klar
   von Sinans eigener Notiz getrennt und nicht bearbeitbar. Zugeklappt, weil
   die Texte lang sind (bis 2.400 Zeichen) und die Liste sonst zerfaellt. */
.pl-rech {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  border-left: 2px solid var(--linie);
  padding-left: 0.65rem;
}
.pl-rech > summary {
  cursor: pointer;
  color: var(--text-3);
  font-size: 0.76rem;
  user-select: none;
}
.pl-rech > summary:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.pl-rech p {
  margin: 0.45rem 0 0;
  line-height: 1.6;
  color: var(--text-2);
}
.pl-rech__q { font-size: 0.72rem; color: var(--text-3); }
