/* ════════════════════════════════════════════════════════════════════════════
   VICore — Fotodokumentation (optionales Vorgangsmodul). Light-Theme wie die
   übrige Vorgangsdetailansicht; kompakte, schnell bedienbare Masken (Etappe 6/7).
   ════════════════════════════════════════════════════════════════════════════ */
:root { --pd-border: var(--vi-border, #D8DFDC); --pd-ink: var(--vi-ink, #141A17); --pd-muted: var(--vi-ink-70, #3A4441);
  --pd-green: var(--vi-green, #12704B); --pd-green-deep: var(--vi-green-deep, #0F5C42); --pd-tint: var(--vi-green-tint, #EDF7F2);
  --pd-sand: var(--vi-sand, #F7F5EF); --pd-r: 10px; }

/* „Mehr"-Button rechts in der Tableiste + echtes Dropdown (position:fixed, per JS positioniert →
   liegt über dem Inhalt, wird NICHT von der scrollbaren Tableiste abgeschnitten). */
.pd-more-wrap { position: relative; display: inline-flex; margin-left: 0; flex: 0 0 auto; }
.pd-more-btn { display: inline-flex; align-items: center; gap: 5px; }
.pd-more-btn .pd-more-caret { opacity: .7; transition: transform .15s var(--vi-ease, ease); }
.pd-more-btn.pd-more-open .pd-more-caret { transform: rotate(180deg); }
.pd-more-menu { position: fixed; min-width: 240px; max-width: 86vw; background: var(--color-surface); border: 1px solid var(--pd-border);
  border-radius: var(--pd-r); box-shadow: 0 14px 40px rgba(20,40,28,.20); z-index: 4000; padding: 5px; display: none; }
.pd-more-menu.pd-open { display: block; }
.pd-more-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 40px; padding: 9px 12px; border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-sm);
  color: var(--pd-ink); text-align: left; }
.pd-more-item:hover { background: var(--pd-tint); }
.pd-more-item:focus-visible { outline: 2px solid var(--pd-green-deep); outline-offset: -2px; background: var(--pd-tint); }
.pd-more-item.is-active { background: var(--pd-green-deep); color: var(--color-surface); }
.pd-more-lbl { white-space: nowrap; }
.pd-more-count { font-size: var(--text-xxs); font-weight: 700; background: var(--pd-sand); color: var(--pd-muted);
  border-radius: var(--radius-pill); padding: 1px 8px; min-width: 20px; text-align: center; }
.pd-more-item.is-active .pd-more-count { background: rgba(255,255,255,.25); color: var(--color-surface); }
/* Tableiste: knapperer Abstand, damit Standard-Tabs + „Mehr" auf Laptop ohne Horizontal-Scroll passen.
   Das Dropdown ist position:fixed → unabhängig vom (als Sicherheitsnetz belassenen) overflow der Leiste. */
.page-vorgang-detail .workspace-tabs { gap: 3px; }
#case-detail-modal .case-tabs-nav { gap: 3px; }

/* Host + Kopf */
.pd-host { min-height: 120px; }
.pd-loading { padding: 28px; text-align: center; color: var(--pd-muted); font-size: var(--text-sm); }
.pd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--pd-border); flex-wrap: wrap; }
.pd-h2 { margin: 0; font-size: var(--text-lg); font-weight: 700; color: var(--pd-ink); }
.pd-sub { margin: 2px 0 0; font-size: var(--text-xs); color: var(--pd-muted); }

/* Empty State */
.pd-empty { text-align: center; padding: 22px 18px; color: var(--pd-muted); }
.pd-empty-ic { font-size: var(--text-2xl); opacity: .72; }
.pd-empty-t { font-size: var(--text-base); font-weight: 600; color: var(--pd-ink); margin: 6px 0 3px; }
.pd-empty-s { font-size: var(--text-xs); max-width: 440px; margin: 0 auto 10px; line-height: 1.45; }

