/* ============================================================
   Das Firmenblatt der Tabelle (web/firma-blatt.js)

   Es faehrt von rechts herein und verdunkelt den Rest -- wie das
   Kontaktblatt in crm.css. Ein Klick auf den Schleier schliesst.

   FRUEHER schob es die Tabelle zur Seite (margin-right auf
   .crs-wirte), damit die Liste im Blick bleibt. Flo wollte es am
   11.11. anders: beides zusammen -- verschieben UND verdunkeln --
   waere unruhig, also ist das Verschieben weg.

   40 Prozent der Fensterbreite. Die Untergrenze greift erst
   unter etwa 1050 Pixeln, die Obergrenze ist fuer das Telefon.
   ============================================================ */
.fb-scrim {
  position: fixed;
  inset: 0;
  z-index: 1499;
  background: rgba(9, 17, 32, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.fb-scrim.an { opacity: 1; pointer-events: auto; }

.fb-blatt {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 40vw;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -16px 0 44px -22px rgba(18, 35, 58, .45);
  transform: translateX(100%);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1);
}
.fb-blatt.an { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fb-blatt, .fb-scrim { transition: none; }
}

/* ---------- Der Kopf bleibt stehen ---------- */
.fb-kopffest {
  flex: none;
  position: relative;
  padding: 18px 20px 0;
  border-bottom: 1px solid var(--scrm-linie, #e7eef6);
}
.fb-inhalt { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 30px; scrollbar-width: thin; }
.fb-zu {
  all: unset; cursor: pointer; position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: var(--scrm-text2, #4b5159);
}
.fb-zu:hover { background: #eef3f8; }
.fb-kopf { display: flex; align-items: flex-start; gap: 13px; padding-right: 36px; }
.fb-logo {
  flex: none; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff;
}
.fb-kopf h2 { margin: 0; font-size: 18px; font-weight: 750; line-height: 1.25; letter-spacing: -.02em; }
.fb-kopf small { display: block; font-size: 12.5px; color: var(--scrm-mut, #8b9099); margin-top: 3px; }
.fb-akt { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.fb-luecke { flex: 1; }

/* Reiter: ohne sie waere das Blatt eine Rolle von zwei Metern. */
.fb-reiter { display: flex; gap: 2px; margin-top: 12px; }
.fb-reiter button {
  all: unset; cursor: pointer; padding: 9px 12px 10px; border-radius: 9px 9px 0 0;
  font-size: 13px; font-weight: 650; color: var(--scrm-mut, #8b9099);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .13s ease, border-color .13s ease;
}
.fb-reiter button:hover { color: var(--scrm-text2, #4b5159); }
.fb-reiter button.an { color: var(--scrm-tinte, #12233a); border-bottom-color: var(--accent, #2f7ad6); }
.fb-reiter .k {
  display: inline-block; margin-left: 6px; min-width: 17px; padding: 0 5px;
  border-radius: 9px; background: #eef2f6; font-size: 10.5px; font-weight: 800;
  color: var(--scrm-text2, #4b5159); font-variant-numeric: tabular-nums;
}

/* ---------- Eigenschaften auf einen Blick ----------
   Was eine Firma ausmacht, ohne in die Angabenmaske zu wechseln.
   Nur was gefuellt ist — eine Reihe aus zwoelf Strichen sagt
   nichts. */
.fb-eigs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.fb-eig {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border-radius: 13px; background: #eef2f6; font-size: 12px; font-weight: 600;
  color: var(--scrm-text2, #4b5159);
}
.fb-eig .material-symbols-rounded { font-size: 14px; color: var(--scrm-mut, #8b9099); }
.fb-eig.tag { background: rgba(14, 124, 107, .1); color: var(--scrm-gut, #0e7c6b); }
.fb-eig.tag .material-symbols-rounded { color: inherit; }
.fb-eig.warn { background: rgba(179, 38, 30, .1); color: var(--scrm-kalt, #b3261e); }
.fb-eig.warn .material-symbols-rounded { color: inherit; }

.fb-zahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 18px; }
.fb-z { padding: 10px 12px; border-radius: 12px; background: #f4f8fb; min-width: 0; }
.fb-z b {
  display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.fb-z small {
  display: block; font-size: 10.5px; color: var(--scrm-mut, #8b9099);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}

.fb-abschnitt { margin-bottom: 18px; }
.fb-abschnitt h3 {
  margin: 0 0 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--scrm-mut, #8b9099);
}
.fb-z2 { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.fb-z2 .material-symbols-rounded { font-size: 17px; color: var(--scrm-mut, #8b9099); flex: none; }
.fb-z2 span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fb-z2.leer span { color: #bfcbd8; }

.fb-person {
  all: unset; cursor: pointer; box-sizing: border-box; width: 100%;
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px;
  border-radius: 10px;
}
.fb-person:hover { background: #f4f8fb; }
.fb-av {
  flex: none; width: 31px; height: 31px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
}
.fb-person .pt { min-width: 0; }
.fb-person b { display: block; font-size: 13px; font-weight: 650; }
.fb-person small { display: block; font-size: 11.5px; color: var(--scrm-mut, #8b9099); }

.fb-deal {
  all: unset; cursor: pointer; box-sizing: border-box; width: 100%;
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; margin-bottom: 7px;
  border-radius: 11px; background: #f4f8fb;
}
.fb-deal:hover { background: #eef3f8; }
.fb-deal > .material-symbols-rounded { font-size: 18px; color: var(--scrm-mut, #8b9099); flex: none; }
.fb-deal .dt { flex: 1; min-width: 0; }
.fb-deal b { display: block; font-size: 12.5px; font-weight: 650; }
.fb-deal small { display: block; font-size: 11px; color: var(--scrm-mut, #8b9099); }
.fb-deal .w { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.fb-mehr {
  all: unset; cursor: pointer; display: block; padding: 7px 0;
  font-size: 12.5px; font-weight: 650; color: var(--accent-dark, #1d4f8f);
}
.fb-mehr:hover { text-decoration: underline; }
.fb-leer {
  display: flex; align-items: center; gap: 9px; padding: 8px 0;
  font-size: 12.5px; color: var(--scrm-mut, #8b9099);
}
.fb-leer .material-symbols-rounded { font-size: 18px; flex: none; }
.fb-leer.gross {
  flex-direction: column; text-align: center; gap: 5px; padding: 34px 16px;
  border-radius: 14px; background: #f4f8fb;
}
.fb-leer.gross .material-symbols-rounded { font-size: 30px; opacity: .45; }
.fb-leer.gross div { font-size: 13.5px; font-weight: 650; color: var(--scrm-tinte, #12233a); }
.fb-leer.gross small { font-size: 12px; line-height: 1.45; max-width: 290px; }

/* ---------- Angaben: Feld fuer Feld aenderbar ----------
   Der Wert IST der Knopf. Kein Stift daneben, der erst gefunden
   werden muss — er erscheint beim Zeigen. */
.fb-felder { margin: 0; }
.fb-gruppe { margin-bottom: 18px; }
.fb-gruppe h3 {
  margin: 0 0 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase; color: var(--scrm-mut, #8b9099);
}
.fb-feld {
  display: flex; align-items: baseline; gap: 14px;
  padding: 7px 0; border-bottom: 1px solid var(--scrm-linie, #e7eef6); min-width: 0;
}
.fb-feld:last-child { border-bottom: 0; }
.fb-feld dt { flex: none; width: 150px; font-size: 12.5px; color: var(--scrm-mut, #8b9099); }
.fb-feld dd { margin: 0; flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; }
.fb-feld dd.leer { color: #bfcbd8; font-weight: 400; }
.fb-edit {
  all: unset; cursor: text; box-sizing: border-box;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%;
  min-height: 26px; padding: 2px 7px; margin: -2px -7px;
  border-radius: 7px; font-size: 13.5px; font-weight: 550;
  transition: background .12s ease;
}
.fb-edit:hover { background: #eef3f8; }
.fb-edit:focus-visible { outline: 2px solid var(--accent, #2f7ad6); outline-offset: 1px; }
.fb-edit.leer { color: #bfcbd8; font-weight: 400; }
.fb-edit > .material-symbols-rounded {
  font-size: 15px; color: var(--scrm-mut, #8b9099); margin-left: auto; flex: none;
  opacity: 0; transition: opacity .12s ease;
}
.fb-edit:hover > .material-symbols-rounded { opacity: 1; }
.fb-ein {
  box-sizing: border-box; width: 100%; min-height: 30px; padding: 4px 8px; margin: -3px -8px;
  border: 0; outline: 2px solid var(--accent, #2f7ad6); border-radius: 7px; background: #fff;
  font: inherit; font-size: 13.5px; color: var(--scrm-tinte, #12233a);
}

/* ---------- Produkte im Einsatz ---------- */
.fb-summe {
  display: flex; align-items: baseline; gap: 9px; margin-bottom: 14px;
  padding: 12px 14px; border-radius: 13px; background: rgba(14, 124, 107, .08);
}
.fb-summe b {
  font-size: 21px; font-weight: 800; letter-spacing: -.025em;
  color: var(--scrm-gut, #0e7c6b); font-variant-numeric: tabular-nums;
}
.fb-summe span { font-size: 12px; color: var(--scrm-text2, #4b5159); }
.fb-vertrag {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px 12px; align-items: center;
  padding: 12px 14px; margin-bottom: 8px; border-radius: 13px; background: #f4f8fb;
  cursor: pointer;
}
.fb-vertrag:hover { background: #eef3f8; }
.fb-vic {
  grid-row: span 2; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; background: #5b6b7d;
}
.fb-vic .material-symbols-rounded { font-size: 19px; }
.fb-vt { min-width: 0; }
.fb-vt b { display: block; font-size: 13.5px; font-weight: 650; }
.fb-vt small { display: block; font-size: 11.5px; color: var(--scrm-mut, #8b9099); }
/* Die drei Angaben stehen in EINER Reihe unter dem Namen, damit
   sich die Vertraege untereinander vergleichen lassen. */
.fb-vzeile { grid-column: 2; display: flex; gap: 16px; flex-wrap: wrap; }
.fb-vsp { flex: none; min-width: 0; }
.fb-vsp b { display: block; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fb-vsp small {
  display: block; font-size: 10.5px; color: var(--scrm-mut, #8b9099);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.fb-vsp.warn b { color: var(--scrm-kalt, #b3261e); }
.fb-xsell {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px; border-radius: 13px;
  background: rgba(240, 196, 58, .16); font-size: 12.5px; color: var(--scrm-text2, #4b5159);
}
.fb-xsell > .material-symbols-rounded { font-size: 18px; color: #8a6d12; }
.fb-pchip {
  display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 10px;
  border-radius: 13px; background: #fff; color: var(--c, #4b5159);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.fb-pchip .material-symbols-rounded { font-size: 14px; }

.fb-neu {
  all: unset; cursor: pointer; box-sizing: border-box; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 10px; padding: 11px; border-radius: 12px;
  border: 1.5px dashed var(--scrm-linie2, #d6e2ef);
  font-size: 13px; font-weight: 650; color: var(--scrm-text2, #4b5159);
  transition: background .13s ease, border-color .13s ease;
}
.fb-neu:hover { background: #f4f8fb; border-color: var(--scrm-mut, #8b9099); color: var(--scrm-tinte, #12233a); }
.fb-neu .material-symbols-rounded { font-size: 18px; }

@media (max-width: 1100px) {
  .fb-blatt { width: 100%; }
}

/* ---------- Die Formulare klappen IM Blatt auf ----------
   Kein Dialog ueber dem Blatt: man sieht beim Hinzufuegen weiter,
   was die Firma schon hat — und das ist die Frage, die man dabei
   stellt. */
.fb-form {
  margin-top: 10px;
  padding: 14px;
  border-radius: 13px;
  background: #f4f8fb;
  box-shadow: inset 0 0 0 1px var(--scrm-linie, #e7eef6);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.fb-form h4 { margin: 0 0 2px; font-size: 13px; font-weight: 700; }
.fb-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11.5px; font-weight: 650; color: var(--scrm-text2, #4b5159);
}
.fb-form input[type=text], .fb-form input[type=number], .fb-form select {
  box-sizing: border-box; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: 9px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--scrm-linie2, #d6e2ef);
  font: inherit; font-size: 13px; color: var(--scrm-tinte, #12233a);
}
.fb-form input:focus, .fb-form select:focus { outline: 0; box-shadow: inset 0 0 0 1.6px var(--accent, #2f7ad6); }
.fb-fz { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fb-check {
  flex-direction: row !important; align-items: center; gap: 8px !important;
  font-weight: 550 !important;
}
.fb-check input { width: auto !important; height: auto !important; }
.fb-fa { display: flex; justify-content: flex-end; gap: 8px; margin-top: 3px; }
.fb-form .fb-leer { padding: 4px 0; }

/* ---------- Kaufrunde ---------- */
.fb-stimmung { margin-bottom: 14px; }
.fb-sbalken {
  display: flex; height: 8px; border-radius: 4px; overflow: hidden;
  background: #e7eef6; margin-bottom: 7px;
}
.fb-sbalken i { display: block; height: 100%; }
.fb-stimmung > span:last-child { font-size: 12px; color: var(--scrm-text2, #4b5159); }
.fb-stimmung b { color: var(--scrm-kalt, #b3261e); }
.fb-rperson {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 30px 10px 0; border-bottom: 1px solid var(--scrm-linie, #e7eef6);
}
.fb-rperson:last-of-type { border-bottom: 0; }
.fb-rperson .pt { min-width: 0; }
.fb-rperson b { display: block; font-size: 13px; font-weight: 650; }
.fb-rperson small { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; }
.fb-rolle, .fb-halt {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px;
  border-radius: 11px; background: rgba(var(--c), .13); color: rgb(var(--c));
  font-size: 11px; font-weight: 700;
}
.fb-halt { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 8px; border-radius: 11px;
  background: rgba(var(--c), .13); color: rgb(var(--c)); font-size: 11px; font-weight: 700; }
.fb-halt:hover { background: rgba(var(--c), .24); }
.fb-rolle .material-symbols-rounded, .fb-halt .material-symbols-rounded { font-size: 13px; }
.fb-rweg {
  all: unset; cursor: pointer; position: absolute; top: 10px; right: 0;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: var(--scrm-mut, #8b9099); opacity: 0;
  transition: opacity .12s ease, background .12s ease;
}
.fb-rperson:hover .fb-rweg, .fb-rweg:focus-visible { opacity: 1; }
.fb-rweg:hover { background: #eef3f8; color: var(--scrm-tinte, #12233a); }
.fb-rweg .material-symbols-rounded { font-size: 16px; }

/* ---------- Reiter Kontakte ---------- */
.fb-kontakt { border-bottom: 1px solid var(--scrm-linie, #e7eef6); padding: 4px 0 10px; }
.fb-kontakt:last-of-type { border-bottom: 0; }
.fb-kzeile {
  all: unset; cursor: pointer; box-sizing: border-box; width: 100%;
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px;
  border-radius: 10px;
}
.fb-kzeile:hover { background: #f4f8fb; }
.fb-kzeile .pt { flex: 1; min-width: 0; }
.fb-kzeile b { display: block; font-size: 13.5px; font-weight: 650; }
.fb-kzeile small {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--scrm-mut, #8b9099); margin-top: 2px;
}
.fb-pfeil { font-size: 18px; color: var(--scrm-mut, #8b9099); flex: none; }
.fb-rolle.klein { height: 19px; padding: 0 7px; font-size: 10px; }
.fb-rolle.klein .material-symbols-rounded { font-size: 12px; }
/* Die Wege, die man wirklich geht: anrufen und schreiben. */
.fb-kwege { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 41px; margin-top: 2px; }
.fb-weg {
  display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 10px;
  border-radius: 13px; background: #eef2f6; color: var(--scrm-text2, #4b5159);
  font-size: 11.5px; font-weight: 600; text-decoration: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fb-weg:hover { background: #e2eaf3; color: var(--scrm-tinte, #12233a); }
.fb-weg .material-symbols-rounded { font-size: 14px; flex: none; }
.fb-weg.leer { background: transparent; color: #bfcbd8; padding-left: 0; }

/* Fuenf Reiter in 440 Pixeln: enger setzen, bevor sie umbrechen. */
.fb-reiter button { padding: 9px 9px 10px; }
