/*
 * NhPanel – Dokumente (Dokumentenliste + Vorschau-Dialog). Nur unter .nh-shell-page (Konto-Shell) wirksam.
 */

/* Lange Dateinamen ohne Leerzeichen (z. B. "Vertrag_Name_signiert.pdf") dürfen umbrechen – kein seitliches Scrollen */
.nh-shell-page .nh-shell-content .table td .nh-doc-name { overflow-wrap: anywhere; }

/* Schmale Zeilen-Karten: Dokumentname als Kartentitel (Titel und Dateiname untereinander, ohne Spaltenbeschriftung);
   Aktionen mit voller Touch-Höhe, beide Knöpfe teilen sich die Zeile */
@container nhtable (max-width: 680px) {
    .nh-shell-page .nh-stackable tbody td.nh-doc-cell { display: block; text-align: left; padding-bottom: 6px !important; }
    .nh-shell-page .nh-stackable tbody td.nh-doc-cell::before { display: none; }

    .nh-shell-page .nh-shell-content .table td.nh-doc-actions .btn,
    .nh-shell-page .nh-shell-content .table td.nh-doc-actions .btn + .btn {
        display: inline-flex;
        flex: 1 1 9rem;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        margin: 0;
    }
}

/* ---------- Vorschau-Dialog ---------- */

.nh-shell-page .nh-doc-preview .modal-header { gap: 12px; }
/* Schließen-Knopf mit 44 px Trefferfläche (Symbolgröße unverändert) */
.nh-shell-page .nh-doc-preview .btn-close { width: 1.5rem; height: 1.5rem; padding: .625rem; flex: 0 0 auto; }
.nh-shell-page .nh-doc-preview .modal-title {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.nh-shell-page .nh-doc-preview-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 0;
    background: var(--nh-surface-2, #f7f8fd);
}

.nh-shell-page .nh-doc-preview-status {
    position: absolute;
    inset: 50% 16px auto;
    margin: 0;
    transform: translateY(-50%);
    color: var(--nh-muted, #5b6b82);
    text-align: center;
}
.nh-shell-page .nh-doc-preview-status[hidden] { display: none; }

.nh-shell-page .nh-doc-preview-frame {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: min(75vh, 1000px);
    border: 0;
}

.nh-shell-page .nh-doc-preview-img {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 100%;
    max-height: min(75vh, 1000px);
    width: auto;
    height: auto;
    margin: auto;
    padding: 16px;
    object-fit: contain;
}

.nh-shell-page .nh-doc-preview-footer { gap: 8px; }
.nh-shell-page .nh-doc-preview-footer > * { margin: 0; }
.nh-shell-page .nh-doc-preview-footer .btn[hidden] { display: none; }

/* Mobil (Vollbild-Dialog, nur Bilder): Inhalt füllt den Platz, Knöpfe volle Breite mit Touch-Höhe */
@media (max-width: 767.98px) {
    .nh-shell-page .nh-doc-preview-body { min-height: 0; }
    .nh-shell-page .nh-doc-preview-img { max-height: 100%; }
    .nh-shell-page .nh-doc-preview-footer .btn {
        display: inline-flex;
        flex: 1 1 100%;
        align-items: center;
        justify-content: center;
        min-height: 44px;
    }
}
