/* server/static/css/theme.css
   Erstellt: 2026-10-07 12:30 CET
   Geändert: 2026-10-27 CET — Doku aus dem Code im Reiter Dokumentation (E98)
   Geändert: 2026-10-27 CET — Fix: aktiver Reiter (nav-pills) weiss auf Grün statt Grün auf Grün; Verlauf lesbar
   Geändert: 2026-10-07 14:30 CET — Code-Ansicht: Diff, Dateibaum
   Geändert: 2026-10-07 15:20 CET — gewählter Listeneintrag im Thema statt Bootstrap-Blau
   Geändert: 2026-10-07 17:40 CET — Review: Statuszeile, Kommentare, anklickbare Zeilen (E43)
   Geändert: 2026-10-07 23:40 CET — Patch-Ansicht mit Zeilennummern und Syntaxfarben (E46)
   Geändert: 2026-10-07 23:25 CET — Verlauf, Versionen, Dateien nebeneinander (E47)
   Geändert: 2026-10-08 19:55 CET — Zeitpunkt beim Deploy (E52)
   Geändert: 2026-10-08 21:40 CET — Zugangsanfragen auf der Geräte-Seite (E54)
   Geändert: 2026-10-09 00:30 CET — Dokumente: Vorschau von Bildern, PDFs, Markdown (E56)
   Geändert: 2026-10-21 20:40 CET — Vergleich: Zeilennummern, geänderte Wörter, Vergleichsleiste (E87)
   Geändert: 2026-10-21 22:00 CET — nebeneinander, aufklappbarer Kontext, Dateiliste (E87 Phase 4)
   Geändert: 2026-10-21 23:40 CET — Antworten, erledigte Einträge, Vorschlag (E87 Phase 5)
   Geändert: 2026-10-22 03:40 CET — Verlauf und Herkunft je Datei (E89)
   Geändert: 2026-10-22 CET — Startseite: Beispielbilder (.landing-shot)
   Forge-Thema über Bootstrap 5.3 (lokal, kein CDN; Entscheidung E33).
   Alle Farben stehen hier als Variablen. Kein Inline-Stil in den Templates:
   die Content-Security-Policy erlaubt nur Stylesheets von der eigenen Adresse. */

:root {
  --color-primary:        #2e7d32;
  --color-primary-light:  #4caf50;
  --color-primary-dark:   #1b5e20;
  --color-primary-muted:  #e8f5e9;

  --color-bg:             #f8f9fa;
  --color-surface:        #ffffff;
  --color-border:         #dee2e6;
  --color-text:           #212529;
  --color-text-muted:     #6c757d;
  --color-danger:         #e53935;

  --radius-md:            10px;
  --radius-lg:            16px;
  --shadow-sm:            0 1px 3px rgba(0, 0, 0, .08);
  --shadow-md:            0 4px 12px rgba(0, 0, 0, .10);

  /* Bootstrap auf das Thema einstellen */
  --bs-primary:           #2e7d32;
  --bs-primary-rgb:       46, 125, 50;
  --bs-link-color:        #2e7d32;
  --bs-link-color-rgb:    46, 125, 50;
  --bs-link-hover-color:  #1b5e20;
  --bs-link-hover-color-rgb: 27, 94, 32;
  --bs-body-bg:           #f8f9fa;
  --bs-body-color:        #212529;
  --bs-font-sans-serif:   system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-font-monospace:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body { line-height: 1.6; }

.btn-primary {
  --bs-btn-bg: var(--color-primary);
  --bs-btn-border-color: var(--color-primary-dark);
  --bs-btn-hover-bg: var(--color-primary-dark);
  --bs-btn-hover-border-color: var(--color-primary-dark);
  --bs-btn-active-bg: var(--color-primary-dark);
  --bs-btn-active-border-color: var(--color-primary-dark);
  --bs-btn-disabled-bg: var(--color-primary);
  --bs-btn-disabled-border-color: var(--color-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-bg: var(--color-primary);
  --bs-btn-hover-border-color: var(--color-primary);
  --bs-btn-active-bg: var(--color-primary-dark);
  --bs-btn-active-border-color: var(--color-primary-dark);
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 .2rem rgba(46, 125, 50, .2);
}
.nav-link.active { color: var(--color-primary) !important; font-weight: 600; }
/* Pillen haben einen farbigen Hintergrund: dort weisse Schrift (sonst unlesbar). */
.nav-pills .nav-link.active { color: #ffffff !important; background-color: var(--color-primary); }
/* Verlauf: rückgängig gemachte Operationen */
.timeline-undone .timeline-title { text-decoration: line-through; }

/* Eigene Hilfsklassen */
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.shadow-md  { box-shadow: var(--shadow-md) !important; }
.bg-primary-muted { background: var(--color-primary-muted) !important; }
.mono { font-family: var(--bs-font-monospace); font-size: .92em; }
.num  { text-align: right; font-variant-numeric: tabular-nums; }

.card-narrow { max-width: 30rem; }
.card-login  { max-width: 27.5rem; }

/* Initiale statt Profilbild */
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary); color: #fff; font-weight: 700; font-size: .9rem;
}

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.facts dt { color: var(--color-text-muted); font-weight: 400; }
.facts dd { margin: 0; }

.code-block {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: .75rem 1rem; margin: 0;
  font-family: var(--bs-font-monospace); font-size: .88rem; overflow-x: auto;
}
.table > thead th {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted); font-weight: 600; white-space: nowrap;
}
.rename-input { min-width: 12rem; }

