/* styles-dekra.css — alles, was von der TrUL-App abweicht.
 *
 * REGEL: styles.css bleibt eine unveränderte Kopie aus der Trupp-UL-App, damit
 * sie bei einer Neuerung dort einfach neu kopiert werden kann. Jede eigene
 * Farbe und jede Ergänzung gehört hierher. Siehe SYNC-TRUL.md.
 */

/* --- DEKRA-Grün statt THW-Blau ------------------------------------------ */

:root {
  --blue: #00893e;
  --blue-soft: #dff2e6;
  --active-strip: #00893e;
  --item-active-bg: #e8f6ee;
  --page-glow: rgba(0, 137, 62, 0.06);
}

:root[data-theme="dark"],
:root[data-theme="light"],
:root:not([data-theme]) {
  --blue: #00893e;
  --active-strip: #00893e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #35bb71;
    --blue-soft: rgba(53, 187, 113, 0.18);
    --active-strip: #35bb71;
    --item-active-bg: rgba(53, 187, 113, 0.12);
    --page-glow: rgba(53, 187, 113, 0.07);
  }
}

:root[data-theme="dark"] {
  --blue: #35bb71;
  --blue-soft: rgba(53, 187, 113, 0.18);
  --active-strip: #35bb71;
  --item-active-bg: rgba(53, 187, 113, 0.12);
}

button,
[data-action],
.item-card,
.sidebar-row,
.section-toggle {
  -webkit-tap-highlight-color: rgba(0, 137, 62, 0.12);
}

/* --- Startbild ----------------------------------------------------------- */

#app.app-loading .boot-screen {
  color: var(--muted);
}

/* --- Werkzeugzeilen in der Seitenleiste ---------------------------------- */

.sidebar-row--tool .sidebar-symbol {
  font-size: 20px;
}

.sidebar-build {
  margin: 18px 4px 0;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.75;
}

.section-empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* --- Befundfeld je Checkpunkt (nicht in der TrUL-App enthalten) ---------- */

.item-note {
  margin: 8px 0 0 52px;
}

.item-note textarea {
  width: 100%;
  min-height: 38px;
  resize: none;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.item-note textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.item-note textarea:focus {
  outline: none;
  border-style: solid;
  border-color: var(--blue);
  background: var(--panel-muted);
}

.item-note.has-note textarea {
  border-style: solid;
  border-color: var(--orange);
  background: var(--orange-soft);
}

@media (max-width: 599px) {
  .item-note {
    margin-left: 0;
  }
}

/* --- Logbuch ------------------------------------------------------------- */

.log-notes {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.log-notes li + li {
  margin-top: 4px;
}

/* --- Hinweisstreifen ----------------------------------------------------- */

.toast {
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  max-width: min(88vw, 520px);
  text-align: center;
  font-size: 14px;
}

.toast.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}

/* =======================================================================
 * DEKRA-Erweiterungen zum TrUL-Stylesheet
 * ======================================================================= */

/* --- Status „Befund" (in der TrUL-App nicht vorhanden) ------------------- */

.progress-segment--finding {
  background: var(--red);
}

.item-card--finding {
  background: var(--red-soft);
}

.item-card--finding::before {
  opacity: 1;
  background: var(--red);
}

.item-card--finding .item-status-icon,
.item-card--finding .item-status-icon-button {
  background: #c0272d;
  color: #fff;
}

.status-surface--finding {
  background: #f6ccce;
  color: #9b1f24;
}

.status-pill--finding {
  background: var(--red-soft);
  color: var(--red);
}

:root[data-theme="dark"] .item-card--finding,
:root[data-theme="dark"] .status-surface--finding,
:root[data-theme="dark"] .status-pill--finding {
  background: rgba(192, 39, 45, 0.18);
  color: #ff9ea2;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .item-card--finding {
    background: rgba(192, 39, 45, 0.16);
  }
  :root:not([data-theme="light"]) .status-surface--finding,
  :root:not([data-theme="light"]) .status-pill--finding {
    background: rgba(192, 39, 45, 0.22);
    color: #ff9ea2;
  }
}

/* --- Merkposten (typ „hinweis"): zählen nicht in den Fortschritt --------- */

.item-card--merkposten {
  opacity: 0.92;
}

.item-card--merkposten .item-question {
  font-weight: 500;
}

.item-card--merkposten .expected-badge {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* --- Normbeleg am Prüfpunkt --------------------------------------------- */

.item-norm {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.item-norm::before {
  content: "§ ";
  opacity: 0.6;
}

/* --- Poolar-Zeile unter einem Befund ------------------------------------ */

.item-note.is-finding textarea {
  border-color: var(--red);
  background: var(--panel);
}

.item-poolar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-muted);
  border: 1px solid var(--line);
}

.item-poolar__text {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.item-poolar .ghost-button {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 6px 10px;
}

/* --- Projektkopf auf der Startseite -------------------------------------- */

.projekt-liste {
  margin: 0;
  display: grid;
  gap: 10px;
}

.projekt-liste > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.projekt-liste dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.projekt-liste dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.projekt-vorbehalt {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--orange-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 599px) {
  .projekt-liste > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* --- Befunde im Logbuch -------------------------------------------------- */

.log-notes--finding {
  list-style: none;
  padding-left: 0;
}

.log-notes--finding li {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  margin-top: 6px;
}

.log-notes--finding em {
  color: var(--muted);
  font-size: 13px;
}

/* Zusammengeklapptes Notizfeld: nur ein schmaler Anreißer, bis der Punkt
   bewertet ist. Bei 59 Punkten sonst 59 leere Kästen untereinander. */
.item-note.is-collapsed {
  display: none;
}
