/* Eigenes der App Unterschriften; alles Uebrige kommt aus firmen.css (gemeinsam, verteilt) */

/* Die Farbe der App - wie bei jeder Firmen-App in ihrer eigenen app.css. Tinte: ein dunkles Blau,
   das es im Bestand noch nicht gibt (die naechsten sind Fahrtenbuch #2563eb und Datenschutz #4338ca). */
:root {
  --g: linear-gradient(135deg, #60a5fa 0%, #1e3a8a 60%, #0f172a 120%);
  --accent: #1e3a8a;
}

.warnung {
  border-left: 4px solid var(--warn, #b45309);
  background: var(--warn-bg, #fff7ed);
  padding: 12px 14px;
  margin: 12px 0 16px;
  border-radius: 6px;
}
.warnung strong { display: block; margin-bottom: 6px; font-size: 1.05em; }
.warnung p { margin: 6px 0 0; }

.zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
/* Ein Raster statt einer Reihe: die Unterzeichner liegen darunter und bekommen die GANZE Breite -
   sonst quetscht die Spalte mit den Tasten den langen Verweis zu einem schmalen Streifen. */
.zeile.vorgang { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px 16px; }
.vorgang code { font-size: .9em; word-break: break-all; }
.vorgang .muted { margin-top: 4px; }
.vorgang .personen { grid-column: 1 / -1; }

.tasten { display: flex; gap: 8px; flex: none; }
a.knopf { display: inline-block; text-decoration: none; }

@media (max-width: 560px) {
  .zeile.vorgang { grid-template-columns: 1fr; }
}

/* Die Unterzeichner eines Vorgangs (S3) samt Verweis und Code (S4) */
.personen { margin-top: 10px; border-top: 1px solid var(--border); }
.personen.leer { padding-top: 10px; color: var(--muted, #64748b); }
.personen.leer button { margin-left: 6px; }
.person { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.person:first-child { border-top: 0; }
.person.vertretung { padding-left: 18px; border-left: 3px solid var(--border); }
.person-kopf { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* min-width: 0 - sonst drueckt der lange Verweis (word-break) die Spalte zu einem schmalen Streifen */
.person-leib { flex: 1 1 auto; min-width: 0; }
.platz { font-weight: 600; }
.person .rolle { font-size: .85em; background: var(--border); border-radius: 10px; padding: 1px 8px; }
.person .rolle.zu { background: var(--warn-bg, #fff7ed); color: var(--warn, #b45309); }
code.verweis { word-break: break-all; }
.code-kasten { margin-top: 6px; }
.code-kasten .klein { display: block; margin-top: 2px; }
code.code { font-size: 1.2em; letter-spacing: .15em; font-weight: 600; }

/* ⚠️ display nur im geoeffneten Zustand setzen: ein "display: flex" auf dem Fenster selbst schlaegt
   die Regel des Browsers fuer ein geschlossenes dialog (display: none) - es stuende dann immer da. */
#personenDialog { width: min(95vw, 760px); max-height: 90vh; padding: 0; border: 0; border-radius: 8px; }
#personenDialog[open] { display: flex; flex-direction: column; }
#personenDialog .personen-kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; }
#personenDialog .personen-kopf h2 { margin: 0; font-size: 1.1em; }
#personenDialog .personen-leib { overflow: auto; padding: 0 14px; }
#personenDialog .personen-fuss { padding: 10px 14px; border-top: 1px solid var(--border); }
fieldset.platz { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 12px; padding: 8px 12px 12px; }
fieldset.platz legend { font-weight: 600; padding: 0 6px; }
fieldset.platz label { display: block; margin: 8px 0 3px; font-size: .9em; }
fieldset.platz input, fieldset.platz select { width: 100%; box-sizing: border-box; margin-bottom: 4px; }

@media (max-width: 560px) {
  .person { flex-direction: column; align-items: stretch; }
}

#ansichtDialog { width: min(95vw, 1000px); height: 90vh; padding: 0; border: 0; border-radius: 8px; }
#ansichtDialog .ansicht-kopf { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; }
#ansichtDialog h2 { margin: 0; font-size: 1.1em; }
#ansichtRahmen { width: 100%; height: calc(90vh - 56px); border: 0; display: block; }

/* ---------------------------------------------------------------------------
   Die Außenseite für Externe (S5) - die Seite hinter dem Verweis
   --------------------------------------------------------------------------- */
/* Der Text E2-Fenster steht über den Eingabefeldern, in voller Schriftgröße. */
.e2 { margin: 0 0 14px; }
.e2 p { margin: 6px 0; }
/* S10, Ort 3: der Aufklapper „Mehr zum Datenschutz“ - zugeklappt kostet er eine Zeile */
.e2-mehr { margin-top: 10px; }
.e2-mehr summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.e2-mehr ul { list-style: disc; padding-left: 22px; margin: 8px 0 0; display: block; }
.e2-mehr li { margin: 6px 0; display: list-item; }

/* ⭐ Das Dokument im eingebauten Betrachter des Browsers - kein fremder Baustein.
   Am Telefon wird der Rahmen niedriger, damit der Verweis zum Herunterladen ohne Rollen zu sehen
   bleibt: ⚠️ manche Browser zeigen dort gar kein PDF, und dann ist der Verweis der einzige Weg. */
.dokument h3 { margin: 14px 0 8px; font-size: 1.05em; }
#ansicht { width: 100%; height: min(70vh, 720px); min-height: 320px; border: 1px solid var(--border); border-radius: 6px; display: block; background: #fff; }
.dokument .actions { margin: 10px 0 0; }
a.knopf#laden { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 600; }

@media (max-width: 560px) {
  #ansicht { height: 48vh; min-height: 220px; }
}

/* ---------------------------------------------------------------------------
   Der Umlauf (S6) und die Nachrichten (S7)
   --------------------------------------------------------------------------- */
/* Eine gute Nachricht: dieselbe Form wie die Warnung, nur in Gruen - sie faellt auf, ohne zu mahnen. */
.gut {
  border-left: 4px solid #15803d;
  background: #f0fdf4;
  padding: 12px 14px;
  margin: 12px 0 16px;
  border-radius: 6px;
}
.gut strong { display: block; margin-bottom: 6px; }
.gut p { margin: 6px 0 0; }
.warnung.klein.unvollstaendig { margin: 10px 0; }
.klein.fertig { color: #15803d; }

/* ⭐ Der Abschnitt zum Unterschreiben steht UNTER dem Dokument - erst sehen, dann unterschreiben. */
.unterschreiben { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; }
.unterschreiben p { margin: 0 0 10px; }
.unterschreiben .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grund-feld { margin-top: 12px; }
.grund-feld label { display: block; margin-bottom: 4px; font-size: .9em; }
.grund-feld textarea { width: 100%; box-sizing: border-box; }

/* Die Nachrichten eines Vorgangs - nur fuer die Person, die ihn angelegt hat */
.mails { grid-column: 1 / -1; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.mail { padding: 6px 0; border-top: 1px solid var(--border); }
.mail:first-of-type { border-top: 0; }
.mail.rot { border-left: 3px solid var(--warn, #b45309); padding-left: 8px; }

#ablehnenDialog { width: min(95vw, 560px); padding: 0; border: 0; border-radius: 8px; }
#ablehnenDialog[open] { display: flex; flex-direction: column; }
#ablehnenDialog .personen-leib { padding: 0 14px 10px; }
#ablehnenDialog label { display: block; margin: 8px 0 3px; font-size: .9em; }
#ablehnenDialog textarea { width: 100%; box-sizing: border-box; }

/* ---------------------------------------------------------------------------
   S8: die Abschlussseite (W2) und das Protokoll ohne Dokument
   ⭐ W2 steht nach der letzten Unterschrift da, wo jeder hinsieht - nicht im Kleingedruckten.
   Der Knopf zum Herunterladen steht MITTEN im Text, genau dort, wo ihn der Anhang zeigt.
   --------------------------------------------------------------------------- */
.warnung.w2 { margin: 16px 0 0; }
.warnung.w2 .actions { margin: 12px 0; }
.warnung.w2 a.knopf { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 600; }
.warnung.w2 code { word-break: break-all; }
.warnung.klein.geloescht { margin: 10px 0; }
.warnung.klein.geloescht code { word-break: break-all; }

/* ---------------------------------------------------------------------------
   S9: die eigene Prüfseite
   ⭐ Die Rangfolge ist hier nicht Geschmack, sondern Abnahme (S-P1): Das Urteil über das ganze
   Dokument steht oben und groß, die einzelnen Unterschriften stehen darunter und kleiner.
   ⛔ Kein grünes Häkchen an einer einzelnen Unterschrift - der gute Fall ist EINE Zeile oben.
   --------------------------------------------------------------------------- */
.warnung.p9-hinweis { margin: 12px 0; }
.warnung.p9-woher { margin: 10px 0; }
.p9-feld { margin-top: 14px; display: grid; gap: 4px; }
.p9-feld label { margin-top: 8px; }
.p9-feld input[type="text"], .p9-feld select { width: 100%; box-sizing: border-box; }
.p9-feld .actions { margin-top: 12px; }

.p9-gesamt { border-left: 6px solid var(--border); background: var(--surface-2); padding: 14px 16px; border-radius: 6px; }
.p9-gesamt strong { display: block; font-size: 1.5em; line-height: 1.2; margin: 2px 0 6px; }
.p9-gesamt.gut { border-left-color: #15803d; background: #f0fdf4; }
.p9-gesamt.schlecht { border-left-color: var(--warn, #b45309); background: var(--warn-bg, #fff7ed); }
.p9-gesamt p { margin: 6px 0 0; }
.p9-antwort { font-weight: 600; }
.p9-gruende { margin: 8px 0 0; padding-left: 20px; }
.p9-gruende li { margin: 4px 0; }
.p9-wert { margin-top: 10px; }
.p9-wert code, #welcher code { word-break: break-all; }

.p9-einzeln { border-top: 1px solid var(--border); }
.p9-u { padding: 8px 0; border-top: 1px solid var(--border); }
.p9-u:first-child { border-top: 0; }
.p9-u.fehlt { border-left: 3px solid var(--warn, #b45309); padding-left: 8px; }
.p9-u-kopf { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.p9-u-kopf .rolle { font-size: .85em; background: var(--border); border-radius: 10px; padding: 1px 8px; }

/* ---------------------------------------------------------------------------
   S10: Texte und Grenzen (Don 20.11.2026)

   ⭐ Drei Kästen, die nicht gleich aussehen dürfen - das war ein Fund des Bildberichts vom
   20.11.2026: Ein Hinweis und ein Hindernis sahen beide gleich aus, weil beide `.warnung` trugen.
     1 `.warnung` (W1)  - der Hinweis zur Frist: oranger Balken links.
     2 `.form`    (T1a) - der Hinweis zur FORM: blauer Balken links, ruhige Fläche, kein Orange.
     3 `.sperre`        - das HINDERNIS: ganz umrandet, rot, mit Abstand. Es sieht anders aus, weil
       es etwas anderes ist: Hier geht es nicht weiter, bis jemand etwas einträgt.
   --------------------------------------------------------------------------- */
.form {
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  padding: 12px 14px;
  margin: 0 0 16px;
  border-radius: 6px;
}
.form strong { display: block; margin-bottom: 6px; font-size: 1.05em; }
.form p { margin: 6px 0 0; }
.form details { margin-top: 10px; }
.form details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.form details > div { margin-top: 8px; }
.form details p { margin: 8px 0 0; }
/* ⚠️ Die Liste trägt wieder Punkte: firmen.css nimmt sie innerhalb von details weg (details ul),
   und ohne Punkte liest sich eine Aufzählung von neun Fällen wie ein Absatz. */
.form details ul { list-style: disc; padding-left: 22px; margin: 8px 0 0; display: block; }
.form details li { margin: 4px 0; display: list-item; }

.sperre {
  border: 1px solid #ef9a9a;
  border-left: 6px solid #b91c1c;
  background: #fef2f2;
  padding: 14px 16px;
  margin: 12px 0 16px;
  border-radius: 6px;
}
.sperre strong { display: block; margin-bottom: 6px; font-size: 1.05em; color: #991b1b; }
.sperre p { margin: 6px 0 0; }
.sperre .fehlt { margin-top: 10px; font-weight: 600; }

/* ⭐ Ohne diese Regel ist die Sperre STUMM: Ein abgeschalteter Knopf sah genauso aus wie ein
   eingeschalteter - der Benutzer drückt und hält die App für kaputt (Fund des Bildberichts vom
   20.11.2026). ⚠️ Gemeldet: In der gemeinsamen firmen.css fehlt die Regel ebenfalls; dort gehört
   sie für die ganze Familie hin - ⛔ die fasst eine Untersitzung nicht an. */
button:disabled, .primary:disabled, .ghost:disabled, .danger:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
  text-shadow: none;
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
  border-style: dashed;
}

/* Die Maske für die Datenschutzangaben je Firma (S10) */
.ds-feld { display: grid; gap: 4px; margin-top: 14px; }
.ds-feld label { font-weight: 600; }
.ds-feld input[type="text"], .ds-feld select, .ds-feld textarea { width: 100%; box-sizing: border-box; }
.ds-feld .hint { margin: 0; }
.ds-zentral { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.ds-zentral .zeile-angabe { display: grid; grid-template-columns: 1fr 2fr; gap: 4px 12px; padding: 4px 0; }
.ds-zentral .zeile-angabe .leer { color: #b91c1c; font-weight: 600; }
@media (max-width: 560px) {
  .ds-zentral .zeile-angabe { grid-template-columns: 1fr; }
}
.ds-gut { border-left: 4px solid #15803d; background: #f0fdf4; padding: 12px 14px; border-radius: 6px; margin: 12px 0 0; }