/* Code-Ansicht (E40) */
.code-view {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); margin: 0 0 1rem; overflow-x: auto;
  font-family: var(--bs-font-monospace); font-size: .82rem; line-height: 1.45;
}
.code-view .line { display: block; padding: 0 .75rem; white-space: pre; min-height: 1.45em; }
.code-view .line-add  { background: #e6ffed; }
.code-view .line-del  { background: #ffeef0; }
.code-view .line-hunk { background: #f1f8ff; color: var(--color-text-muted); }
.code-view .line-head { color: var(--color-text-muted); }
/* Vergleich (E87): Zeilennummern, Vorzeichen, geänderte Wörter, fehlender Umbruch */
.code-view .ln {
  display: inline-block; min-width: 2.6rem; padding-right: .5rem; text-align: right;
  color: var(--color-text-muted); user-select: none;
}
.code-view .sign { display: inline-block; width: 1rem; color: var(--color-text-muted); user-select: none; }
.code-view .diff-word-add { background: #acf2bd; border-radius: 2px; }
.code-view .diff-word-del { background: #fdb8c0; border-radius: 2px; }
.code-view .no-eol { color: var(--color-text-muted); margin-left: .25rem; }
.compare-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: .5rem .75rem;
}
.compare-bar select { max-width: 22rem; }
/* E87 Phase 4: nebeneinander, aufklappbarer Kontext, Dateiliste */
.code-split .split-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.code-split .split-row > .line { overflow: hidden; }
.code-split .split-row > .line + .line { border-left: 1px solid var(--color-border); }
.code-view .line-empty { background: var(--color-bg); }
.code-view .line-gap {
  display: block; width: 100%; border: 0; text-align: left; padding: .1rem .75rem;
  background: #f1f8ff; color: var(--color-primary); font-family: inherit; font-size: inherit;
}
.code-view .line-gap:hover { text-decoration: underline; }
.diff-file { display: flex; align-items: center; gap: .5rem; padding: .1rem 0; }
.diff-file.viewed { opacity: .55; }
.diff-stats { margin-left: auto; font-family: var(--bs-font-monospace); }
.viewed-toggle { display: inline-flex; align-items: center; cursor: pointer; }
/* E89: Verlauf und Herkunft je Datei */
.file-history .history-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .2rem 0; border-bottom: 1px solid var(--color-border); }
.code-blame .blame-who {
  display: inline-block; width: 11rem; margin-right: .5rem; border: 0; padding: 0; text-align: left;
  background: none; color: var(--color-text-muted); font: inherit; overflow: hidden; vertical-align: top;
}
.code-blame .blame-who:hover { color: var(--color-primary); text-decoration: underline; }
.code-blame .blame-odd { background: var(--color-bg); }
/* E87 Phase 5: Antworten, erledigte Einträge, Vorschlag */
.comment-reply { border-left: 2px solid var(--color-border); padding-left: .5rem; margin: .25rem 0 0 .25rem; }
.comment-resolved > .comment-text { color: var(--color-text-muted); }
.suggest-form { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: .5rem .75rem; }
.file-head {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-family: var(--bs-font-monospace); font-size: .88rem; margin: 1rem 0 .35rem;
}
.file-tree { list-style: none; padding-left: 0; margin: 0; font-family: var(--bs-font-monospace); font-size: .88rem; }
.file-tree .file-tree { padding-left: 1.1rem; }
.file-tree button { border: 0; background: none; padding: .1rem 0; color: var(--color-primary); text-align: left; }
.file-tree button:hover { text-decoration: underline; }
.file-tree .size { color: var(--color-text-muted); margin-left: .5rem; }
.badge-letter { font-family: var(--bs-font-monospace); min-width: 1.6rem; }

/* Review (E43): Statuszeile, Kommentare, anklickbare Zeilen */
.review-bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: .5rem .75rem;
}
.code-view .line-pick { cursor: pointer; }
.code-view .line-pick:hover { box-shadow: inset 3px 0 0 var(--color-primary-light); }
.code-view .line-picked { box-shadow: inset 3px 0 0 var(--color-primary) !important; }
.code-view .line-comment {
  display: block; white-space: pre-wrap; font-family: var(--bs-font-sans-serif); font-size: .85rem;
  background: #fff8e1; border-left: 3px solid #f9a825; padding: .35rem .75rem;
}
.comment {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: .5rem .75rem; margin-bottom: .5rem; background: var(--color-surface);
}
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .25rem 0 0; }

/* Gewählter Eintrag in Listen (z.B. Changes): Farben des Themas statt Bootstrap-Blau,
   dunkler Text auf hellem Grün, damit auch die Nebenzeile lesbar bleibt. */
.list-group {
  --bs-list-group-active-bg: var(--color-primary-muted);
  --bs-list-group-active-border-color: var(--color-primary-light);
  --bs-list-group-active-color: var(--color-text);
}
.list-group-item.active { box-shadow: inset 3px 0 0 var(--color-primary); }

/* Patch-Ansicht der Review-Seite (E46) */
.patch-wrap {
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  overflow-x: auto; margin: 0 0 1.25rem; background: var(--color-surface);
}
.patch {
  width: 100%; border-collapse: collapse;
  font-family: var(--bs-font-monospace); font-size: .82rem; line-height: 1.45;
}
.patch td { padding: 0 .6rem; vertical-align: top; }
.patch .ln {
  width: 1%; min-width: 3.2rem; text-align: right; white-space: nowrap; user-select: none;
  color: var(--color-text-muted); background: var(--color-bg); border-right: 1px solid var(--color-border);
}
.patch .code { white-space: pre; tab-size: 4; }
.patch .row-add .code { background: #e6ffed; }
.patch .row-add .ln   { background: #cdffd8; }
.patch .row-del .code { background: #ffeef0; }
.patch .row-del .ln   { background: #ffdce0; }
.patch .row-gap td { text-align: center; color: var(--color-text-muted); background: #f1f8ff; }
.patch .row-comment td {
  white-space: normal; font-family: var(--bs-font-sans-serif); font-size: .85rem;
  background: #fff8e1; border-left: 3px solid #f9a825; padding: .35rem .75rem;
}
.patch .ln-pick { cursor: pointer; }
.patch .ln-pick:hover { color: var(--color-primary-dark); font-weight: 700; }
.patch .ln-picked { box-shadow: inset -3px 0 0 var(--color-primary); color: var(--color-primary-dark); font-weight: 700; }
.patch-file { scroll-margin-top: 1rem; }
.file-index li { padding: .1rem 0; }
.deploy-summary { white-space: pre-wrap; max-width: 28rem; }

/* Syntaxfarben: Klassen von Pygments mit Vorsatz `tok-`, nach Gruppen. */
[class^="tok-c"]  { color: #6a737d; font-style: italic; }   /* Kommentare */
[class^="tok-k"]  { color: #d73a49; }                       /* Schlüsselwörter */
[class^="tok-o"]  { color: #d73a49; }                       /* Operatoren */
[class^="tok-s"]  { color: #032f62; }                       /* Zeichenketten */
[class^="tok-m"]  { color: #005cc5; }                       /* Zahlen */
.tok-nf, .tok-fm, .tok-nc, .tok-nn { color: #6f42c1; }      /* Funktionen, Klassen */
.tok-nb, .tok-bp, .tok-nt, .tok-na, .tok-nd { color: #005cc5; } /* Eingebautes, Tags, Attribute */
.tok-nv, .tok-vi, .tok-vc, .tok-vg { color: #e36209; }      /* Variablen */
.tok-gh, .tok-gu { color: #005cc5; font-weight: 700; }      /* Überschriften (Markdown) */
.tok-ge { font-style: italic; }
.tok-gs { font-weight: 700; }

/* Verlauf und Versionen (E47) */
.timeline-day {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted); margin: 1.25rem 0 .5rem;
}
.timeline-day:first-of-type { margin-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .4rem; border-left: 2px solid var(--color-border); }
.timeline-item { position: relative; display: flex; gap: .75rem; padding: .3rem 0 .3rem 1rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -.42rem; top: .7rem; width: .7rem; height: .7rem;
  border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-text-muted);
}
.timeline-item.tone-good::before { border-color: var(--color-primary); background: var(--color-primary); }
.timeline-item.tone-bad::before  { border-color: #d73a49; background: #d73a49; }
.timeline-item.tone-wait::before { border-color: #f9a825; background: #fff8e1; }
.timeline-item.tone-mark::before { border-color: #212529; background: #212529; border-radius: 2px; }
.timeline-time { flex: 0 0 2.8rem; font-family: var(--bs-font-monospace); font-size: .8rem; color: var(--color-text-muted); padding-top: .15rem; }
.timeline-body { min-width: 0; overflow-wrap: anywhere; }
.release { display: flex; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--color-border); }
.release:first-of-type { border-top: 0; }
.release-major { flex: 0 0 3.5rem; font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.release-x { font-size: 1rem; color: var(--color-text-muted); font-weight: 400; }
.release-minors { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.release-minors li { padding: .3rem 0; }
.release-minors li + li { border-top: 1px dashed var(--color-border); }

/* Dateien vergleichen: Dateiliste links, zwei Fassungen nebeneinander (E47) */
.file-browser { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.file-folder { font-family: var(--bs-font-monospace); font-size: .78rem; color: var(--color-text-muted); padding: .5rem 0 .15rem; overflow-wrap: anywhere; }
.file-entry { padding: .3rem .5rem; font-size: .85rem; display: flex; gap: .4rem; align-items: center; }
.file-entry.in-folder { padding-left: 1rem; }
.file-entry .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.split-wrap { max-height: calc(100vh - 6rem); overflow: auto; }
.patch.split { table-layout: fixed; min-width: 56rem; }
.patch.split col.col-ln { width: 3.4rem; }
.patch.split .ln { width: auto; min-width: 0; }
.patch.split .code { white-space: pre-wrap; overflow-wrap: anywhere; }
.patch.split .side-new { border-left: 0; }
.patch.split td.ln + td.code + td.ln { border-left: 1px solid var(--color-border); }
.split-title {
  position: sticky; top: 0; z-index: 1; background: var(--color-bg); border-bottom: 1px solid var(--color-border);
  font-family: var(--bs-font-sans-serif); font-size: .8rem; font-weight: 600; padding: .35rem .6rem; text-align: left;
}
.split-change .side-old, .split-del .side-old { background: #ffeef0; }
.split-change .side-new, .split-add .side-new { background: #e6ffed; }
.patch.split .side-empty { background: repeating-linear-gradient(-45deg, #f6f8fa, #f6f8fa 6px, #eef1f4 6px, #eef1f4 12px); }
.split-here td { box-shadow: inset 0 2px 0 var(--color-primary); }

/* Deploy zu einem Zeitpunkt (E52) */
.deploy-at { width: auto; max-width: 12.5rem; }

/* Zugangsanfragen (E54): Prüfcode gross und gut vergleichbar */
.request-code { letter-spacing: 0.08em; }
.request-card .btn-lg { min-width: 8rem; }

/* ---------------------------------------------------------- Dokumente (E56) */
.doc-path {
  color: var(--bs-secondary-color);
  overflow-wrap: anywhere;
}
.file-entry.active .doc-path {
  color: inherit;
}
.doc-image-wrap {
  background: var(--bs-tertiary-bg);
  border-radius: .5rem;
  padding: 1rem;
  text-align: center;
}
.doc-image,
.doc-inline-image {
  max-width: 100%;
  height: auto;
}
.doc-pdf {
  width: 100%;
  height: 80vh;
  border: 0;
  border-radius: .5rem;
}
.doc-markdown {
  max-width: 52rem;
  line-height: 1.6;
}
.doc-h {
  font-weight: 700;
  margin: 1.25rem 0 .5rem;
}
.doc-h1 { font-size: 1.6rem; }
.doc-h2 { font-size: 1.3rem; }
.doc-h3 { font-size: 1.1rem; }
.doc-quote {
  border-left: 3px solid var(--bs-border-color);
  padding-left: 1rem;
  color: var(--bs-secondary-color);
}
.doc-code {
  background: var(--bs-tertiary-bg);
  border-radius: .5rem;
  padding: .75rem 1rem;
  font-size: .85rem;
}
.file-entry.doc-entry {
  display: block;
}
/* Doku aus dem Code (E98): breite Tabellen, Beschreibung lesbar, Bilder mit weissem Grund */
.generated-docs {
  max-width: none;
}
.generated-docs td:last-child {
  min-width: 18rem;
}
.generated-docs td code {
  overflow-wrap: anywhere;
}
.generated-docs td:first-child code {
  white-space: nowrap;
  overflow-wrap: normal;
}
.generated-docs .doc-image-wrap {
  background: #ffffff;
  overflow-x: auto;
}
/* Öffentliche Startseite (Landing) */
.landing-hero {
  background: linear-gradient(135deg, #2c3e9e, #4f6ee0);
}

/* Dokumentation als Dateimanager (links Verzeichnisbaum, rechts Inhalt) */
.file-tree-pane {
  border: 1px solid #e2e6ea;
  background: #f8f9fa;
  border-radius: .5rem;
  padding: .75rem;
  max-height: 70vh;
  overflow: auto;
  position: sticky;
  top: 1rem;
}
.file-tree-item {
  white-space: nowrap;
  padding: .1rem 0;
}
.file-tree-dir {
  color: #495057;
  font-weight: 600;
}
.file-tree-link {
  color: #0d6efd;
  cursor: pointer;
}

/* Startseite: Beispielbilder der Web-Oberfläche (Demo-Tenant, erfundene Daten) */
.landing-shot {
  margin: 0;
}
.landing-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.06);
}
.landing-shot figcaption {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}
.landing-shot + .landing-shot {
  margin-top: 1rem;
}
