/* vielhand org: Feinschliff über Bootstrap 5.3. Hell als Standard, Dunkel umschaltbar.
   Aufbau wie der Admin von vielhand OS, dazu die Hilfe-Leiste am rechten Rand. */

:root {
  --sidebar-breite: 230px;
  --hilfe-breite: 290px;
  --akzent: #0e8a72;
  --akzent-hell: #19a98c;
  --bs-body-bg: #f7f5f0;
}

[data-bs-theme="dark"] {
  --bs-body-bg: #111214;
  --bs-body-color: #e6e6e3;
  --bs-secondary-bg: #1c1d20;
  --bs-tertiary-bg: #23252a;
  --bs-border-color: #2c2e33;
  --bs-link-color: #4cc2a8;
  --bs-link-hover-color: #7fd8c4;
  --bs-link-color-rgb: 76, 194, 168;
  --bs-link-hover-color-rgb: 127, 216, 196;
}

body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }

.app-shell { display: flex; min-height: 100vh; }

/* ---- Seitenleiste links ---- */
.sidebar {
  width: var(--sidebar-breite); flex: 0 0 var(--sidebar-breite);
  position: sticky; top: 0; height: 100vh; padding: 1.25rem .9rem;
  border-right: 1px solid var(--bs-border-color); background: var(--bs-secondary-bg);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--bs-body-color); font-weight: 600; padding: .25rem .5rem 1rem; line-height: 1.15; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--bs-secondary-color); }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--akzent); color: #fff; font-size: 1.1rem; }
.sidebar .nav-link { color: var(--bs-body-color); border-radius: .5rem; padding: .5rem .75rem; display: flex; align-items: center; gap: .65rem; font-size: .95rem; }
.sidebar .nav-link i { width: 1.2rem; text-align: center; opacity: .8; }
.sidebar .nav-link:hover { background: var(--bs-tertiary-bg); }
.sidebar .nav-link.active { background: rgba(14, 138, 114, .13); color: var(--akzent); font-weight: 500; }
[data-bs-theme="dark"] .sidebar .nav-link.active { color: var(--akzent-hell); }
.nav-zahl { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-weight: 500; }
.nav-zahl-faellig { background: var(--bs-danger); color: #fff; }

/* Stufen als Reiter über der Kontaktliste */
.stufen { display: flex; flex-wrap: wrap; gap: .4rem; }
.stufen a { text-decoration: none; padding: .3rem .75rem; border: 1px solid var(--bs-border-color); border-radius: 2rem; color: var(--bs-body-color); font-size: .9rem; background: var(--bs-body-bg); }
[data-bs-theme="dark"] .stufen a { background: var(--bs-secondary-bg); }
.stufen a .anzahl { color: var(--bs-secondary-color); margin-left: .25rem; }
.stufen a.aktiv { border-color: var(--akzent); background: rgba(14, 138, 114, .12); color: var(--akzent); font-weight: 500; }
[data-bs-theme="dark"] .stufen a.aktiv { color: var(--akzent-hell); }
.stufen a.faellig { border-color: var(--bs-danger); color: var(--bs-danger); }
.stufen .trenner { width: 1px; background: var(--bs-border-color); margin: 0 .2rem; }
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--bs-border-color); }

/* ---- Inhalt ---- */
.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.mobile-nav { background: var(--bs-secondary-bg); }
.content { padding: 1.5rem 1.75rem 3rem; max-width: 1300px; width: 100%; }
@media (max-width: 575.98px) { .content { padding: 1rem 1rem 2rem; } }
.content-plain { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; gap: 1rem; }
.login-card { width: 100%; max-width: 420px; }

.card { border-color: var(--bs-border-color); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
[data-bs-theme="dark"] .card { background: var(--bs-secondary-bg); box-shadow: none; }
.card-header { background: transparent; border-bottom-color: var(--bs-border-color); font-weight: 600; }

.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .55rem .75rem; vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); font-weight: 600; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.nummer { font-variant-numeric: tabular-nums; color: var(--bs-secondary-color); white-space: nowrap; }

.form-label { font-size: .85rem; color: var(--bs-secondary-color); margin-bottom: .3rem; }
.sub { color: var(--bs-secondary-color); font-size: .85rem; }

.kpi { text-decoration: none; color: inherit; transition: border-color .15s; }
.kpi:hover { border-color: var(--akzent); color: inherit; }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); }
.kpi-wert { font-size: 1.9rem; font-weight: 600; line-height: 1.15; margin-top: .25rem; }

.schlagwort { background: rgba(14, 138, 114, .1); color: var(--akzent); font-weight: 500; text-decoration: none; }
[data-bs-theme="dark"] .schlagwort { color: var(--akzent-hell); }

