/* Modul Nutzungsdauer (static/js/nd_nachweise.js). Nutzt die Variablen aus style.css. */

.nd-karte { margin-bottom: 1.25rem; }
.nd-karte:hover { transform: none; }
.nd-titel {
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); margin-bottom: 1rem;
}
.nd-raster + .nd-titel { margin-top: 0.5rem; }
.nd-untertitel { font-size: 0.85rem; margin: 1.1rem 0 0.4rem; }
.nd-hilfe, .nd-klein { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.nd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nd-num { text-align: right; white-space: nowrap; }
.nd-quelle { font-size: 0.75rem; color: var(--text-secondary); }
.nd-link {
  background: none; border: none; padding: 0; font: inherit; color: var(--accent);
  text-decoration: underline; cursor: pointer; text-align: left;
}
.nd-link:hover { color: var(--accent-hover); }
.nd-link-gefahr { color: var(--danger); font-size: 0.8rem; }
.nd-ungueltig { border-color: var(--danger) !important; }
.nd-markiert { box-shadow: 0 0 0 3px rgba(16, 132, 92, 0.35) !important; transition: box-shadow 0.3s; }

/* Kopf */
.nd-zurueck { display: inline-block; font-size: 0.85rem; margin-bottom: 0.3rem; }
.nd-aktionen { align-items: center; }
.nd-status {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
}
.nd-status select { width: auto; min-width: 13rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.nd-speicher { font-size: 0.8rem; color: var(--text-secondary); flex-basis: 100%; text-align: right; min-height: 1.2em; }
.nd-speicher:empty { display: none; }
.nd-speicher-ok { color: var(--success); }
.nd-speicher-fehler { color: var(--danger); font-weight: 600; }

/* Ergebnisleiste */
.nd-ergebnis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 0.75rem; margin-bottom: 1rem;
}
.nd-chip {
  display: flex; flex-direction: column; gap: 0.15rem; text-align: left;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.7rem 1rem; font: inherit; color: inherit;
}
button.nd-chip { cursor: pointer; }
.nd-chip span, .nd-kpi span {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary);
}
.nd-chip strong, .nd-kpi strong { font-family: 'Instrument Serif', Georgia, serif; font-size: 1.45rem; line-height: 1.15; }
.nd-chip small, .nd-kpi small { font-size: 0.75rem; color: var(--text-secondary); }
.nd-chip-vorlaeufig strong { color: var(--warning); }
.nd-chip-ok { border-color: rgba(21, 147, 95, 0.35); background: rgba(21, 147, 95, 0.06); }
.nd-chip-ok strong { color: var(--success); }
.nd-chip-offen { border-color: rgba(180, 128, 26, 0.35); background: rgba(180, 128, 26, 0.06); }
.nd-chip-offen strong { color: var(--warning); }

.nd-info {
  background: var(--bg-tertiary); border-radius: var(--radius-md);
  padding: 0.7rem 1rem; margin-bottom: 1.25rem; font-size: 0.88rem;
}
.nd-info summary { cursor: pointer; font-weight: 600; }
.nd-info p { margin-top: 0.5rem; line-height: 1.55; }