/* Liste */
.pd-list { display: flex; flex-direction: column; gap: 8px; }
.pd-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--pd-border);
  border-radius: var(--pd-r); background: var(--color-surface); cursor: pointer; transition: border-color .12s, background .12s; }
.pd-row:hover { border-color: var(--pd-green); background: var(--pd-tint); }
.pd-row-main { flex: 1 1 auto; min-width: 0; }
.pd-row-title { font-size: var(--text-md); font-weight: 600; color: var(--pd-ink); }
.pd-row-meta { font-size: var(--text-xxs); color: var(--pd-muted); margin-top: 2px; }
.pd-pdf-yes { color: var(--pd-green-deep); font-weight: 600; }
.pd-pdf-no { color: var(--pd-muted); }
.pd-row-act { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.pd-kebab { border: none; background: none; cursor: pointer; font-size: var(--text-lg); line-height: 1; color: var(--pd-muted);
  min-width: 32px; min-height: 32px; padding: 2px 7px; border-radius: var(--radius-sm); }
.pd-kebab:hover { background: var(--pd-sand); color: var(--pd-ink); }
.pd-kebab:focus-visible { outline: 2px solid var(--pd-green-deep); outline-offset: 1px; background: var(--pd-sand); color: var(--pd-ink); }

/* Status-Badges */
.pd-status { font-size: var(--text-xxs); font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); white-space: nowrap; flex: 0 0 auto; }
.pd-st-draft { background: var(--pd-sand); color: var(--pd-muted); }
.pd-st-prog { background: #2563EB14; color: #2563EB; }
.pd-st-pdf { background: var(--pd-tint); color: var(--pd-green-deep); }
.pd-st-final { background: #0E7C5A18; color: #0E7C5A; }
.pd-st-arch { background: #85857514; color: var(--pd-muted); }

/* Kontextmenü (Liste) */
.pd-ctx-menu { position: fixed; z-index: 1200; min-width: 200px; background: var(--color-surface); border: 1px solid var(--pd-border);
  border-radius: var(--pd-r); box-shadow: 0 12px 32px rgba(20,40,28,.18); padding: 5px; }
.pd-ctx-item { display: block; width: 100%; text-align: left; padding: 8px 11px; border: none; background: none;
  cursor: pointer; font-size: var(--text-sm); border-radius: var(--radius-sm); color: var(--pd-ink); }
.pd-ctx-item:hover { background: var(--pd-tint); }
.pd-ctx-danger { color: var(--vi-error, #C0392C); }
.pd-ctx-sep { height: 1px; background: var(--pd-border); margin: 4px 6px; }

/* Offene Doku — Kopf + Toolbar */
.pd-open-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--pd-border); flex-wrap: wrap; }
.pd-back { border: 1px solid var(--pd-border); background: var(--color-surface); border-radius: var(--radius-md); padding: 5px 11px; cursor: pointer;
  font-size: var(--text-sm); color: var(--pd-ink); flex: 0 0 auto; }
.pd-back:hover { background: var(--pd-sand); }
.pd-open-title-wrap { flex: 1 1 auto; min-width: 0; }
.pd-open-title { font-size: var(--text-base); font-weight: 700; color: var(--pd-ink); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pd-open-meta { font-size: var(--text-xs); color: var(--pd-muted); margin-top: 2px; }
.pd-open-act { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.pd-lock-banner { background: var(--pd-sand); border: 1px solid var(--pd-border); border-radius: var(--radius-md); padding: 8px 12px;
  font-size: var(--text-xs); color: var(--pd-muted); margin-bottom: 12px; }

/* PDF-Statuskarte (#2 Prozessstatus · #3 sichtbares PDF + Version) */
.pd-pdf-card { display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 12px;
  border: 1px solid var(--pd-border); border-radius: var(--pd-r); background: var(--vi-card-bg, #fff); }
.pd-pdf-ic { font-size: var(--text-xl); line-height: 1; flex: 0 0 auto; }
.pd-pdf-info { flex: 1 1 auto; min-width: 0; }
.pd-pdf-t { font-size: var(--text-sm); font-weight: 600; color: var(--pd-ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-pdf-sub { font-size: var(--text-xxs); color: var(--pd-muted); margin-top: 2px; line-height: 1.45; }
.pd-pdf-act { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.pd-pdf-ver { font-size: var(--text-xxs); font-weight: 700; background: var(--pd-tint); color: var(--pd-green-deep);
  border-radius: var(--radius-pill); padding: 1px 8px; }
.pd-pdf-ok { border-color: var(--pd-green); background: var(--pd-tint); }
.pd-pdf-busy { border-color: var(--pd-green); background: var(--pd-tint); }
.pd-pdf-none { background: var(--pd-sand); }
.pd-pdf-err { border-color: var(--vi-error, #C0392C); background: color-mix(in srgb, var(--vi-error, #C0392C) 8%, transparent); }
.pd-pdf-err .pd-pdf-t { color: var(--vi-error, #C0392C); }

/* Spinner (Ladezustand der PDF-Erzeugung) */
.pd-spinner { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--pd-border); border-top-color: var(--pd-green-deep); animation: pd-spin .8s linear infinite; }
@keyframes pd-spin { to { transform: rotate(360deg); } }

/* Versionshistorie (Modal) */
.pd-ver-modal { max-width: 520px; }
.pd-ver-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pd-ver-item { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--pd-border);
  border-radius: var(--radius-md); background: var(--vi-card-bg, #fff); }
.pd-ver-item.is-current { border-color: var(--pd-green); background: var(--pd-tint); }
.pd-ver-main { flex: 1 1 auto; min-width: 0; }
.pd-ver-no { font-size: var(--text-sm); font-weight: 600; color: var(--pd-ink); display: flex; align-items: center; gap: 7px; }
.pd-ver-cur { font-size: 10px; font-weight: 700; background: var(--pd-green-deep); color: var(--color-surface); border-radius: var(--radius-pill); padding: 1px 7px; }
.pd-ver-meta { font-size: var(--text-xxs); color: var(--pd-muted); margin-top: 2px; }

.pd-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.pd-modes { display: inline-flex; border: 1px solid var(--pd-border); border-radius: var(--radius-md); overflow: hidden; }
.pd-mode { border: none; background: var(--color-surface); padding: 6px 13px; cursor: pointer; font-size: var(--text-sm); color: var(--pd-muted); }
.pd-mode + .pd-mode { border-left: 1px solid var(--pd-border); }
.pd-mode.is-on { background: var(--pd-green-deep); color: var(--color-surface); }
.pd-mode:disabled { opacity: .5; cursor: default; }

/* Bulk-Leiste */
.pd-bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--pd-tint);
  border: 1px solid var(--pd-green); border-radius: var(--radius-md); padding: 7px 11px; margin-bottom: 10px; }
.pd-bulk-n { font-size: var(--text-xs); font-weight: 700; color: var(--pd-green-deep); }
.pd-bulk-ctl { height: 32px; font-size: var(--text-xs); max-width: 190px; }
.pd-bulk-chk { font-size: var(--text-xs); color: var(--pd-ink); display: inline-flex; align-items: center; gap: 5px; }
.pd-bulk-sep { width: 1px; align-self: stretch; background: color-mix(in srgb, var(--pd-green-deep) 25%, transparent); margin: 0 2px; }
.pd-bulk-del { border: 1px solid var(--vi-error, #C0392C); background: var(--color-surface); color: var(--vi-error, #C0392C); border-radius: var(--radius-sm); padding: 5px 11px; cursor: pointer; font-weight: 600; }
.pd-bulk-del:hover { background: var(--vi-error, #C0392C); color: var(--color-surface); }

/* „löschen"-Aktionen (Karte, Detail, Versionen) — dezent, bei Hover rot */
.pd-del-btn { color: var(--vi-error, #C0392C) !important; }
.pd-del-btn:hover { background: color-mix(in srgb, var(--vi-error, #C0392C) 12%, transparent) !important; border-color: var(--vi-error, #C0392C) !important; }
/* „PDF veraltet"-Hinweis in der Dokumentkarte */
.pd-pdf-card.is-stale { border-color: var(--color-warning-ink); background: color-mix(in srgb, var(--color-warning-ink) 7%, transparent); }
.pd-pdf-stale { margin-top: 5px; font-size: var(--text-xxs); font-weight: 600; color: var(--color-warning-ink); }
/* Versionen: Aktionen je Zeile + Fußleiste */
.pd-ver-act { display: flex; gap: 6px; flex: 0 0 auto; }
.pd-ver-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--pd-border); display: flex; justify-content: flex-end; }

/* PDF-Einstellungen / Deckblatt-Modal */
.pd-cover-modal { max-width: 640px; width: 96vw; }
.pd-cover-hint { font-size: var(--text-xs); color: var(--pd-muted); line-height: 1.45; margin: 0 0 12px; background: var(--pd-sand); border-radius: var(--radius-md); padding: 8px 11px; }
.pd-cover-sys { margin-top: 10px; font-size: var(--text-xs); color: var(--pd-ink); }
.pd-cover-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pd-cover-foot-r { display: flex; gap: 8px; flex-wrap: wrap; }

/* Fortschritt */
.pd-progress { margin-bottom: 10px; }
.pd-prog-bar { height: 7px; background: var(--pd-sand); border-radius: var(--radius-pill); overflow: hidden; }
.pd-prog-fill { height: 100%; background: var(--pd-green); transition: width .2s ease; }
.pd-prog-txt { font-size: var(--text-xxs); color: var(--pd-muted); margin-top: 4px; }

/* Dropzone + Raster */
.pd-dropzone { position: relative; border-radius: var(--pd-r); transition: background .12s, outline .12s; }
.pd-dropzone.pd-dz-over { outline: 2px dashed var(--pd-green); outline-offset: 4px; background: var(--pd-tint); }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.pd-grid-empty { text-align: center; padding: 24px 18px; color: var(--pd-muted); border: 1.5px dashed var(--pd-border); border-radius: var(--pd-r); }
.pd-tile { position: relative; border: 1px solid var(--pd-border); border-radius: var(--pd-r); background: var(--color-surface); overflow: hidden;
  transition: border-color .12s, box-shadow .12s; }
.pd-tile:hover { border-color: var(--pd-green); box-shadow: 0 4px 14px rgba(20,40,28,.08); }
.pd-tile.is-sel { border-color: var(--pd-green); box-shadow: 0 0 0 2px var(--pd-green) inset; }
.pd-tile.pd-dragging { opacity: .45; }
.pd-tile.pd-drop-into { border-color: var(--pd-green); box-shadow: 0 0 0 2px var(--pd-green); }
.pd-tile-imgwrap { position: relative; aspect-ratio: 4/3; background: #F3F4F2; cursor: pointer; }
.pd-tile-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-fig { position: absolute; left: 6px; top: 6px; background: rgba(14,90,46,.88); color: var(--color-surface); font-size: var(--text-xxs);
  font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill); }
.pd-task-flag { position: absolute; right: 6px; top: 6px; background: rgba(176,82,30,.92); color: var(--color-surface); font-size: 10px;
  font-weight: 700; padding: 1px 6px; border-radius: var(--radius-pill); }
.pd-measure-flag { position: absolute; right: 6px; bottom: 6px; background: var(--color-danger); color: var(--color-surface); font-weight: 800;
  width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--text-xs); }
.pd-tile-check { position: absolute; left: 7px; bottom: 7px; width: 17px; height: 17px; cursor: pointer; z-index: 2; }
/* Papierkorb auf der Kachel — dezent, bei Hover/Fokus deutlich (kein versehentliches Löschen) */
.pd-tile-del { position: absolute; right: 6px; bottom: 6px; z-index: 3; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius-sm); border: none; cursor: pointer; color: var(--color-surface); background: rgba(28,32,30,.55);
  opacity: 0; transition: opacity .12s, background .12s; }
.pd-tile:hover .pd-tile-del, .pd-tile-del:focus-visible { opacity: 1; }
.pd-tile-del:hover { background: var(--vi-error, #C0392C); }
/* wenn eine Maßnahme-Flagge unten rechts sitzt, Papierkorb nach links versetzen, damit beide sichtbar bleiben */
.pd-tile-edit .pd-measure-flag:not(.pd-hidden) ~ .pd-tile-del { right: 30px; }
@media (hover: none) { .pd-tile-del { opacity: .9; } }   /* Touch: dauerhaft sichtbar */
.pd-tile-body { padding: 7px 9px 9px; cursor: pointer; }
.pd-tile-cap { font-size: var(--text-xs); color: var(--pd-ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.pd-nocap { color: var(--pd-muted); font-style: italic; }
.pd-tile-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.pd-cat { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--pd-sand);
  color: var(--c, var(--pd-muted)); border: 1px solid color-mix(in srgb, var(--c, #ccc) 35%, transparent); }
.pd-loc { font-size: var(--text-xxs); color: var(--pd-muted); }

/* Raster im Bearbeiten-Modus: breitere Kacheln mit direkt beschriftbarem Inline-Formular.
   Auto-Save je Feld ohne Vollreload → für 90–150 Fotos ohne Detailansicht praxistauglich. */
.pd-grid-edit { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.pd-tile-edit { display: flex; flex-direction: column; }
.pd-tile-edit .pd-tile-imgwrap { aspect-ratio: 16 / 10; }
.pd-hidden { display: none !important; }
.pd-tile-form { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.pd-inp { width: 100%; box-sizing: border-box; border: 1px solid var(--pd-border); border-radius: var(--radius-sm); background: var(--color-surface);
  font-family: inherit; font-size: var(--text-xs); color: var(--pd-ink); padding: 5px 7px; }
.pd-inp:focus { outline: none; border-color: var(--pd-green); box-shadow: 0 0 0 2px var(--pd-tint); }
.pd-inp-cap { resize: vertical; min-height: 40px; line-height: 1.35; }
.pd-inp-cat { height: 30px; }
.pd-tile-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pd-tile-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 24px; margin-top: 1px; }
.pd-tile-chk { font-size: var(--text-xxs); color: var(--pd-muted); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.pd-tile-chk input { margin: 0; }
.pd-mini-btn { border: 1px solid var(--pd-border); background: var(--color-surface); border-radius: var(--radius-sm); font-size: var(--text-xxs); padding: 3px 7px;
  cursor: pointer; color: var(--pd-ink); white-space: nowrap; line-height: 1.4; }
.pd-mini-btn:hover:not(:disabled) { border-color: var(--pd-green); background: var(--pd-tint); }
.pd-mini-btn:disabled { opacity: .5; cursor: default; }
.pd-task-btn.is-done { color: var(--pd-green-deep); border-color: var(--pd-green); background: var(--pd-tint); font-weight: 600; }
.pd-save-dot { margin-left: auto; font-size: var(--text-xxs); white-space: nowrap; min-height: 13px; color: var(--pd-muted); }
.pd-save-dot.pd-dot-saved { color: var(--pd-green-deep); font-weight: 600; }
.pd-save-dot.pd-dot-error { color: var(--vi-error, #C0392C); font-weight: 600; }
.pd-bulk-sa { min-width: 180px; max-width: 210px; }
.pd-bulk-date { max-width: 160px; }

/* Aufnahmedatum je Foto — Raster-Bearbeiten (editierbar), Readonly-Raster, „Datum offen"-Zustand */
.pd-tile-daterow { display: flex; align-items: center; gap: 7px; }
.pd-tile-datelbl { font-size: var(--text-xxs); font-weight: 600; color: var(--pd-muted); white-space: nowrap; flex: 0 0 auto; }
.pd-inp-date { height: 30px; flex: 1 1 auto; min-width: 0; }
.pd-tile-daterow.pd-date-empty .pd-tile-datelbl { color: var(--color-warning-ink); }
.pd-tile-date { font-size: var(--text-xxs); font-weight: 600; color: var(--pd-green-deep); margin-bottom: 3px; }
.pd-tile-date.pd-date-empty { color: var(--color-warning-ink); font-style: italic; font-weight: 400; }

/* Externe Freigaben-Modal */
.pd-share-modal { max-width: 600px; width: 96vw; }
.pd-share-h4 { font-size: var(--text-sm); font-weight: 700; color: var(--pd-ink); margin: 0 0 8px; }
.pd-share-create { border: 1px solid var(--pd-border); border-radius: var(--radius-lg); padding: 13px 14px; margin-bottom: 16px; background: var(--vi-card-bg, #fff); }
.pd-share-opts { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 8px; }
.pd-share-hint { font-size: var(--text-xxs); color: var(--pd-muted); line-height: 1.5; margin: 9px 0 0; }
.pd-share-new { border: 1px solid var(--pd-green); background: var(--pd-tint); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 14px; }
.pd-share-new-t { font-size: var(--text-sm); font-weight: 600; color: var(--pd-green-deep); margin-bottom: 8px; }
.pd-share-url { display: flex; gap: 7px; align-items: center; }
.pd-share-url input { flex: 1 1 auto; font-size: var(--text-xs); font-family: ui-monospace, Menlo, monospace; }
.pd-share-new-meta { font-size: var(--text-xxs); color: var(--pd-muted); margin-top: 7px; }
/* Welches Dokument wird hier eigentlich freigegeben? Diese Zeile fehlte, und
   der Empfaenger sah spaeter fuer JEDES Dokument "Fotodokumentation". */
.pd-share-orig { display: flex; align-items: baseline; gap: 10px; padding: 9px 11px; margin-bottom: 12px;
  background: var(--gray-50, #F6F9F8); border: 1px solid var(--pd-border); border-radius: var(--radius-md); }
.pd-share-orig-l { flex: 0 0 auto; font-size: var(--text-xs, 12px); color: var(--gray-500, #5F6B66); }
.pd-share-orig-n { font-weight: var(--fw-semibold, 600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Was der EMPFAENGER sieht - direkt aenderbar, ohne das Original umzubenennen. */
.pd-share-extern { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pd-share-extern-l { flex: 0 0 auto; font-size: var(--text-xs, 12px); color: var(--gray-500, #5F6B66); }
.pd-share-extern-i { flex: 1 1 auto; min-width: 0; height: 30px; font-size: var(--text-sm, 13px); }
.pd-share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pd-share-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid var(--pd-border); border-radius: var(--radius-md); background: var(--vi-card-bg, #fff); }
.pd-share-item.pd-share-revoked, .pd-share-item.pd-share-expired { opacity: .68; }
.pd-share-main { flex: 1 1 auto; min-width: 0; font-size: var(--text-sm); color: var(--pd-ink); }
.pd-share-meta { font-size: var(--text-xxs); color: var(--pd-muted); margin-top: 3px; }
.pd-share-badge { font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); }
.pd-share-badge-active { background: var(--pd-tint); color: var(--pd-green-deep); }
.pd-share-badge-expired { background: var(--pd-sand); color: var(--pd-muted); }
.pd-share-badge-revoked { background: color-mix(in srgb, var(--vi-error, #C0392C) 14%, transparent); color: var(--vi-error, #C0392C); }

/* Detail */
.pd-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); gap: 18px; align-items: start; }
@media (max-width: 920px) { .pd-detail { grid-template-columns: 1fr; } }
.pd-detail-img { position: sticky; top: 8px; }
.pd-detail-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pd-detail-fig { font-size: var(--text-sm); font-weight: 700; color: var(--pd-green-deep); }
.pd-navbtn { border: 1px solid var(--pd-border); background: var(--color-surface); width: 34px; height: 30px; border-radius: var(--radius-md); cursor: pointer; font-size: var(--text-lg); color: var(--pd-ink); }
.pd-navbtn:disabled { opacity: .4; cursor: default; }
.pd-detail-photo { width: 100%; max-height: 460px; object-fit: contain; background: #F3F4F2; border: 1px solid var(--pd-border); border-radius: var(--pd-r); display: block; }
.pd-detail-form { display: flex; flex-direction: column; gap: 11px; }
.pd-detail-copy { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--text-xxs); color: var(--pd-muted);
  background: var(--pd-sand); padding: 6px 9px; border-radius: var(--radius-md); }
.pd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (max-width: 560px) { .pd-form-row { grid-template-columns: 1fr; } }
.pd-detail-flags { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pd-chk { font-size: var(--text-sm); color: var(--pd-ink); display: inline-flex; align-items: center; gap: 6px; }
.pd-task-done { font-size: var(--text-xs); color: var(--pd-green-deep); font-weight: 600; }
.pd-detail-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px;
  padding-top: 11px; border-top: 1px solid var(--pd-border); }
.pd-detail-foot-r { display: flex; gap: 8px; }
.pd-opt { font-weight: 400; color: var(--pd-muted); font-size: var(--text-xxs); }
.btn-xs { font-size: var(--text-xxs); padding: 3px 8px; }

/* Grobe Zeiger: größere Bedienflächen, ohne Maus-/Desktopdichte aufzublähen. */
@media (pointer: coarse) {
  .pd-more-item { min-height: 44px; }
  .pd-kebab, .pd-navbtn, .pd-tile-del { min-width: 40px; min-height: 40px; }
  .pd-tile-check { width: 24px; height: 24px; }
}

/* Anlegen-/Modal */
.pd-modal-overlay { position: fixed; inset: 0; background: rgba(20,30,24,.42); z-index: 1100; display: none;
  align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow: auto; }
.pd-modal { width: 100%; max-width: 560px; background: var(--color-surface); border-radius: var(--radius-xl); box-shadow: 0 24px 64px rgba(0,0,0,.28); overflow: hidden; }
.pd-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--pd-border); }
.pd-modal-head h3 { margin: 0; font-size: var(--text-base); font-weight: 700; color: var(--pd-ink); }
.pd-modal-x { border: none; background: none; font-size: var(--text-xl); line-height: 1; cursor: pointer; color: var(--pd-muted); }
.pd-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.pd-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--pd-border); background: var(--pd-sand); }
.pd-prefill-hint { font-size: var(--text-xxs); color: var(--pd-muted); background: var(--pd-tint); border-radius: var(--radius-md); padding: 7px 10px; }

/* ── Modulübergreifende Übersicht (Tools → Fotodokumentationen) — kompakte Tabelle ── */
.pdov-table { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr) minmax(0, 1.5fr) 72px 130px 120px; border: 1px solid var(--vi-border, #E7E3DA); border-radius: var(--radius-md); overflow: hidden; background: var(--vi-surface, #fff); }
.pdov-thead { display: contents; }
.pdov-thead > div { padding: 10px 12px; font-weight: 600; font-size: var(--text-xs); color: var(--vi-text-muted, #6b7280); background: var(--vi-surface-2, #faf9f6); border-bottom: 1px solid var(--vi-border, #E7E3DA); }
.pdov-row { display: contents; cursor: pointer; }
.pdov-row > div { padding: 11px 12px; border-bottom: 1px solid var(--vi-border, #E7E3DA); min-width: 0; display: flex; align-items: center; gap: 6px; }
.pdov-row:hover > div { background: var(--vi-hover, #F6F8F7); }
.pdov-c-num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.pdov-title { font-weight: 600; overflow-wrap: anywhere; white-space: normal; }
.pdov-case { flex-wrap: wrap; }
.pdov-case-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.pdov-case-title, .pdov-obj, .pdov-muted { color: var(--vi-text-muted, #6b7280); font-size: var(--text-xs); overflow-wrap: anywhere; white-space: normal; }
@media (max-width: 900px) {
  .pdov-table { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) 56px 110px; }
  .pdov-thead > div:nth-child(3), .pdov-row > div:nth-child(3),
  .pdov-thead > div:nth-child(6), .pdov-row > div:nth-child(6) { display: none; }
}
