/* =====================================================================
   modules/personalliste — Overlay «Anbieter-Liste ausfuellen»
   Aufruf aus Mitarbeiter-Toolbar und Ausbildungsplanung (PLIST.open).
   Design-Tokens aus index.html (:root --brand/--border/--text…).
   ===================================================================== */

#plist-host { position: relative; z-index: 1400; }

.plist-backdrop {
  position: fixed; inset: 0; z-index: 1400;
  background: rgba(16, 26, 36, .52);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.plist-box {
  width: min(1180px, 100%); max-height: calc(100vh - 48px);
  background: var(--surface, #fff); border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  display: flex; flex-direction: column; overflow: hidden;
  font-size: 13px; color: var(--text, #1a232e);
}

/* ---------- Kopf ---------- */
.plist-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--border, #e5e9ee);
}
.plist-head h3 { margin: 0; font-size: 16px; }
.plist-sub { color: var(--text-muted, #677484); font-size: 12px; margin-top: 2px; }
.plist-x {
  border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--text-muted, #677484); padding: 4px 6px; border-radius: 6px;
}
.plist-x:hover { background: var(--bg, #f6f8fa); color: var(--text, #1a232e); }

/* ---------- Schrittleiste ---------- */
.plist-steps {
  display: flex; gap: 6px; padding: 10px 18px;
  background: var(--bg, #f6f8fa); border-bottom: 1px solid var(--border, #e5e9ee);
  flex-wrap: wrap;
}
.plist-step {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim, #98a2b1);
  padding: 3px 10px 3px 4px; border-radius: 999px;
}
.plist-step b {
  display: inline-grid; place-items: center; width: 19px; height: 19px;
  border-radius: 50%; background: var(--border, #e5e9ee);
  color: var(--text-muted, #677484); font-size: 11px;
}
.plist-step.on { color: var(--text, #1a232e); background: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border, #e5e9ee); }
.plist-step.on b { background: var(--brand, #0099cc); color: #fff; }
.plist-step.done b { background: #bbf7d0; color: #14532d; }

/* ---------- Body ---------- */
.plist-body { padding: 16px 18px; overflow: auto; flex: 1; }
.plist-lead { margin: 0 0 14px; color: var(--text-muted, #677484); line-height: 1.5; }
.plist-hint {
  margin: 10px 0; padding: 8px 11px; border-radius: 7px;
  background: var(--brand-soft, #e6f6fc); color: #1c5570; font-size: 12px; line-height: 1.5;
}
.plist-dim { color: var(--text-dim, #98a2b1); }
.plist-err {
  margin: 10px 18px 0; padding: 9px 12px; border-radius: 7px;
  background: #fee2e2; color: #7f1d1d; font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* ---------- Buttons ---------- */
.plist-btn {
  border: 1px solid var(--border-strong, #cbd2db); background: #fff;
  color: var(--text, #1a232e); border-radius: 7px; padding: 7px 13px;
  font-size: 13px; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.plist-btn:hover { background: var(--bg, #f6f8fa); }
.plist-btn.primary { background: var(--brand, #0099cc); border-color: var(--brand, #0099cc); color: #fff; }
.plist-btn.primary:hover { background: var(--brand-dark, #007ba8); }
.plist-btn[disabled] { opacity: .45; cursor: not-allowed; }
.plist-btn.small { padding: 4px 9px; font-size: 12px; }
.plist-inp {
  border: 1px solid var(--border-strong, #cbd2db); border-radius: 7px;
  padding: 7px 10px; font-size: 13px; font-family: inherit; min-width: 180px;
}

/* ---------- Schritt 1: Vorlagen ---------- */
.plist-vlist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.plist-vrow { display: flex; gap: 6px; align-items: stretch; }
.plist-vpick {
  flex: 1; text-align: left; cursor: pointer; font-family: inherit;
  border: 1px solid var(--border, #e5e9ee); border-radius: 8px; background: #fff;
  padding: 10px 13px; display: flex; flex-direction: column; gap: 2px;
}
.plist-vpick:hover { border-color: var(--brand, #0099cc); background: var(--brand-soft, #e6f6fc); }
.plist-vname { font-weight: 600; font-size: 13px; }
.plist-vmeta { color: var(--text-muted, #677484); font-size: 11.5px; }
.plist-vdel {
  border: 1px solid var(--border, #e5e9ee); background: #fff; border-radius: 8px;
  width: 34px; cursor: pointer; color: var(--text-dim, #98a2b1);
}
.plist-vdel:hover { background: #fee2e2; color: #7f1d1d; border-color: #fecaca; }
.plist-upload { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.plist-upload label { cursor: pointer; }

/* ---------- Schritt 2: Mapping ---------- */
.plist-mopts {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 9px 12px; background: var(--bg, #f6f8fa); border-radius: 8px; margin-bottom: 12px;
}
.plist-mopts label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--text-muted, #677484); }
.plist-mopts input, .plist-mopts select {
  border: 1px solid var(--border-strong, #cbd2db); border-radius: 6px;
  padding: 4px 7px; font-size: 12px; font-family: inherit;
}

.plist-map { width: 100%; border-collapse: collapse; }
.plist-map th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted, #677484); font-weight: 600;
  padding: 6px 8px; border-bottom: 1px solid var(--border, #e5e9ee);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.plist-map td { padding: 5px 8px; border-bottom: 1px solid var(--border, #e5e9ee); vertical-align: middle; }
.plist-map tr.plist-mleer { background: #fafbfc; color: var(--text-dim, #98a2b1); }
.plist-col {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  color: var(--text-muted, #677484); text-align: center;
}
.plist-map select, .plist-map input {
  width: 100%; border: 1px solid var(--border-strong, #cbd2db); border-radius: 6px;
  padding: 5px 7px; font-size: 12px; font-family: inherit; background: #fff;
}

.plist-vsave {
  margin-top: 16px; padding: 12px 14px; border-radius: 8px;
  background: var(--bg, #f6f8fa); border: 1px solid var(--border, #e5e9ee);
}
.plist-vsave b { font-size: 12px; }
.plist-vsave-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.plist-vsave-row input {
  flex: 1; min-width: 190px; border: 1px solid var(--border-strong, #cbd2db);
  border-radius: 7px; padding: 7px 10px; font-size: 13px; font-family: inherit;
}

/* ---------- Schritt 3: Personen + Lueckenampel ---------- */
.plist-cols { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .plist-cols { grid-template-columns: 1fr; } }

.plist-pick { border: 1px solid var(--border, #e5e9ee); border-radius: 8px; overflow: hidden; }
.plist-pick-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; background: var(--bg, #f6f8fa);
  border-bottom: 1px solid var(--border, #e5e9ee); font-size: 12px;
}
.plist-pick-head span { display: inline-flex; gap: 4px; }
.plist-search {
  width: 100%; border: 0; border-bottom: 1px solid var(--border, #e5e9ee);
  padding: 8px 10px; font-size: 12px; font-family: inherit; outline: none;
}
.plist-pick-list { max-height: 46vh; overflow: auto; }
.plist-pick-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  font-size: 12.5px; cursor: pointer; border-bottom: 1px solid #f2f4f7;
}
.plist-pick-row:hover { background: var(--brand-soft, #e6f6fc); }

.plist-gap { min-width: 0; }
.plist-gap-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.plist-badge { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.plist-badge.warn { background: #fef3c7; color: #7c2d12; }
.plist-badge.ok { background: #dcfce7; color: #14532d; }

.plist-gap-scroll { overflow: auto; max-height: 46vh; border: 1px solid var(--border, #e5e9ee); border-radius: 8px; }
.plist-gap-tab { width: 100%; border-collapse: collapse; }
.plist-gap-tab th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px;
  color: var(--text-muted, #677484); font-weight: 600; white-space: nowrap;
  padding: 6px 7px; background: var(--bg, #f6f8fa);
  border-bottom: 1px solid var(--border, #e5e9ee);
  position: sticky; top: 0; z-index: 1;
}
.plist-gap-tab td { padding: 3px 5px; border-bottom: 1px solid #f2f4f7; }
.plist-pname {
  white-space: nowrap; font-size: 12.5px; font-weight: 500;
  position: sticky; left: 0; background: #fff; padding-left: 8px !important;
}
.plist-cell input, .plist-cell select {
  width: 100%; min-width: 108px; border: 1px solid var(--border, #e5e9ee);
  border-radius: 5px; padding: 4px 6px; font-size: 12px; font-family: inherit;
  background: #fff; color: var(--text, #1a232e);
}
.plist-cell.plist-fehlt input, .plist-cell.plist-fehlt select {
  border-color: #ef4444; background: #fef2f2;
}
.plist-cell input:focus, .plist-cell select:focus {
  outline: 2px solid var(--brand, #0099cc); outline-offset: -1px;
}

/* ---------- Schritt 4 ---------- */
.plist-done { text-align: center; padding: 26px 10px; }
.plist-done-ic {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; font-size: 24px;
  background: #dcfce7; color: #14532d;
}
.plist-done h4 { margin: 0 0 6px; font-size: 15px; }
.plist-done p { margin: 0 auto; max-width: 520px; color: var(--text-muted, #677484); line-height: 1.55; }
.plist-done-act { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }

/* ---------- Fuss ---------- */
.plist-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 18px; border-top: 1px solid var(--border, #e5e9ee);
  background: var(--bg, #f6f8fa); flex-wrap: wrap;
}
.plist-foot-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Laden ---------- */
.plist-load { text-align: center; padding: 40px 0; color: var(--text-muted, #677484); }
.plist-spin {
  width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%;
  border: 3px solid var(--border, #e5e9ee); border-top-color: var(--brand, #0099cc);
  animation: plist-spin .8s linear infinite;
}
@keyframes plist-spin { to { transform: rotate(360deg); } }