/* Formulare: höchstens vier Spalten, am Handy eine */
.nd-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 1.25rem; }
.nd-raster-breit { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.nd-raster textarea, .nd-gewerk textarea { min-height: 80px; }
.form-group .nd-check, .nd-check {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; cursor: pointer;
  font-size: 0.88rem; font-weight: 500; color: var(--text-primary); text-transform: none; letter-spacing: 0;
}
/* .form-group input setzt appearance:none und volle Breite, das würde die Checkbox unsichtbar machen */
.nd-check input[type="checkbox"] {
  -webkit-appearance: checkbox; appearance: auto; flex: 0 0 auto;
  width: 18px; height: 18px; margin: 0; padding: 0;
}

/* Gewerk-Karten */
.nd-leiste { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.nd-leiste p { flex: 1 1 320px; }
.nd-gewerk { scroll-margin-top: 80px; }
.nd-gewerk-kopf { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.nd-gewerk-kopf h3 { flex: 1 1 220px; font-size: 1rem; }
.nd-nr {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary); color: var(--text-secondary); font-size: 0.8rem; font-weight: 700;
}
.nd-fertig .nd-nr { background: var(--accent); color: #fff; }
.nd-gewerk-inhalt { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 1.75rem; }
.nd-punkte-info { font-size: 0.85rem; color: var(--text-secondary); margin: -0.4rem 0 1rem; }
.nd-leitfaden {
  background: var(--bg-tertiary); border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem; margin-bottom: 0.9rem; font-size: 0.84rem; line-height: 1.5;
}
.nd-dateien-kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.4rem 0;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary);
}
.nd-upload { position: relative; cursor: pointer; padding: 0.45rem 0.9rem; font-size: 0.82rem; text-transform: none; letter-spacing: 0; }
.nd-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.nd-datei { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.nd-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.5rem; margin-bottom: 0.6rem; }
.nd-foto { position: relative; margin: 0; }
.nd-foto-bild {
  display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-tertiary);
}
.nd-foto-bild img { width: 100%; height: 100%; object-fit: cover; }
.nd-foto-loeschen {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 30, 52, 0.7); color: #fff; font-size: 1rem; line-height: 1;
}
.nd-foto-loeschen:hover, .nd-foto-loeschen:focus-visible { background: var(--danger); }
.nd-belege { margin-bottom: 0.6rem; }
.nd-belege li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.25rem 0; font-size: 0.88rem; word-break: break-word; }
.nd-leer { grid-column: 1 / -1; font-size: 0.82rem; color: var(--text-secondary); }
.nd-upload-status { font-size: 0.82rem; color: var(--accent); }
.nd-gewerk-offen { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.nd-gewerk-offen:empty { display: none; }
.nd-gewerk-offen li { font-size: 0.78rem; border-radius: 99px; padding: 0.2rem 0.65rem; }
.nd-gewerk-offen .nd-offen { background: rgba(180, 128, 26, 0.1); color: var(--warning); }
.nd-gewerk-offen .nd-hinweis { background: var(--bg-tertiary); color: var(--text-secondary); }

/* JH-Rechner */
.nd-schritte { list-style: decimal; padding-left: 1.3rem; margin-bottom: 1rem; font-size: 0.9rem; line-height: 1.7; }
.nd-kv { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin-bottom: 0.8rem; }
.nd-kv dt { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.nd-kv dd { font-size: 1.05rem; font-weight: 600; }
.nd-seite .table-responsive { margin-bottom: 1rem; }
.nd-tabelle th, .nd-tabelle td { padding: 0.55rem 0.8rem; }
.nd-tabelle tbody tr:hover { cursor: default; }
.nd-summe td { font-weight: 700; background: var(--bg-tertiary); }
.nd-warnbox {
  border: 1px solid rgba(180, 128, 26, 0.45); background: rgba(180, 128, 26, 0.08); border-radius: var(--radius-sm);
  padding: 0.8rem 1rem; margin: 0.5rem 0 1rem; font-size: 0.88rem; line-height: 1.5;
}
.nd-warnbox .btn-secondary { margin-top: 0.6rem; }
.nd-okbox {
  border: 1px solid rgba(21, 147, 95, 0.35); background: rgba(21, 147, 95, 0.07); border-radius: var(--radius-sm);
  padding: 0.8rem 1rem; font-size: 0.9rem; color: var(--success);
}

/* Abschluss */
.nd-pruefliste li { position: relative; padding: 0.4rem 0 0.4rem 1.3rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.nd-pruefliste li:last-child { border-bottom: none; }
.nd-pruefliste li::before {
  content: ''; position: absolute; left: 0.2rem; top: 0.85rem;
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--warning);
}
.nd-hinweise li::before { background: var(--text-secondary); opacity: 0.5; }
.nd-pruefliste .nd-link { color: var(--text-primary); text-decoration: none; }
.nd-pruefliste .nd-link:hover { color: var(--accent); text-decoration: underline; }
.nd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.nd-kpi { display: flex; flex-direction: column; gap: 0.15rem; background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: 0.75rem 1rem; }
.nd-kpi strong { font-size: 1.35rem; }
.nd-knoepfe { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.nd-wirkung { font-size: 0.9rem; }

/* Übersicht und Cockpit */
.nd-liste td { vertical-align: top; }
.nd-liste tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nd-cockpit-titel {
  font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary);
}

/* Foto-Ansicht */
.nd-lightbox {
  position: fixed; inset: 0; z-index: 2000; padding: 1rem; cursor: zoom-out;
  display: flex; align-items: center; justify-content: center; background: rgba(10, 20, 35, 0.9);
}
.nd-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.nd-lightbox-zu {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.5rem;
}

@media (max-width: 768px) {
  .nd-aktionen { width: 100%; }
  .nd-speicher { text-align: left; }
}
@media (max-width: 480px) {
  /* style.css setzt hier für alle Buttons 44 px Mindestgröße, das sprengt Textlinks und die Foto-Ecke */
  .nd-seite .nd-link { min-height: 0; min-width: 0; }
  .nd-seite .nd-foto-loeschen { width: 32px; height: 32px; min-width: 32px; min-height: 32px; }
  .nd-seite .card { padding: 1rem; }
  .nd-status { flex: 1 1 100%; }
  .nd-status select { min-width: 0; flex: 1; }
  .nd-chip strong { font-size: 1.2rem; }
}
