/* BBI Makler-Werkbank -- Oberflächen-Prototyp (P4).
   Farben und Schrift ausschließlich aus assets/bbi-tokens.css (Max-Entscheid 2026-07-16).
   Keine Verläufe, keine Emojis, kein Fremd-Branding (DESIGN-STANDARD Abschnitt 8). */

@import url("bbi-tokens.css");

:root {
  /* Ableitung, kein neuer Markenton: --bbi-gray (#737373) erreicht auf dem hellgrauen
     Seitengrund nur 4,24:1 und verfehlt damit den Akzeptanz-Check (>= 4,5:1, gemessen
     09.09.2026). Dieser Ton liegt bei 5,97:1 auf Mist und 6,69:1 auf Weiss. */
  --bbi-gray-lesbar: #5C5C5C;
}

*, *::before, *::after { box-sizing: border-box; }
/* hidden muss staerker sein als eigene display-Regeln (.kacheln{display:grid} etc.), sonst
   gewinnt bei gleicher Spezifitaet die Autoren-Regel und ein per JS gesetztes hidden bleibt
   sichtbar (gefunden 25.09.2026: #mock-kacheln blieb im Echtbetrieb trotz .hidden=true
   sichtbar, Beleg pruefung/echt-bewertungen.png). Uebernommen aus bbi-aufgaben/web/index.html. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--bbi-font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--bbi-ink);
  background: var(--bbi-mist);
}

/* ---------- Prototyp-Band: darf nie übersehen werden ---------- */
.prototyp {
  background: var(--bbi-blue-10);
  border-bottom: 1px solid var(--bbi-blue-20);
  color: var(--bbi-blue);
  font-size: 12.5px;
  letter-spacing: .02em;
  padding: 7px 24px;
  text-align: center;
}
.prototyp strong { letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; }

/* ---------- Kopf ---------- */
.kopf {
  background: var(--bbi-white);
  border-bottom: 2px solid var(--bbi-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
}
.kopf img {
  height: 42px; width: auto;      /* nur EINE Dimension: Lockup nie verzerren */
  align-self: flex-start;
  object-fit: contain;
  display: block;
}
.navi { display: flex; gap: 4px; flex-wrap: wrap; }
.navi a {
  color: var(--bbi-blue);
  text-decoration: none;
  font-size: 14px;
  padding: 7px 13px;
  border-radius: var(--bbi-radius);
  border: 1px solid transparent;
}
.navi a:hover { background: var(--bbi-blue-10); }
.navi a[aria-current="page"] {
  background: var(--bbi-blue);
  color: var(--bbi-white);
}
.nutzer { font-size: 13px; color: var(--bbi-gray); white-space: nowrap; }

/* ---------- Grundraster ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }
main.schmal { max-width: 460px; }

h1 { font-size: 26px; line-height: 1.2; color: var(--bbi-blue); margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 17px; color: var(--bbi-blue); margin: 30px 0 10px; font-weight: 700; }
.unterzeile { color: var(--bbi-gray-lesbar); margin: 0 0 26px; font-size: 14.5px; }

.karte {
  background: var(--bbi-white);
  border: 1px solid var(--bbi-blue-20);
  border-radius: var(--bbi-radius);
  padding: 26px;
}

/* ---------- Formular ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--bbi-blue); margin-bottom: 5px; }
.hinweis { font-size: 12.5px; color: var(--bbi-gray-lesbar); font-weight: 400; margin: 3px 0 0; }
.feld { margin-bottom: 20px; }

input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--bbi-ink);
  background: var(--bbi-white);
  border: 1px solid var(--bbi-blue-20);
  border-radius: var(--bbi-radius);
  padding: 9px 11px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--bbi-blue);
  outline-offset: -1px;
  border-color: var(--bbi-blue);
}

.knopf {
  display: inline-block;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--bbi-radius);
  border: 1px solid var(--bbi-blue);
  background: var(--bbi-blue);
  color: var(--bbi-white);
  cursor: pointer;
  text-decoration: none;
}
.knopf:hover { background: var(--bbi-blue-90); border-color: var(--bbi-blue-90); }
.knopf.zweit { background: var(--bbi-white); color: var(--bbi-blue); }
.knopf.zweit:hover { background: var(--bbi-blue-10); }
.knopf[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Pflichtfeld-Block: die vier Makler-Felder ----------
   Der blaue Balken links ist KEIN Zierrat und kein uebernommenes Web-Muster: er ist das
   Infobox-Element der BBI-Marktwerteinschaetzung, dort als 0,18 cm schmale Zelle in BBI-Blau
   gebaut (werkbank/layout.py, Funktion infobox; Dokument von Max abgenommen 02.09.2026).
   Die Oberflaeche spiegelt bewusst das Dokument. Der Design-Hook meldet das Muster als
   KI-typisch; hier gilt DESIGN-STANDARD Abschnitt 0: das BBI-CI schlaegt das Playbook. */
.pflichtblock {
  border-left: 4px solid var(--bbi-blue);
  background: var(--bbi-blue-10);
  padding: 20px 22px 4px;
  border-radius: 0 var(--bbi-radius) var(--bbi-radius) 0;
  margin: 12px 0 26px;
}
.pflichtblock > p:first-child { margin-top: 0; font-size: 13.5px; color: var(--bbi-blue); }
.pflichtblock textarea, .pflichtblock input { background: var(--bbi-white); }

/* ---------- Tabelle ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--bbi-white); }
thead th {
  background: var(--bbi-blue);
  color: var(--bbi-white);
  text-align: left;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 10px 12px;
  font-weight: 600;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--bbi-blue-20); vertical-align: middle; }
tbody tr:nth-child(even) td { background: var(--bbi-mist); }
tbody tr:hover td { background: var(--bbi-blue-10); }
td a { color: var(--bbi-blue); }

/* ---------- Status ---------- */
.status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 2px;
  color: var(--bbi-white);
  background: var(--bbi-gray);
  white-space: nowrap;
}
.status.fertig { background: var(--bbi-blue); }
.status.laeuft { background: var(--bbi-blue-90); }
.status.fehler { background: var(--bbi-ink); }  /* kein Signalrot: das BBI-CI fuehrt keines */

