/* ============================================================
   Team und Rechtegruppen — die Stile zu team.js.

   EIGENE DATEI und nicht in crm-suite.css: die liegt als Kopie
   aus der Workstation hier und wird von Zeit zu Zeit neu geholt
   (werkzeug/aus-workstation-holen.cjs). Was dort hineingeschrieben
   wird, ist beim naechsten Holen weg.

   Gezeichnet wird INNERHALB von .cse-inhalt -- dem rechten Teil
   der Einstellungsseite. Rahmen, Ueberschrift und Karten kommen
   also aus einstellungen.css; hier steht nur, was es dort noch
   nicht gibt.

   Vorlage: previews/team-rollen.html (Workstation-Repo).
   ============================================================ */

/* ============================================================
   Reiter
   ============================================================ */
.tm-reiter {
  display: flex; gap: 4px; margin: 0 0 16px;
  border-bottom: 1px solid var(--scrm-linie, #e7eef6);
}
.tm-reiter button {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 9px 14px;
  font-size: 12.5px; font-weight: 700; color: var(--scrm-mut, #8a97a8);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; align-items: center; gap: 7px;
}
.tm-reiter button:hover { color: var(--scrm-tinte, #16233a); }
.tm-reiter button.an {
  color: var(--cse-akzent-tief, #15739f); border-bottom-color: var(--cse-akzent, #1a9bdb);
}
.tm-reiter .material-symbols-rounded { font-size: 17px; }
.tm-reiter .n {
  font-size: 10px; font-weight: 800; background: var(--scrm-grund, #f5f8fc);
  color: var(--scrm-mut, #8a97a8); padding: 1px 6px; border-radius: 20px;
}
.tm-reiter button.an .n {
  background: var(--cse-akzent-matt, #e8f5fc); color: var(--cse-akzent-tief, #15739f);
}

/* ============================================================
   Benutzerliste
   ============================================================ */
.tm-kopfreihe { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tm-kopfreihe .spacer { flex: 1; }
.tm-kopfreihe .offen { font-size: 11.5px; color: var(--scrm-mut, #8a97a8); }

.tm-suche { position: relative; width: 260px; max-width: 100%; }
.tm-suche input {
  width: 100%; height: 36px; padding: 0 11px 0 34px; border: 1px solid #d9e2ee;
  border-radius: 9px; background: #fff; font-size: 13px; font-family: inherit; color: inherit;
}
.tm-suche input:focus { outline: 2px solid var(--cse-akzent, #1a9bdb); outline-offset: -1px; }
.tm-suche .material-symbols-rounded {
  position: absolute; left: 10px; top: 9px; font-size: 18px;
  color: var(--scrm-mut, #8a97a8); pointer-events: none;
}

.tm-liste { display: flex; flex-direction: column; }
.tm-p {
  display: flex; align-items: center; gap: 13px; padding: 12px 4px;
  border-bottom: 1px solid var(--scrm-linie, #e7eef6);
}
.tm-p:last-child { border-bottom: 0; }
.tm-ava {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid;
  place-items: center; font-size: 13px; font-weight: 800; color: #fff;
}
.tm-ava.offen { background: #fff; border: 1px dashed #c6d3e2; color: var(--scrm-mut, #8a97a8); }
.tm-ava.offen .material-symbols-rounded { font-size: 18px; }
.tm-wer { flex: 1 1 auto; min-width: 0; }
.tm-wer b { display: block; font-size: 13px; font-weight: 700; }
.tm-wer small {
  display: block; font-size: 11.5px; color: var(--scrm-mut, #8a97a8);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tm-ichmarke {
  font-size: 9px; font-weight: 800; letter-spacing: .07em;
  color: var(--cse-akzent-tief, #15739f); background: var(--cse-akzent-matt, #e8f5fc);
  padding: 1px 5px; border-radius: 4px; margin-left: 6px; vertical-align: 1px;
}
.tm-stand { flex: none; width: 168px; }
.tm-stand .z { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; }
.tm-stand .z .material-symbols-rounded { font-size: 15px; }
.tm-stand small { display: block; font-size: 10.5px; color: var(--scrm-mut, #8a97a8); margin-top: 1px; }
.tm-stand.gut .z { color: var(--scrm-gut, #1e9e6a); }
.tm-stand.wartet .z { color: #c98a1e; }
.tm-stand.ruht .z { color: var(--scrm-mut, #8a97a8); }

.tm-rolle { flex: none; width: 190px; }
.tm-rolle select {
  width: 100%; height: 34px; padding: 0 9px; border: 1px solid #d9e2ee;
  border-radius: 8px; background: #fff; font-size: 12.5px; font-weight: 600;
  font-family: inherit; color: inherit;
}
.tm-rolle select:focus { outline: 2px solid var(--cse-akzent, #1a9bdb); outline-offset: -1px; }
.tm-rolle .fest {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 9px;
  font-size: 12.5px; font-weight: 700; color: #41556d;
}
.tm-rolle .fest .material-symbols-rounded { font-size: 16px; color: var(--scrm-mut, #8a97a8); }

.tm-mehr {
  all: unset; box-sizing: border-box; cursor: pointer; flex: none;
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  color: var(--scrm-mut, #8a97a8);
}
.tm-mehr:hover { background: var(--scrm-grund, #f5f8fc); color: var(--scrm-tinte, #16233a); }
.tm-mehr[disabled] { opacity: .3; cursor: default; }

/* Das Menue an der Zeile. Haengt am body, nicht an der Zeile:
   .cse-inhalt scrollt, und ein Menue darin waere beim Scrollen
   mitgewandert statt zu schliessen. */
.tm-menue {
  position: absolute; z-index: 1400; background: #fff;
  border: 1px solid var(--scrm-linie, #e7eef6); border-radius: 10px; padding: 5px;
  min-width: 212px; box-shadow: 0 10px 28px rgba(22, 35, 58, .14);
}
.tm-menue button {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center;
  gap: 9px; width: 100%; padding: 8px 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600;
}
.tm-menue button:hover { background: var(--scrm-grund, #f5f8fc); }
.tm-menue button .material-symbols-rounded { font-size: 17px; color: var(--scrm-mut, #8a97a8); }
.tm-menue button.weg { color: var(--scrm-schlecht, #d4453c); }
.tm-menue button.weg:hover { background: #fdecea; }
.tm-menue button.weg .material-symbols-rounded { color: var(--scrm-schlecht, #d4453c); }
.tm-menue hr { border: 0; border-top: 1px solid var(--scrm-linie, #e7eef6); margin: 4px 2px; }

/* ---------- Einladen ---------- */
.tm-einladen { display: grid; grid-template-columns: 1fr 1fr 190px auto; gap: 10px; align-items: end; }
.tm-einladen .cse-feld { margin-bottom: 0; max-width: none; }
@media (max-width: 1000px) { .tm-einladen { grid-template-columns: 1fr; } }

.tm-link {
  margin-top: 14px; background: #e7f6ef; border: 1px solid #bfe6d4;
  border-radius: 10px; padding: 13px 15px;
}
.tm-link.ohne { background: #fcf4e4; border-color: #efddb8; }
.tm-link .k {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800;
  color: #14734c; margin-bottom: 8px;
}
.tm-link.ohne .k { color: #7a5712; }
.tm-link .k .material-symbols-rounded { font-size: 18px; }
.tm-link .reihe { display: flex; gap: 8px; }
.tm-link input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid #bfe6d4;
  border-radius: 8px; background: #fff; font-size: 12px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; color: #41556d;
}
.tm-link.ohne input { border-color: #efddb8; }
.tm-link p { margin: 9px 0 0; font-size: 11px; line-height: 1.5; color: #2c7a58; }
.tm-link.ohne p { color: #7a5712; }

/* ============================================================
   Rechtegruppen
   ============================================================ */
.tm-gr { display: grid; grid-template-columns: 230px minmax(0, 1fr) 216px; gap: 14px; align-items: start; }
/* Die Seite steht im Inhaltsbereich der Suite, und links davon
   liegen 240 Pixel Navigation plus 232 Bereichsspalte. Darum
   misst @media hier deutlich grosszuegiger als es aussieht. */
@media (max-width: 1500px) {
  .tm-gr { grid-template-columns: 210px minmax(0, 1fr); }
  .tm-spiegel { display: none; }
}
@media (max-width: 1150px) { .tm-gr { grid-template-columns: minmax(0, 1fr); } }

.tm-grliste { display: flex; flex-direction: column; gap: 5px; }
.tm-g {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center;
  gap: 10px; padding: 10px 11px; border-radius: 10px;
  border: 1px solid var(--scrm-linie, #e7eef6); background: #fff;
}
.tm-g:hover { border-color: #cfdced; }
.tm-g.an { border-color: var(--cse-akzent, #1a9bdb); background: var(--cse-akzent-matt, #e8f5fc); }
.tm-g .punkt { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.tm-g .nm { flex: 1; min-width: 0; }
.tm-g .nm b { display: block; font-size: 12.5px; font-weight: 700; }
.tm-g .nm small { display: block; font-size: 10.5px; color: var(--scrm-mut, #8a97a8); line-height: 1.35; }
.tm-g .schloss { font-size: 15px; color: var(--scrm-mut, #8a97a8); }
.tm-gneu {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center;
  gap: 8px; padding: 10px 11px; border-radius: 10px; border: 1px dashed #c6d3e2;
  color: var(--scrm-mut, #8a97a8); font-size: 12.5px; font-weight: 700;
  justify-content: center; margin-top: 3px;
}
.tm-gneu:hover { border-color: var(--cse-akzent, #1a9bdb); color: var(--cse-akzent-tief, #15739f); }
.tm-gneu .material-symbols-rounded { font-size: 17px; }

/* ---------- Die Matrix ---------- */
.tm-matrix {
  border: 1px solid var(--scrm-linie, #e7eef6); border-radius: 12px;
  background: #fff; overflow: hidden;
}
.tm-mkopf {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  border-bottom: 1px solid var(--scrm-linie, #e7eef6); background: #fcfdfe; flex-wrap: wrap;
}
.tm-mkopf .punkt { flex: none; width: 11px; height: 11px; border-radius: 50%; }
.tm-mkopf .nm { flex: 1; min-width: 160px; }
.tm-mkopf .nm b { display: block; font-size: 13.5px; font-weight: 800; }
.tm-mkopf .nm small { display: block; font-size: 11px; color: var(--scrm-mut, #8a97a8); line-height: 1.45; }
.tm-mkopf input.umbenennen {
  width: 100%; height: 30px; padding: 0 9px; border: 1px solid #d9e2ee;
  border-radius: 7px; font-size: 13px; font-weight: 700; font-family: inherit; color: inherit;
}
.tm-mkopf input.umbenennen:focus { outline: 2px solid var(--cse-akzent, #1a9bdb); outline-offset: -1px; }

.tm-mgruppe { padding: 4px 0; }
.tm-mgruppe > .titel {
  padding: 11px 15px 6px; font-size: 10px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--scrm-mut, #8a97a8);
  display: flex; align-items: center; gap: 9px;
}
.tm-mgruppe > .titel .strich { flex: 1; border-top: 1px solid var(--scrm-linie, #e7eef6); }

.tm-r { display: flex; align-items: center; gap: 11px; padding: 7px 15px; }
.tm-r:hover { background: #fbfcfe; }
.tm-r > .material-symbols-rounded { flex: none; font-size: 18px; color: var(--scrm-mut, #8a97a8); }
.tm-r .was { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; }
.tm-r .was small { display: block; font-size: 10.5px; font-weight: 500; color: var(--scrm-mut, #8a97a8); }

/* Vier Stufen: Kein · Lesen · Schreiben · Löschen.

   Sie bauen aufeinander auf -- wer loeschen darf, darf auch
   schreiben und lesen. Das ist der Unterschied zu drei Haken
   nebeneinander, bei denen "loeschen ja, lesen nein" ankreuzbar
   waere und niemand weiss, was dann gilt. */
.tm-stufen {
  flex: none; display: flex; background: var(--scrm-grund, #f5f8fc);
  border-radius: 8px; padding: 2px; gap: 2px;
}
.tm-stufen button {
  all: unset; box-sizing: border-box; cursor: pointer; padding: 5px 9px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; color: var(--scrm-mut, #8a97a8);
  text-align: center; min-width: 58px;
}
.tm-stufen button:hover { color: var(--scrm-tinte, #16233a); }
.tm-stufen button.an {
  background: #fff; color: var(--scrm-tinte, #16233a); box-shadow: 0 1px 2px rgba(22, 35, 58, .09);
}
.tm-stufen button.an[data-stufe="0"] { color: var(--scrm-mut, #8a97a8); }
.tm-stufen button.an[data-stufe="1"] { color: var(--cse-akzent-tief, #15739f); }
.tm-stufen button.an[data-stufe="2"] { color: var(--scrm-gut, #1e9e6a); }
.tm-stufen button.an[data-stufe="3"] { color: #c98a1e; }
.tm-stufen.starr { opacity: .6; }
.tm-stufen.starr button { cursor: default; }
/* Der Schalter im Bereichskopf setzt alle Zeilen darunter. */
.tm-stufen.kopf { background: transparent; padding: 0; }
.tm-stufen.kopf button {
  padding: 4px 9px; font-size: 10px; background: #fff;
  border: 1px solid var(--scrm-linie, #e7eef6);
}
.tm-stufen.kopf button.an { border-color: transparent; }
.tm-gemischt {
  flex: none; font-size: 10px; font-weight: 700; color: var(--scrm-mut, #8a97a8);
  letter-spacing: 0; text-transform: none; padding-right: 3px;
}

/* Sonderrechte: an oder aus. Keine Stufen -- man darf sie
   oder man darf sie nicht. */
.tm-schalter {
  all: unset; box-sizing: border-box; cursor: pointer; flex: none;
  width: 40px; height: 23px; border-radius: 20px; background: #d7e0ea;
  position: relative; transition: background .12s;
}
.tm-schalter::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: left .12s;
  box-shadow: 0 1px 2px rgba(22, 35, 58, .2);
}
.tm-schalter.an { background: var(--scrm-gut, #1e9e6a); }
.tm-schalter.an::after { left: 20px; }
.tm-schalter.starr { opacity: .55; cursor: default; }

/* ---------- Der Navigationsspiegel ---------- */
.tm-spiegel { position: sticky; top: 0; }
.tm-spk {
  font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--scrm-mut, #8a97a8); margin-bottom: 7px;
}
.tm-nav {
  background: #0e2a33; border-radius: 12px; padding: 11px 9px; color: #c3d6dd;
  max-height: 560px; overflow: auto;
}
.tm-nav .gr {
  padding: 11px 9px 4px; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #5f8694;
}
.tm-nav .gr:first-child { padding-top: 2px; }
.tm-nav .e {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 600;
}
.tm-nav .e .material-symbols-rounded { font-size: 16px; opacity: .85; }
.tm-nav .e.start { background: rgba(255, 255, 255, .1); color: #fff; }
.tm-nav .e.lesen { color: #8fb3bf; }
.tm-nav .leer { padding: 14px 9px; font-size: 11px; color: #5f8694; line-height: 1.5; }
.tm-spiegel p { margin: 9px 2px 0; font-size: 10.5px; line-height: 1.5; color: var(--scrm-mut, #8a97a8); }

/* ---------- Nachfrage beim Entfernen ---------- */
.tm-schirm {
  position: fixed; inset: 0; background: rgba(16, 30, 48, .34); z-index: 1500;
  display: grid; place-items: center; padding: 20px;
}
.tm-dlg {
  background: #fff; border-radius: 14px; padding: 20px 22px; width: 430px; max-width: 100%;
  box-shadow: 0 20px 50px rgba(16, 30, 48, .3);
}
.tm-dlg h3 { margin: 0 0 9px; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.tm-dlg h3 .material-symbols-rounded { color: var(--scrm-schlecht, #d4453c); font-size: 20px; }
.tm-dlg p { margin: 0 0 7px; font-size: 12.5px; line-height: 1.6; color: #41556d; }
.tm-dlg p.klein { font-size: 11.5px; color: var(--scrm-mut, #8a97a8); }
.tm-dlg .reihe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 17px; }

/* Der rote Knopf. .cse-tun gibt es in einstellungen.css, aber
   nicht in Rot -- Loeschen hatte es dort noch nicht gegeben. */
.cse-tun.weg { background: #fff; border: 1px solid #f0cdca; color: var(--scrm-schlecht, #d4453c); }
.cse-tun.weg:hover { background: #fdecea; border-color: var(--scrm-schlecht, #d4453c); }

/* ---------- Hinweis, wenn das SQL fehlt ---------- */
.tm-kein {
  display: flex; gap: 10px; align-items: flex-start; background: #fcf4e4;
  border: 1px solid #efddb8; border-radius: 10px; padding: 13px 15px;
}
.tm-kein .material-symbols-rounded { flex: none; font-size: 19px; color: #c98a1e; margin-top: 1px; }
.tm-kein div { font-size: 12px; line-height: 1.55; color: #7a5712; }
.tm-kein b { color: #5e430d; }