.btn-primary { --bs-btn-bg: #0e8a72; --bs-btn-border-color: #0e8a72; --bs-btn-hover-bg: #0b7560; --bs-btn-hover-border-color: #0b7560; --bs-btn-active-bg: #09624f; --bs-btn-active-border-color: #09624f; --bs-btn-disabled-bg: #0e8a72; --bs-btn-disabled-border-color: #0e8a72; }
.btn-outline-primary { --bs-btn-color: #0e8a72; --bs-btn-border-color: #0e8a72; --bs-btn-hover-bg: #0e8a72; --bs-btn-hover-border-color: #0e8a72; --bs-btn-hover-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--akzent-hell); box-shadow: 0 0 0 .2rem rgba(14, 138, 114, .2); }
.form-check-input:checked { background-color: var(--akzent); border-color: var(--akzent); }

/* ---- Beschreibung, Verlauf, Bilder ---- */
.text-inhalt { line-height: 1.55; overflow-wrap: anywhere; }
.anhang-bild { max-width: 100%; max-height: 420px; border: 1px solid var(--bs-border-color); border-radius: .4rem; margin: .35rem 0; display: block; }
.eintrag-nummer { font-weight: 500; }

.verlauf { list-style: none; padding: 0; margin: 0; }
.verlauf > li { position: relative; padding: 0 0 1rem 1.6rem; }
.verlauf > li::before { content: ""; position: absolute; left: .45rem; top: 1.1rem; bottom: 0; border-left: 2px solid var(--bs-border-color); }
.verlauf > li:last-child::before { display: none; }
.verlauf .punkt { position: absolute; left: 0; top: .2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; display: grid; place-items: center; font-size: .6rem; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); }
.verlauf .kommentar .punkt { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.verlauf .erinnerung .punkt, .verlauf .hinweis .punkt { background: #fab219; color: #3a2a00; border-color: #fab219; }
.verlauf .hinweis .aenderung { color: var(--bs-body-color); }
/* Antworten an den Betrieb heben sich von internen Notizen ab. */
.verlauf .antwort .punkt { background: #2a78d6; border-color: #2a78d6; }
.verlauf .antwort .blase { border-color: #2a78d6; border-left-width: 3px; }
.antwort-formular { border-color: #2a78d6; }
.verlauf .kopf { font-size: .85rem; color: var(--bs-secondary-color); }
.verlauf .kopf strong { color: var(--bs-body-color); font-weight: 600; }
.verlauf .blase { margin-top: .3rem; padding: .6rem .8rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: var(--bs-body-bg); }
[data-bs-theme="dark"] .verlauf .blase { background: var(--bs-tertiary-bg); }
.verlauf .aenderung { font-size: .85rem; color: var(--bs-secondary-color); }

textarea[data-bilder].ziehen { border-color: var(--akzent); background: rgba(14, 138, 114, .05); }
.bild-vorschau { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.bild-kachel { width: 96px; height: 72px; border: 1px solid var(--bs-border-color); border-radius: .35rem; overflow: hidden; display: grid; place-items: center; font-size: .75rem; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); }
.bild-kachel img { width: 100%; height: 100%; object-fit: cover; }
.bild-kachel.fehler { width: auto; padding: 0 .5rem; color: var(--bs-danger); }

.aehnlich { margin-top: .5rem; padding: .5rem .75rem; border: 1px dashed var(--bs-border-color); border-radius: .5rem; font-size: .9rem; }

/* ---- Hilfe-Leiste rechts ---- */
.hilfe-leiste {
  width: var(--hilfe-breite); flex: 0 0 var(--hilfe-breite);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 1.25rem 1rem; border-left: 1px solid var(--bs-border-color); background: var(--bs-secondary-bg);
  font-size: .9rem;
}
.hilfe-kopf { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--bs-secondary-color); text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; margin-bottom: 1rem; }
.hilfe-block { margin-bottom: 1.25rem; }
.hilfe-feld { padding-top: 1rem; border-top: 1px solid var(--bs-border-color); }
.hilfe-titel { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; font-weight: 600; margin-bottom: .4rem; }
.hilfe-text p { margin-bottom: .55rem; line-height: 1.5; }
.hilfe-zeigen {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1040; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--akzent); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); display: none;
}
.hilfe-zeigen:hover { background: #0b7560; color: #fff; }
html.hilfe-aus .hilfe-leiste { display: none; }
html.hilfe-aus .hilfe-zeigen { display: grid; place-items: center; }

/* Schmale Bildschirme: Hilfe nur auf Knopfdruck, als Einblendung von rechts. */
@media (max-width: 1199.98px) {
  .hilfe-leiste { display: none; position: fixed; right: 0; top: 0; z-index: 1045; box-shadow: -4px 0 16px rgba(0,0,0,.15); }
  html.hilfe-offen .hilfe-leiste { display: block; }
  .hilfe-zeigen { display: grid; place-items: center; }
  html.hilfe-offen .hilfe-zeigen { display: none; }
}