/* ---------- Kacheln ---------- */
.kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 0 26px; }
.kachel { background: var(--bbi-blue); color: var(--bbi-white); padding: 18px 20px; border-radius: var(--bbi-radius); }
.kachel.zweit { background: var(--bbi-blue-90); }
.kachel .marke { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--bbi-blue-20); }
.kachel .wert { font-size: 27px; font-weight: 700; line-height: 1.15; margin: 5px 0 3px; }
.kachel .zusatz { font-size: 12.5px; color: var(--bbi-blue-20); }

/* ---------- Schritte ---------- */
.schritte { list-style: none; margin: 0 0 26px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.schritte li {
  font-size: 12.5px; color: var(--bbi-gray-lesbar);
  border: 1px solid var(--bbi-blue-20); background: var(--bbi-white);
  padding: 6px 13px; border-radius: 100px;
}
.schritte li[aria-current] { background: var(--bbi-blue); color: var(--bbi-white); border-color: var(--bbi-blue); }

/* ---------- Lückenliste ----------
   Gleiche Begruendung wie beim Pflichtblock: Balken links = BBI-Infobox aus dem Dokument,
   hier in Grau, weil es um Offenes geht und nicht um eine Pflicht. */
.luecke { border-left: 3px solid var(--bbi-gray); background: var(--bbi-white); padding: 14px 18px; margin: 16px 0; }
.luecke ul { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; }

.fuss {
  border-top: 1px solid var(--bbi-blue-20);
  margin-top: 40px; padding: 18px 24px 34px;
  font-size: 11.5px; color: var(--bbi-gray-lesbar); text-align: center; line-height: 1.5;
}

@media (max-width: 720px) {
  .kacheln { grid-template-columns: 1fr; }
  .kopf { flex-direction: column; align-items: flex-start; gap: 12px; }
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  tbody td { border: none; }
  tbody tr { border: 1px solid var(--bbi-blue-20); margin-bottom: 12px; display: block; }
}

/* --- Objektseite (Loop 18, 09.09.2026): Liste links, Steckbrief rechts --- */
.zweispalt {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .zweispalt { grid-template-columns: 1fr; }
}
.zweispalt table { font-size: 13.5px; }
.zweispalt h2 { margin-top: 0; }

/* Die Zeilenwahl ist ein echter Knopf, kein klickbares div: so ist sie mit der Tastatur
   erreichbar und der Screenreader nennt sie als Schaltflaeche (WCAG 2.1.1). */
.zeilenwahl {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 2px;
  font: inherit;
  font-weight: 700;
  color: var(--bbi-blue);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.zeilenwahl:hover { color: var(--bbi-blue-90); }
.zeilenwahl:focus-visible { outline: 2px solid var(--bbi-blue); outline-offset: 2px; }

tbody tr.gewaehlt td { background: var(--bbi-blue-10); }
tbody tr.gewaehlt td:first-child { box-shadow: inset 3px 0 0 var(--bbi-blue); }

/* Fehlende Angabe: nicht rot (das BBI-CI fuehrt kein Signalrot), sondern kursiv und grau,
   damit sie sich vom gefuellten Wert unterscheidet, ohne zu alarmieren. */
.fehlt { color: var(--bbi-gray-lesbar); font-style: italic; }

/* Zahlenspalten der OBJEKTLISTE nicht umbrechen: "150,04 m²" stand sonst auf zwei Zeilen
   und die Zeilenhoehe sprang (gesehen im Screenshot vom 09.09.2026).
   Wichtig: nur die Liste. Der erste Anlauf schrieb .zweispalt tbody td und erwischte damit auch
   den Steckbrief; dessen Werte durften dann nicht mehr umbrechen und schoben die Karte ueber die
   Liste (zweiter Screenshot desselben Abends). */
#objekte-koerper td:not(:first-child) { white-space: nowrap; }

/* Rollenschalter im Kopf und Herkunftsspalte fuer das Backoffice */
.rollenwahl {
  font-size: 12.5px;
  padding: 4px 8px;
  width: auto;
  min-width: 150px;
  margin: 0;
  border: 1px solid var(--bbi-blue-20);
  border-radius: var(--bbi-radius);
  background: var(--bbi-white);
  color: var(--bbi-ink);
}
.herkunft { font-size: 11.5px; color: var(--bbi-gray-lesbar); white-space: normal; }

/* Backoffice-Ansicht: die Steckbrief-Tabelle bekommt eine dritte Spalte (Herkunft) und sprengte
   damit die Karte nach rechts (gesehen im Screenshot vom 09.09.2026). Zwei Massnahmen: die Karte
   bekommt mehr Breite, und die Tabelle feste Spaltenanteile statt Inhaltsbreite. */
[data-rolle="backoffice"] .zweispalt { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
[data-rolle="backoffice"] #steckbrief table { table-layout: fixed; }
[data-rolle="backoffice"] #steckbrief td:nth-child(1) { width: 30%; }
[data-rolle="backoffice"] #steckbrief td:nth-child(2) { width: 42%; }
[data-rolle="backoffice"] #steckbrief td:nth-child(3) { width: 28%; }
#steckbrief table { max-width: 100%; }
.karte { overflow-x: auto; }

/* Breite Tabellen scrollen in ihrem eigenen Rahmen, statt aus der Spalte zu laufen. Ohne das
   verschwand die Spalte "Dokument" unter der Steckbrief-Karte, sobald die Backoffice-Ansicht
   die Karte breiter machte (dritter Screenshot vom 09.09.2026). Die Seite selbst scrollt nie
   waagerecht. */
.tabellenrahmen { overflow-x: auto; }

/* Die Objektseite stellt Liste und Steckbrief nebeneinander und braucht dafuer mehr Breite als
   die 1080px der Textseiten. Ohne das blieb die Spalte "Dokument" auch auf einem 1920er-Schirm
   im Scrollbereich verborgen. */
main.breit { max-width: 1360px; }

/* ---------- "Neu"-Menue: registrierte Auftrags-Arten (Details/Summary, kein Fremd-Framework) ----------
   AUFTRAGS-MODELL.md Abschnitt 3: Navigation "Objekte . Auftraege . Neu (Menue nach Art) . Preisstrategie". */
.neu-menue { position: relative; }
.neu-menue summary {
  list-style: none;
  cursor: pointer;
  color: var(--bbi-blue);
  font-size: 14px;
  padding: 7px 13px;
  border-radius: var(--bbi-radius);
  border: 1px solid transparent;
}
.neu-menue summary::-webkit-details-marker { display: none; }
.neu-menue[open] summary, .neu-menue summary:hover { background: var(--bbi-blue-10); }
.neu-menue-liste {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 5;
  background: var(--bbi-white);
  border: 1px solid var(--bbi-blue-20);
  border-radius: var(--bbi-radius);
  padding: 6px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.neu-menue-liste a {
  color: var(--bbi-ink);
  text-decoration: none;
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: var(--bbi-radius);
}
.neu-menue-liste a:hover { background: var(--bbi-blue-10); color: var(--bbi-blue); }

/* ---------- Reiter (Tabs) nach Auftrags-Art in web/auftraege.html ---------- */
.art-reiter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }

/* ---------- Neue Bewertung: mehrzeilige Angaben (Auf-/Abschlaege, WEG-Punkte, Lagepunkte) ----------
   Bauplan-Schritt B4, Punkt 6. Eine Zeile ist eine eigene kleine Karte mit "Entfernen"-Knopf. */
.zeilen-liste { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.zeile-mehrfach {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  border: 1px solid var(--bbi-blue-20); border-radius: var(--bbi-radius);
  padding: 12px; background: var(--bbi-white);
}
.zeile-mehrfach .feld { flex: 1 1 160px; min-width: 140px; margin-bottom: 0; }
.zeile-mehrfach .zeile-entfernen { flex: 0 0 auto; align-self: flex-end; }

/* ---------- Anmeldung per E-Mail-Einmalcode (index.html, 29.09.2026) ----------
   Nur Farben aus bbi-tokens.css. Das Code-Feld ist breit gesperrt und in Ziffernbreite gesetzt,
   damit sich 6 Ziffern gut abgleichen lassen. */
input.code-feld {
  width: 100%;
  max-width: 12em;
  font-size: 22px;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.anmelde-adresse { margin: 0 0 16px; font-size: 14px; color: var(--bbi-ink); overflow-wrap: anywhere; }
.anmelde-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.anmelde-knoepfe .knopf[disabled], #code-senden-knopf[disabled] { opacity: 0.6; cursor: not-allowed; }
.anmelde-meldung { margin-top: 16px; font-size: 13.5px; color: var(--bbi-ink); }
.anmelde-meldung.ist-fehler {
  color: var(--bbi-blue);
  font-weight: 600;
  border-left: 3px solid var(--bbi-blue);
  padding-left: 10px;
}
