/* NETSTYLE_PORTAL_DESIGN_CORE_R1_20260917 */
/* Auto-consolidated from the four previously loaded portal hardening layers. */

/* ============================================================ */
/* VISUAL HARDENING (legacy source, consolidated) */
/* ============================================================ */
/* ============================================================
   NETSTYLE PORTAL – VISUAL HARDENING R1
   Loaded after technikportal.css.  This file deliberately fixes
   layout contracts globally instead of adding page-specific hacks.
   ============================================================ */

/* Every common portal container must be allowed to shrink inside grids/flex. */
.content,
.page-heading,
.page-heading > *,
.panel,
.panel-header,
.panel-header > *,
.table-wrapper,
.enterprise-list-toolbar,
.enterprise-list-toolbar > *,
.structured-form,
.structured-form fieldset,
.portal-form-grid,
.structured-form-grid,
.form-field,
.customer-autocomplete,
.search-hero-form,
.search-result-card,
.asset-detail-grid,
.customer-overview-grid,
.customer-overview-grid-large {
    min-width: 0;
}

/* ---------- Page headings / top actions ---------- */
.page-heading {
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.page-heading > :first-child {
    flex: 1 1 320px;
    min-width: 0;
}

.page-heading h1,
.page-heading p,
.panel-header h2,
.panel-header p {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.enterprise-list-heading-actions,
.page-heading .dashboard-page-heading-actions,
.list-header-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: auto !important;
}

.enterprise-list-heading-actions > *,
.list-header-actions > * {
    margin: 0 !important;
}

.page-heading .primary-button,
.page-heading .secondary-button,
.enterprise-list-heading-actions .primary-button,
.enterprise-list-heading-actions .secondary-button,
.list-header-actions .primary-button,
.list-header-actions .secondary-button {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 40px !important;
    padding: 9px 14px !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: normal !important;
}

/* ---------- Panel headings ---------- */
.panel-header {
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.panel-header > :first-child {
    flex: 1 1 260px;
    min-width: 0;
}

.panel-header > a,
.panel-header > button,
.panel-header > form {
    flex: 0 0 auto;
    max-width: 100%;
}

/* ---------- Tables: never let cell text paint over neighbouring columns ---------- */
.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.workorder-table {
    width: 100%;
    max-width: 100%;
    table-layout: auto;
}

.workorder-table th,
.workorder-table td {
    vertical-align: middle;
    max-width: 100%;
}

.workorder-table th {
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.workorder-table td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.4;
}

.workorder-table td strong,
.workorder-table td small,
.workorder-table td a:not(.primary-button):not(.secondary-button) {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.table-sort {
    max-width: 100%;
    white-space: normal !important;
    line-height: 1.25;
    text-align: left;
}

/* Action cells stay compact, but buttons size to their actual label. */
.enterprise-actions-table thead th:last-child,
.enterprise-actions-table tbody td:last-child,
.enterprise-actions-table.action-count-1 thead th:last-child,
.enterprise-actions-table.action-count-1 tbody td:last-child,
.enterprise-actions-table.action-count-2 thead th:last-child,
.enterprise-actions-table.action-count-2 tbody td:last-child,
.enterprise-actions-table.action-count-3 thead th:last-child,
.enterprise-actions-table.action-count-3 tbody td:last-child {
    width: 1% !important;
    min-width: 104px !important;
    max-width: none !important;
    white-space: normal !important;
}

.enterprise-row-actions,
.knowledge-row-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.enterprise-row-actions form,
.knowledge-row-actions form,
.enterprise-actions-table tbody td:last-child > form {
    display: inline-flex !important;
    margin: 0 !important;
}

.enterprise-row-button,
.knowledge-action-button,
.table-action-button,
.enterprise-actions-table tbody td:last-child > a,
.enterprise-actions-table tbody td:last-child > button,
.enterprise-actions-table tbody td:last-child > form > button,
.workorder-list-table .workorder-open-button {
    width: auto !important;
    min-width: 88px !important;
    max-width: none !important;
    height: auto !important;
    min-height: 32px !important;
    padding: 7px 11px !important;
    box-sizing: border-box !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    text-align: center !important;
}

/* ---------- List/filter toolbars ---------- */
.enterprise-list-toolbar {
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

.enterprise-list-toolbar > .portal-input,
.enterprise-list-toolbar > select,
.enterprise-list-toolbar > .customer-autocomplete,
.enterprise-list-toolbar > .enterprise-list-search {
    flex: 1 1 180px !important;
    min-width: min(180px, 100%) !important;
    max-width: 100% !important;
}

.enterprise-list-toolbar--wrap {
    grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)) !important;
    align-items: stretch !important;
}

.enterprise-list-toolbar input,
.enterprise-list-toolbar select,
.enterprise-list-toolbar .portal-input,
.enterprise-list-toolbar .customer-autocomplete {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.enterprise-list-toolbar--wrap > .primary-button,
.enterprise-list-toolbar--wrap > .secondary-button,
.enterprise-list-toolbar > .enterprise-filter-button,
.enterprise-list-toolbar > .enterprise-reset-button,
.enterprise-list-toolbar > .knowledge-filter-button,
.enterprise-list-toolbar > .knowledge-reset-button,
.enterprise-list-toolbar > .workorder-filter-reset {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

.toolbar-checkbox {
    min-height: 40px;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

/* ---------- Forms ---------- */
.structured-form fieldset {
    box-sizing: border-box;
    max-width: 100%;
}

.portal-form-grid,
.structured-form-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.form-field,
.portal-field {
    min-width: 0;
    max-width: 100%;
}

.form-field label,
.portal-field label,
.structured-form legend,
.helptext,
.fieldset-help,
.field-error,
.form-error-summary {
    max-width: 100%;
    overflow-wrap: anywhere;
}

.structured-form input:not([type="checkbox"]):not([type="radio"]),
.structured-form select,
.structured-form textarea,
.portal-form input:not([type="checkbox"]):not([type="radio"]),
.portal-form select,
.portal-form textarea,
.portal-input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.structured-form textarea,
.portal-form textarea {
    min-height: 100px;
    resize: vertical;
}

.structured-form input[type="checkbox"],
.structured-form input[type="radio"],
.portal-form input[type="checkbox"],
.portal-form input[type="radio"] {
    width: auto !important;
    min-width: 0 !important;
}

.sticky-form-actions,
.form-actions-full {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.sticky-form-actions .primary-button,
.sticky-form-actions .secondary-button,
.form-actions-full .primary-button,
.form-actions-full .secondary-button {
    width: auto !important;
    min-width: 110px !important;
    max-width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 15px !important;
    white-space: nowrap !important;
}

/* Detail values and cards must wrap instead of overlapping. */
.asset-detail-grid > div,
.customer-masterdata-grid > div,
.summary-card,
.runtime-credential-card {
    min-width: 0;
}

.asset-detail-grid > div strong,
.customer-masterdata-grid > div strong,
.summary-card strong,
.runtime-credential-meta > * {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* ---------- Search ---------- */
.global-search {
    width: min(680px, 58vw);
    max-width: 100%;
    min-width: 180px;
}

.global-search input {
    min-width: 0;
}

.search-hero-form > * {
    min-width: 0;
}

.search-hero-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-summary {
    flex-wrap: wrap;
}

.search-result-card .compact-list > a,
.search-result-card .compact-list strong,
.search-result-card .compact-list span {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* ---------- Tabs / badges ---------- */
.customer-tabs,
.portal-section-tabs {
    max-width: 100%;
}

.customer-tabs a,
.portal-section-tabs a,
.audit-kpi-card span,
.audit-kpi-card strong,
.mini-badge,
.status-badge {
    max-width: 100%;
}

/* ---------- Responsive hardening ---------- */
@media (max-width: 1100px) {
    .portal-form-grid,
    .structured-form-grid {
        grid-template-columns: 1fr;
    }

    .form-field-full {
        grid-column: auto;
    }

    .global-search {
        width: min(560px, 52vw);
    }
}

@media (max-width: 900px) {
    .search-hero-form {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
    }

    .search-hero-icon {
        flex: 0 0 40px;
    }

    .search-hero-input {
        flex: 1 1 calc(100% - 56px);
    }

    .search-hero-form > .primary-button,
    .search-hero-form > .secondary-button {
        flex: 1 1 150px;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }
}

@media (max-width: 760px) {
    .content {
        padding: 20px;
    }

    .topbar {
        padding-left: 18px;
        padding-right: 18px;
        gap: 10px;
    }

    .global-search {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }

    .global-search .shortcut {
        display: none;
    }

    .user-data {
        display: none;
    }

    .enterprise-list-heading-actions,
    .list-header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        margin-left: 0 !important;
    }

    .enterprise-list-heading-actions .primary-button,
    .enterprise-list-heading-actions .secondary-button,
    .list-header-actions .primary-button,
    .list-header-actions .secondary-button {
        flex: 1 1 150px;
    }

    .panel-header > a,
    .panel-header > button,
    .panel-header > form {
        max-width: 100%;
    }

    .enterprise-list-toolbar--wrap {
        grid-template-columns: 1fr !important;
    }

    .enterprise-list-toolbar--wrap > .primary-button,
    .enterprise-list-toolbar--wrap > .secondary-button {
        width: 100% !important;
    }

    .sticky-form-actions .primary-button,
    .sticky-form-actions .secondary-button,
    .form-actions-full .primary-button,
    .form-actions-full .secondary-button {
        flex: 1 1 140px;
    }
}

@media (max-width: 520px) {
    .content {
        padding: 16px 12px;
    }

    .page-heading h1 {
        font-size: 23px;
    }

    .enterprise-list-heading-actions .primary-button,
    .enterprise-list-heading-actions .secondary-button,
    .sticky-form-actions .primary-button,
    .sticky-form-actions .secondary-button,
    .form-actions-full .primary-button,
    .form-actions-full .secondary-button {
        flex-basis: 100%;
        width: 100% !important;
    }

    .search-hero-icon {
        display: none;
    }

    .search-hero-input,
    .search-hero-form > .primary-button,
    .search-hero-form > .secondary-button {
        flex: 1 1 100%;
        width: 100% !important;
    }
}


/* ============================================================
   NETSTYLE PORTAL – VISUAL / UX HARDENING R2
   Precise corrections derived from live portal review.
   ============================================================ */

/* Toolbars: search/filter and reset belong in one row on desktop. */
.enterprise-list-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
}
.enterprise-list-toolbar > .enterprise-list-search {
    flex: 1 1 360px !important;
    min-width: 260px !important;
}
.enterprise-list-toolbar > .portal-input,
.enterprise-list-toolbar > select,
.enterprise-list-toolbar > .customer-autocomplete {
    flex: 1 1 170px !important;
    min-width: 150px !important;
}
.enterprise-list-toolbar > .primary-button,
.enterprise-list-toolbar > .secondary-button,
.enterprise-list-toolbar > .enterprise-filter-button,
.enterprise-list-toolbar > .enterprise-reset-button,
.enterprise-list-toolbar > .knowledge-filter-button,
.enterprise-list-toolbar > .knowledge-reset-button,
.enterprise-list-toolbar > .workorder-filter-reset,
.enterprise-list-toolbar--wrap > .primary-button,
.enterprise-list-toolbar--wrap > .secondary-button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 112px !important;
    max-width: none !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 14px !important;
    justify-content: center !important;
    white-space: nowrap !important;
}
.enterprise-list-toolbar--wrap {
    grid-template-columns: minmax(220px,1.35fr) minmax(190px,1fr) repeat(3,minmax(145px,.85fr)) auto auto !important;
    align-items: center !important;
}

/* Table actions: two regular actions stay beside each other. */
.enterprise-row-actions,
.customer-overview-table .enterprise-row-actions,
.knowledge-row-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
}
.enterprise-actions-table.action-count-2 thead th:last-child,
.enterprise-actions-table.action-count-2 tbody td:last-child,
.customer-overview-table thead th:last-child,
.customer-overview-table tbody td:last-child,
.customer-action-column {
    width: 190px !important;
    min-width: 190px !important;
}
.enterprise-row-button,
.customer-action-button,
.enterprise-actions-table tbody td:last-child > a,
.enterprise-actions-table tbody td:last-child > form > button {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 82px !important;
    max-width: none !important;
    white-space: nowrap !important;
}

/* Inventory navigation must look like portal tabs, never raw purple links. */
.section-tabs.inventar-tabs,
.portal-section-tabs.inventar-tabs {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
    margin: -4px 0 16px !important;
    padding: 4px !important;
    background: #eef3f9 !important;
    border: 1px solid #dce5ef !important;
    border-radius: 11px !important;
}
.section-tabs.inventar-tabs a,
.portal-section-tabs.inventar-tabs a {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    border-radius: 7px !important;
    text-decoration: none !important;
    color: #18314f !important;
    font-weight: 700 !important;
}
.section-tabs.inventar-tabs a:hover,
.portal-section-tabs.inventar-tabs a:hover { background:#f8fbff !important; }
.section-tabs.inventar-tabs a.is-active,
.portal-section-tabs.inventar-tabs a.is-active {
    background:#1769d2 !important;
    color:#fff !important;
}

/* Search results are read top-to-bottom, not in two competing columns. */
.search-result-grid--cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}
.search-result-card { min-height: 0 !important; }
.search-result-card .compact-list { min-height: 0 !important; }
.search-result-card .empty-state { padding: 18px 10px !important; }

/* Credential forms: clearer grouping and status controls. */
.credential-slot-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 18px; }
.credential-slot-form-grid .form-field-full { grid-column:1/-1; }
.credential-empty-hint {
    margin-top:6px; padding:8px 10px; border-radius:8px;
    background:#f6f9fc; color:#6e8097; font-size:.78rem; line-height:1.4;
}
.advanced-vault-details { margin-top:16px !important; }
.advanced-vault-details > summary { padding:2px 0 !important; }
.advanced-vault-details[open] > summary { margin-bottom:10px !important; }

/* Generic protection for recurring-plan detail cards and preview grids. */
[class*="pruefplan"] [class*="preview"] { min-width:0; }
[class*="pruefplan"] [class*="preview"] > * { min-width:0; overflow-wrap:anywhere; }
[class*="pruefplan"] [class*="preview"][style*="grid"] { align-items:stretch; }

@media (max-width: 1280px) {
    .enterprise-list-toolbar--wrap {
        grid-template-columns: repeat(3,minmax(180px,1fr)) !important;
    }
}
@media (max-width: 900px) {
    .enterprise-list-toolbar--wrap { grid-template-columns:1fr 1fr !important; }
    .credential-slot-form-grid { grid-template-columns:1fr; }
    .credential-slot-form-grid .form-field-full { grid-column:auto; }
}
@media (max-width: 700px) {
    .enterprise-list-toolbar,
    .enterprise-list-toolbar--wrap { display:flex !important; flex-direction:column !important; align-items:stretch !important; }
    .enterprise-list-toolbar > *,
    .enterprise-list-toolbar--wrap > * { width:100% !important; min-width:0 !important; max-width:none !important; }
    .enterprise-row-actions,
    .customer-overview-table .enterprise-row-actions { flex-wrap:wrap !important; justify-content:flex-start !important; }
    .enterprise-actions-table.action-count-2 thead th:last-child,
    .enterprise-actions-table.action-count-2 tbody td:last-child,
    .customer-overview-table thead th:last-child,
    .customer-overview-table tbody td:last-child,
    .customer-action-column { min-width:120px !important; width:auto !important; }
}

/* ============================================================ */
/* CORE / CALENDAR / BUILDER (legacy source, consolidated) */
/* ============================================================ */
/* Netstyle Portal Core / Calendar / Builder Completion */
.portal-subnav,.customer-tabs{display:flex;align-items:stretch;gap:6px;flex-wrap:wrap;padding:4px;background:#eef4fb;border:1px solid #d6e0ec;border-radius:10px;margin-bottom:16px}.portal-subnav a,.customer-tabs>a{display:flex;align-items:center;gap:6px;min-height:40px;padding:0 14px;border-radius:8px;text-decoration:none;color:#0b1f38;font-weight:700;white-space:nowrap}.portal-subnav a.is-active,.customer-tabs>a.is-active{background:#1772e8;color:#fff}.customer-tabs>a span{display:inline-flex;min-width:20px;height:20px;align-items:center;justify-content:center;border-radius:999px;background:#e6edf7;font-size:12px}.customer-tabs>a.is-active span{background:rgba(255,255,255,.22);color:#fff}
.customer-overview-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(190px,1fr))!important;gap:10px!important}.customer-overview-grid>a{min-width:0!important;height:100%;padding:16px!important;border:1px solid #dbe4ef!important;border-radius:8px!important;text-decoration:none!important}.customer-overview-panels{align-items:stretch}.customer-overview-panels>.panel{height:100%}.customer-masterdata-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}.customer-masterdata-grid>div{min-width:0}.break-safe,.break-safe *{overflow-wrap:anywhere;word-break:break-word}
.compact-action,.enterprise-row-button{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:88px!important;white-space:nowrap}.enterprise-row-actions{display:flex!important;flex-wrap:nowrap!important;gap:6px!important;align-items:center!important;justify-content:flex-end!important}.customer-action-column{min-width:190px!important}
.dashboard-kpi-link{text-decoration:none!important;color:inherit!important;cursor:pointer;transition:.15s ease}.dashboard-kpi-link:hover{transform:translateY(-1px);border-color:#7aaef4;box-shadow:0 6px 16px rgba(23,114,232,.10)}
.structured-form-grid,.portal-form-grid{min-width:0}.form-field{min-width:0}.form-field>input,.form-field>select,.form-field>textarea{max-width:100%;box-sizing:border-box}.checkbox-field label{display:flex;align-items:center;gap:9px}.weekday-checks ul{display:flex;gap:10px;flex-wrap:wrap;list-style:none;padding:0;margin:8px 0}.weekday-checks label{display:flex;gap:6px;align-items:center;background:#f6f9fd;border:1px solid #d9e3ef;border-radius:8px;padding:8px 11px}
.portal-dropzone{display:flex;min-height:150px;border:2px dashed #a9bfd9;background:#f8fbff;border-radius:12px;align-items:center;justify-content:center;flex-direction:column;gap:6px;cursor:pointer;padding:20px;text-align:center}.portal-dropzone:hover,.portal-dropzone.is-dragover{border-color:#1772e8;background:#eef6ff}.portal-dropzone input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.portal-dropzone-icon{font-size:30px;color:#1772e8}.portal-dropzone-file{margin-top:7px;color:#536780;font-size:13px}
.calendar-custom-list>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #e2e8f0}.organisation-subnav{margin-top:-4px}.calendar-toolbar .enterprise-list-toolbar{grid-template-columns:minmax(130px,220px) auto!important;justify-content:start}
@media(max-width:1100px){.customer-masterdata-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.customer-tabs{overflow-x:auto;flex-wrap:nowrap}.customer-overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:720px){.customer-masterdata-grid,.customer-overview-grid{grid-template-columns:1fr!important}.enterprise-row-actions{flex-wrap:wrap!important}.customer-action-column{min-width:120px!important}.portal-subnav{overflow-x:auto;flex-wrap:nowrap}.structured-form-grid{grid-template-columns:1fr!important}}
/* ============================================================
   netstyle Secure – password workflow
   ============================================================ */
.credential-password-control,.credential-secret-row{display:flex;align-items:center;gap:10px;min-width:0}.credential-password-control .portal-input,.credential-secret-row .portal-input{flex:1 1 auto;min-width:0}.credential-password-generate{flex:0 0 auto}.credential-secret-warning{margin:0 0 16px}.credential-secret-panel{margin-top:18px;padding:16px;border:1px solid #d7e0eb;border-radius:10px;background:#f8fbff}.credential-secret-panel>strong{display:block;margin-bottom:10px}.credential-secret-row{margin-bottom:8px}@media(max-width:650px){.credential-password-control,.credential-secret-row{align-items:stretch;flex-direction:column}.credential-password-control .secondary-button,.credential-secret-row .secondary-button{width:100%}}

/* ============================================================ */
/* FORM HARDENING (legacy source, consolidated) */
/* ============================================================ */
/* ============================================================
   NETSTYLE PORTAL – FORM LAYOUT HARDENING R1
   Loaded after all previous portal styles.
   Goal: one deterministic form contract for every structured form.
   ============================================================ */

.portal-form.structured-form {
    --ns-form-border: #d7e0eb;
    --ns-form-soft: #f8fbff;
    --ns-form-text: #0b1f38;
    --ns-form-muted: #65778e;
    --ns-form-gap-y: 18px;
    --ns-form-gap-x: 20px;
    display: block !important;
    min-width: 0 !important;
}

/* Give forms breathing room inside generic panels. */
.panel > .portal-form.structured-form {
    padding: 14px 16px 16px !important;
    box-sizing: border-box !important;
}

/* ----- Fieldsets / legends: no text may sit in the border line ----- */
.portal-form.structured-form > fieldset {
    display: block !important;
    position: relative !important;
    min-inline-size: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 20px !important;
    padding: 20px 16px 16px !important;
    border: 1px solid var(--ns-form-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.portal-form.structured-form > fieldset + fieldset {
    margin-top: 18px !important;
}

.portal-form.structured-form > fieldset > legend {
    float: none !important;
    display: block !important;
    width: auto !important;
    max-width: calc(100% - 16px) !important;
    margin: 0 0 14px 0 !important;
    padding: 0 8px !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    background: #fff !important;
    color: var(--ns-form-text) !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* Ensure first content after a legend never touches the legend/border. */
.portal-form.structured-form > fieldset > legend + * {
    margin-top: 4px !important;
}

/* ----- Grid contract ----- */
.portal-form.structured-form .structured-form-grid,
.portal-form.structured-form .portal-form-grid,
.portal-form.structured-form .credential-slot-form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: var(--ns-form-gap-x) !important;
    row-gap: var(--ns-form-gap-y) !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.portal-form.structured-form .form-field,
.portal-form.structured-form .portal-field {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    position: static !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.portal-form.structured-form .form-field-full {
    grid-column: 1 / -1 !important;
}

/* Direct fields outside a grid, e.g. Kunde + Zugangsdaten-Typ. */
.portal-form.structured-form > fieldset > .form-field {
    margin-top: 14px !important;
}

/* ----- Labels / help / errors: reset any inherited positioning ----- */
.portal-form.structured-form .form-field > label,
.portal-form.structured-form .portal-field > label,
.portal-form.structured-form .field-label {
    display: block !important;
    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--ns-form-text) !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

.portal-form.structured-form .field-label {
    margin-bottom: 8px !important;
}

.portal-form.structured-form small,
.portal-form.structured-form .helptext,
.portal-form.structured-form .fieldset-help {
    display: block !important;
    position: static !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: var(--ns-form-muted) !important;
    line-height: 1.45 !important;
    overflow-wrap: anywhere !important;
}

.portal-form.structured-form .fieldset-help {
    margin: 0 0 14px !important;
}

.portal-form.structured-form .field-error,
.portal-form.structured-form .errorlist {
    position: static !important;
    max-width: 100% !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    overflow-wrap: anywhere !important;
}

/* ----- Controls ----- */
.portal-form.structured-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.portal-form.structured-form select,
.portal-form.structured-form textarea,
.portal-form.structured-form .portal-input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 40px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.portal-form.structured-form textarea {
    min-height: 110px !important;
    resize: vertical !important;
}

.portal-form.structured-form input[type="checkbox"],
.portal-form.structured-form input[type="radio"] {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
}

/* ----- Radio-card scope selection ----- */
.portal-form.structured-form .credential-scope-options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 16px !important;
}

.portal-form.structured-form .credential-scope-card {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 1px solid var(--ns-form-border) !important;
    border-radius: 9px !important;
    background: var(--ns-form-soft) !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

.portal-form.structured-form .credential-scope-card:has(input:checked) {
    border-color: #1772e8 !important;
    background: #edf5ff !important;
    box-shadow: 0 0 0 1px #1772e8 inset !important;
}

.portal-form.structured-form .credential-scope-card span {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
}

/* ----- Customer autocomplete must remain in document flow ----- */
.portal-form.structured-form .customer-autocomplete {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.portal-form.structured-form .customer-autocomplete-list {
    z-index: 50 !important;
}

/* ----- Checkbox rows ----- */
.portal-form.structured-form .checkbox-field {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding-top: 2px !important;
}

.portal-form.structured-form .checkbox-field > label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 9px !important;
    min-height: 40px !important;
    width: 100% !important;
}

/* ----- Advanced vault section ----- */
.portal-form.structured-form .advanced-vault-details {
    margin: 4px 0 20px !important;
    border: 1px solid var(--ns-form-border) !important;
    border-radius: 10px !important;
    background: #f8fbff !important;
    overflow: hidden !important;
}

.portal-form.structured-form .advanced-vault-details > summary {
    display: block !important;
    padding: 12px 14px !important;
    margin: 0 !important;
    color: var(--ns-form-text) !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

.portal-form.structured-form .advanced-vault-details[open] > summary {
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--ns-form-border) !important;
}

.portal-form.structured-form .advanced-vault-details > .audit-note,
.portal-form.structured-form .advanced-vault-details > .structured-form-grid {
    margin-left: 14px !important;
    margin-right: 14px !important;
}

.portal-form.structured-form .advanced-vault-details > .audit-note {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
}

.portal-form.structured-form .advanced-vault-details > .structured-form-grid {
    width: auto !important;
    margin-bottom: 14px !important;
}

/* ----- Action bar never covers fields ----- */
.portal-form.structured-form > .form-actions,
.portal-form.structured-form > .sticky-form-actions {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    z-index: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 4px 0 0 !important;
    padding: 16px 0 0 !important;
    border-top: 1px solid #e2e8f0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

.portal-form.structured-form > .form-actions .primary-button,
.portal-form.structured-form > .form-actions .secondary-button {
    width: auto !important;
    min-width: 110px !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* ----- Upload/dropzone fits the same field rhythm ----- */
.portal-form.structured-form .portal-dropzone {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* ----- Responsive ----- */
@media (max-width: 1100px) {
    .portal-form.structured-form .structured-form-grid,
    .portal-form.structured-form .portal-form-grid,
    .portal-form.structured-form .credential-slot-form-grid {
        grid-template-columns: 1fr !important;
    }

    .portal-form.structured-form .form-field-full {
        grid-column: auto !important;
    }
}

@media (max-width: 760px) {
    .panel > .portal-form.structured-form {
        padding: 12px !important;
    }

    .portal-form.structured-form > fieldset {
        padding: 18px 12px 14px !important;
    }

    .portal-form.structured-form .credential-scope-options {
        grid-template-columns: 1fr !important;
    }

    .portal-form.structured-form > .form-actions .primary-button,
    .portal-form.structured-form > .form-actions .secondary-button {
        flex: 1 1 140px !important;
        width: auto !important;
    }
}

@media (max-width: 520px) {
    .portal-form.structured-form > .form-actions .primary-button,
    .portal-form.structured-form > .form-actions .secondary-button {
        flex-basis: 100% !important;
        width: 100% !important;
    }
}

/* ============================================================ */
/* COMPLETE HARDENING (legacy source, consolidated) */
/* ============================================================ */
/* NETSTYLE PORTAL – COMPLETE HARDENING R1 */

/* Compact, aligned workday selection */
.weekday-card-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  margin-top: 8px !important;
}
.weekday-card {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-height: 46px !important;
  padding: 10px 12px !important;
  border: 1px solid #d7e0eb !important;
  border-radius: 9px !important;
  background: #f8fbff !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
}
.weekday-card:has(input:checked) {
  border-color: #1772e8 !important;
  background: #edf5ff !important;
  box-shadow: inset 0 0 0 1px #1772e8 !important;
}
.weekday-card.is-disabled { opacity: .55 !important; cursor: default !important; }
.weekday-card input { flex: 0 0 auto !important; margin: 0 !important; }
.weekday-card span { min-width: 0 !important; white-space: nowrap !important; }

.calendar-policy-grid {
  display: grid !important;
  grid-template-columns: minmax(260px, 1.15fr) minmax(260px, 1fr) minmax(260px, 1fr) !important;
  gap: 14px !important;
  align-items: stretch !important;
  margin-top: 18px !important;
}
.calendar-toggle-card {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  min-height: 64px !important;
  padding: 11px 13px !important;
  border: 1px solid #d7e0eb !important;
  border-radius: 9px !important;
  background: #f8fbff !important;
  box-sizing: border-box !important;
}
.calendar-toggle-card input { flex: 0 0 auto !important; margin: 0 !important; }
.calendar-toggle-card span { display: flex !important; flex-direction: column !important; gap: 3px !important; min-width: 0 !important; }
.calendar-toggle-card strong { line-height: 1.25 !important; }
.calendar-toggle-card small { color: #65778e !important; line-height: 1.35 !important; }

/* User work calendar uses same design without nesting visual fieldset glitches */
.user-work-calendar {
  margin: 20px 0 !important;
  padding: 20px 16px 16px !important;
  border: 1px solid #d7e0eb !important;
  border-radius: 10px !important;
  background: #fff !important;
}
.user-work-calendar > legend { padding: 0 8px !important; background: #fff !important; font-weight: 700 !important; }
.user-workdays-field { margin-top: 14px !important; }
.user-standard-toggle { margin: 10px 0 14px !important; }

/* Asset details: consistent panel header/body spacing */
.asset-note-panel, .asset-relation-panel { overflow: hidden !important; }
.asset-note-panel .panel-header, .asset-relation-panel .panel-header {
  padding: 14px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
.asset-note-panel .panel-header h2, .asset-relation-panel .panel-header h2 { margin: 0 !important; }
.asset-note-body { padding: 14px 16px 16px !important; }
.asset-note-body p { margin: 0 !important; }
.asset-relation-panel > .compact-list { padding: 0 !important; margin: 0 !important; }
.asset-relation-panel > .compact-list > a,
.asset-relation-panel > .compact-list > div {
  padding: 12px 16px !important;
  min-height: 52px !important;
  box-sizing: border-box !important;
}
.asset-relation-panel > .empty-state,
.asset-relation-panel > .compact-list > .empty-state { padding: 22px 16px !important; margin: 0 !important; }
.asset-relation-panel > .asset-credential-row { padding: 12px 16px !important; }

/* School-holiday hints are informational only */
.school-holiday-banner {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 0 14px !important;
  padding: 10px 13px !important;
  border: 1px solid #bfd8f8 !important;
  border-radius: 9px !important;
  background: #f0f7ff !important;
  color: #143a67 !important;
  line-height: 1.4 !important;
}
.school-holiday-note {
  display: block !important;
  margin-top: 5px !important;
  color: #47698f !important;
  line-height: 1.35 !important;
}
.school-holiday-badge {
  display: inline-flex !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  background: #eef5ff !important;
  color: #165da7 !important;
  font-weight: 600 !important;
}
.school-holiday-panel { margin-top: 16px !important; }
.school-holiday-panel .panel-header form { flex: 0 0 auto !important; margin: 0 !important; }

/* Avoid the checkbox/select misalignment visible in organisation settings */
.organisation-master-form .calendar-policy-grid > .form-field,
.organisation-master-form .calendar-toggle-card { margin: 0 !important; align-self: stretch !important; }
.organisation-master-form .calendar-policy-grid select { min-height: 64px !important; }

/* Cockpit / details: long values never collide with next cell */
.asset-detail-grid > div, .customer-masterdata-grid > div { min-width: 0 !important; }
.asset-detail-grid strong, .customer-masterdata-grid strong,
.asset-detail-grid a, .customer-masterdata-grid a {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Keep row actions horizontal on normal desktop widths */
@media (min-width: 900px) {
  .enterprise-row-actions { flex-wrap: nowrap !important; }
}

@media (max-width: 1250px) {
  .weekday-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .calendar-policy-grid { grid-template-columns: 1fr 1fr !important; }
  .calendar-policy-grid > :first-child { grid-column: 1 / -1 !important; }
}
@media (max-width: 760px) {
  .weekday-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .calendar-policy-grid { grid-template-columns: 1fr !important; }
  .calendar-policy-grid > :first-child { grid-column: auto !important; }
}

/* ============================================================
   NETSTYLE PORTAL DESIGN CORE R1 – GLOBAL CONTRACT
   Desktop reference: browser zoom 100 % approximates the
   previous preferred 90 % visual density.
   ============================================================ */

:root {
    --ns-density: .90;
    --ns-control-h: 36px;
    --ns-control-h-sm: 32px;
    --ns-space-1: 4px;
    --ns-space-2: 8px;
    --ns-space-3: 12px;
    --ns-space-4: 16px;
    --ns-radius: 8px;
    --ns-radius-panel: 11px;
    --ns-font-base: 13px;
    --ns-font-small: 11px;
    --ns-font-heading: 24px;
}

@media (min-width: 901px) {
    body { font-size: var(--ns-font-base); }

    .app-shell { grid-template-columns: 224px minmax(0, 1fr) !important; }
    .sidebar { width: 224px !important; }
    .brand { height: 80px !important; padding: 18px 23px !important; }
    .brand-main { font-size: 25px !important; }
    .navigation { padding: 16px 12px !important; }
    .nav-item {
        height: 40px !important;
        gap: 11px !important;
        padding: 0 12px !important;
        margin: 2px 0 !important;
        font-size: 12.5px !important;
        border-radius: 8px !important;
    }
    .nav-icon { width: 18px !important; font-size: 16px !important; }
    .nav-divider { margin: 11px 9px !important; }
    .sidebar-footer { padding: 15px 21px 18px !important; }

    .topbar { height: 68px !important; padding: 0 28px !important; }
    .global-search { height: 38px !important; }
    .notification { width: 32px !important; height: 32px !important; }
    .avatar { width: 34px !important; height: 34px !important; }
    .logout-button { width: 31px !important; height: 31px !important; }

    .content { padding: 28px !important; }
    .page-heading { margin-bottom: 22px !important; gap: 14px !important; }
    .page-heading h1 { font-size: var(--ns-font-heading) !important; }
    .page-heading p { margin-top: 5px !important; font-size: 12.5px !important; }

    .primary-button,
    .secondary-button {
        min-height: 36px !important;
        height: auto !important;
        padding: 7px 14px !important;
        border-radius: 8px !important;
        line-height: 1.15 !important;
    }

    .page-heading .primary-button,
    .page-heading .secondary-button,
    .enterprise-list-heading-actions .primary-button,
    .enterprise-list-heading-actions .secondary-button,
    .list-header-actions .primary-button,
    .list-header-actions .secondary-button {
        min-height: 36px !important;
        padding: 7px 12px !important;
    }

    .panel { border-radius: var(--ns-radius-panel) !important; }

    .panel > .portal-form.structured-form {
        padding: 12px 14px 14px !important;
    }

    .portal-form.structured-form > fieldset {
        margin-bottom: 16px !important;
        padding: 17px 14px 14px !important;
        border-radius: 9px !important;
    }

    .portal-form.structured-form > fieldset + fieldset {
        margin-top: 14px !important;
    }

    .portal-form.structured-form > fieldset > legend {
        margin-bottom: 11px !important;
        font-size: 13px !important;
    }

    .portal-form.structured-form .structured-form-grid,
    .portal-form.structured-form .portal-form-grid,
    .portal-form.structured-form .credential-slot-form-grid {
        column-gap: 16px !important;
        row-gap: 14px !important;
    }

    .portal-form.structured-form .form-field,
    .portal-form.structured-form .portal-field {
        gap: 5px !important;
    }

    .portal-form.structured-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    .portal-form.structured-form select,
    .portal-form.structured-form .portal-input {
        min-height: var(--ns-control-h) !important;
        height: var(--ns-control-h) !important;
    }

    .portal-form.structured-form textarea { min-height: 88px !important; }

    .portal-form.structured-form .checkbox-field > label,
    .portal-check-row { min-height: 34px !important; }

    .portal-form.structured-form > .form-actions,
    .portal-form.structured-form > .sticky-form-actions {
        padding-top: 13px !important;
        gap: 8px !important;
    }

    .portal-subnav,
    .customer-tabs { margin-bottom: 13px !important; }

    .portal-subnav a,
    .customer-tabs > a {
        min-height: 36px !important;
        padding: 0 12px !important;
    }

    .portal-dropzone {
        min-height: 122px !important;
        padding: 16px !important;
        border-radius: 10px !important;
    }
    .portal-dropzone-icon { font-size: 26px !important; }

    .enterprise-row-button,
    .knowledge-action-button,
    .table-action-button,
    .enterprise-actions-table tbody td:last-child > a,
    .enterprise-actions-table tbody td:last-child > button,
    .enterprise-actions-table tbody td:last-child > form > button,
    .workorder-list-table .workorder-open-button {
        min-height: 30px !important;
        min-width: 78px !important;
        padding: 6px 10px !important;
    }
}

.portal-check-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    margin: 0 !important;
    cursor: pointer;
}

.portal-check-row > input[type="checkbox"],
.permission-card > input[type="checkbox"] {
    flex: 0 0 auto !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    accent-color: #1769d2;
}

.portal-check-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.portal-check-copy strong { line-height: 1.25; }
.portal-check-copy small {
    color: #65778e;
    font-weight: 400;
    line-height: 1.3;
}

.permission-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #d7e0eb;
    border-radius: 9px;
    background: #f8fbff;
    cursor: pointer;
}

.permission-card:has(input:checked) {
    border-color: #1772e8;
    background: #edf5ff;
    box-shadow: inset 0 0 0 1px #1772e8;
}

.permission-card > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.permission-card strong { line-height: 1.25; }
.permission-card small { color: #65778e; line-height: 1.35; }

.portal-generated-fields { width: 100%; }
.portal-design-section + .portal-design-section { margin-top: 16px; }
.credential-grant-technical { margin-top: 14px !important; }

.portal-dropzone,
.knowledge-dropzone,
.profile-upload-dropzone,
.runtime-upload-zone {
    border-radius: 10px !important;
}

@media (max-width: 900px) {
    .permission-card-grid { grid-template-columns: 1fr; }
}

/* NETSTYLE_PORTAL_R2_CREDENTIAL_RUNTIME_SOFTDELETE */
/* NETSTYLE_PORTAL_R2_2_RUNTIME_UI_AND_DESIGN */

/* Credential runtime – kompakte Checklistenkomponente */
.runtime-credential-card--r2 {
    display: grid !important;
    gap: 8px !important;
    width: 100%;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.runtime-credential-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 22px;
    color: #12233d;
}

.runtime-credential-card-title strong {
    font-size: 13px;
    line-height: 1.25;
}

.runtime-credential-list {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.runtime-credential-entry {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #d8e1ed;
    border-radius: 8px;
    background: #ffffff;
}

.runtime-credential-entry-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.runtime-credential-identity {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.runtime-credential-identity > strong {
    color: #12233d;
    font-size: 13px;
    line-height: 1.25;
}

.runtime-credential-meta {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px !important;
    min-width: 0;
    color: #52677f;
    font-size: 11.5px;
    line-height: 1.3;
}

.runtime-credential-meta > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.runtime-credential-meta a {
    color: #1769d2;
    text-decoration: none;
}

.runtime-credential-meta a:hover {
    text-decoration: underline;
}

.runtime-credential-entry-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.runtime-credential-entry-actions .secondary-button,
.runtime-credential-secret-row .secondary-button {
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 11px !important;
    white-space: nowrap;
}

.runtime-credential-vault-form,
.portal-inline-action-form {
    display: inline-flex;
    margin: 0;
}

.runtime-credential-secret-row {
    display: grid !important;
    grid-template-columns: auto minmax(180px, 1fr) auto auto !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0;
    padding-top: 9px;
    margin: 0 !important;
    border-top: 1px solid #edf1f6;
}

.runtime-credential-secret-label {
    color: #52677f;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.runtime-credential-secret-row .portal-input {
    width: 100% !important;
    min-width: 0 !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
}

.runtime-credential-secret-denied {
    padding-top: 8px;
    border-top: 1px solid #edf1f6;
    font-size: 11.5px;
}

.runtime-credential-card--r2 .runtime-secret-warning {
    display: block;
    margin: 0;
    color: #738298;
    font-size: 10.5px;
    line-height: 1.3;
}

/* Einheitliche Checkbox-Komponente */
.portal-form.structured-form .checkbox-field {
    display: flex;
    align-items: stretch;
    min-width: 0;
}

.portal-form.structured-form .checkbox-field > .portal-check-row,
.portal-form.structured-form .checkbox-field > label {
    display: flex !important;
    flex: 1 1 auto;
    align-items: center !important;
    gap: 9px !important;
    min-width: 0;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 1px solid #d8e1ed;
    border-radius: 8px;
    background: #f8fbff;
    cursor: pointer;
    box-sizing: border-box;
}

.portal-form.structured-form .checkbox-field input[type="checkbox"] {
    flex: 0 0 auto !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0 !important;
    accent-color: #1769d2;
}

.portal-form.structured-form .checkbox-field .portal-check-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.portal-form.structured-form .checkbox-field .portal-check-copy strong {
    color: #12233d;
    font-size: 12px;
    line-height: 1.25;
}

.portal-form.structured-form .checkbox-field .portal-check-copy small {
    color: #65778e;
    font-size: 10.5px;
    line-height: 1.3;
}

/* Dokument-Upload – Builder-artige Dropzone */
.portal-dropzone.portal-dropzone--builder {
    position: relative;
    display: flex !important;
    min-height: 132px !important;
    width: 100%;
    padding: 18px !important;
    border: 1.5px dashed #8eb6e8 !important;
    border-radius: 10px !important;
    background: #f8fbff !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 5px !important;
    text-align: center !important;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.portal-dropzone.portal-dropzone--builder:hover,
.portal-dropzone.portal-dropzone--builder.is-dragover {
    border-color: #1772e8 !important;
    background: #eef6ff !important;
    box-shadow: inset 0 0 0 1px rgba(23, 114, 232, .08);
}

.portal-dropzone--builder .portal-dropzone-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 2px;
    border-radius: 10px;
    background: #eaf3ff;
    color: #1769d2;
    font-size: 22px !important;
    font-weight: 700;
}

.portal-dropzone--builder .portal-dropzone-title {
    color: #12233d;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
}

.portal-dropzone--builder .portal-dropzone-copy {
    color: #65778e;
    font-size: 11px;
    line-height: 1.3;
}

.portal-dropzone--builder input[type="file"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.portal-dropzone-file.portal-dropzone-file--builder {
    margin-top: 7px !important;
    padding: 7px 9px;
    border-radius: 7px;
    background: #f3f6fa;
    color: #536780;
    font-size: 11px !important;
}

/* Kunden-Cockpit – Stammdaten und Schnellzugriff */
.customer-masterdata-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0 !important;
    overflow: hidden;
    border: 1px solid #dbe4ef;
    border-radius: 9px;
    background: #ffffff;
}

.customer-masterdata-grid > div {
    min-width: 0 !important;
    min-height: 72px;
    padding: 11px 13px !important;
    border-right: 1px solid #e3e9f1;
    border-bottom: 1px solid #e3e9f1;
    background: #ffffff;
    box-sizing: border-box;
}

.customer-masterdata-grid > div:nth-child(3n) {
    border-right: 0;
}

.customer-masterdata-grid > div strong {
    display: block;
    margin-bottom: 4px;
    color: #667a92;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.customer-masterdata-grid > div p {
    margin: 0 !important;
    color: #12233d;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.customer-overview-grid {
    align-items: stretch;
}

.customer-overview-grid > a {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-height: 76px;
    gap: 3px;
    background: #ffffff !important;
}

.customer-overview-grid > a:hover {
    border-color: #8bb8ef !important;
    background: #f8fbff !important;
}

@media (max-width: 1100px) {
    .customer-masterdata-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .customer-masterdata-grid > div:nth-child(3n) {
        border-right: 1px solid #e3e9f1;
    }

    .customer-masterdata-grid > div:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 900px) {
    .runtime-credential-entry-head {
        flex-direction: column;
    }

    .runtime-credential-entry-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .customer-masterdata-grid {
        grid-template-columns: 1fr !important;
    }

    .customer-masterdata-grid > div {
        border-right: 0 !important;
    }
}

@media (max-width: 680px) {
    .runtime-credential-secret-row {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
    }

    .runtime-credential-secret-row .secondary-button {
        width: 100%;
    }
}
/* NETSTYLE_PORTAL_R2_CREDENTIAL_RUNTIME_SOFTDELETE_END */
/* ============================================================
   NETSTYLE PORTAL R2.3 – ZUGANGSDATEN-AUDIT
   ============================================================ */
/* NETSTYLE_PORTAL_R2_3_AUDIT_UI */

.credential-audit-toolbar {
    display: grid !important;
    grid-template-columns:
        minmax(220px, 1.45fr)
        minmax(150px, .9fr)
        minmax(160px, 1fr)
        minmax(145px, .85fr)
        minmax(135px, .75fr)
        minmax(135px, .75fr)
        minmax(175px, .95fr)
        auto !important;
    gap: 10px !important;
    align-items: end !important;
    width: 100%;
}
.credential-audit-filter { display:grid; gap:5px; min-width:0; }
.credential-audit-filter > label { color:#65778e; font-size:10.5px; font-weight:700; }
.credential-audit-filter .portal-input {
    width:100% !important; min-width:0 !important;
    height:36px !important; min-height:36px !important;
}
.credential-audit-view-toggle {
    display:flex !important; align-items:center !important; gap:8px !important;
    min-height:36px !important; margin:0 !important; padding:5px 9px !important;
    border:1px solid #d8e1ed; border-radius:8px; background:#f8fbff; cursor:pointer;
}
.credential-audit-view-toggle input {
    width:16px; height:16px; margin:0; accent-color:#1769d2;
}
.credential-audit-view-toggle > span { display:flex; flex-direction:column; gap:1px; }
.credential-audit-view-toggle strong { color:#12233d; font-size:11px; white-space:nowrap; }
.credential-audit-view-toggle small { color:#718198; font-size:9.5px; white-space:nowrap; }

.credential-audit-filter-actions {
    display:flex; align-items:center; justify-content:flex-end; gap:6px;
    min-height:36px; white-space:nowrap;
}
.credential-audit-filter-actions .primary-button,
.credential-audit-filter-actions .secondary-button {
    min-height:36px !important; height:36px !important; padding:0 12px !important;
}

.credential-audit-panel { overflow:hidden; }
.credential-audit-table { table-layout:fixed !important; min-width:900px; }
.credential-audit-col-time { width:155px; }
.credential-audit-col-user { width:170px; }
.credential-audit-col-action { width:260px; }
.credential-audit-col-object { width:auto; }
.credential-audit-col-result { width:120px; }

.credential-audit-table th,
.credential-audit-table td { padding:10px 12px !important; vertical-align:middle !important; }
.credential-audit-table thead th {
    color:#65778e; font-size:10px; letter-spacing:.02em; text-transform:uppercase;
}
.credential-audit-main-row td { border-bottom:0 !important; }
.credential-audit-time { white-space:nowrap !important; font-variant-numeric:tabular-nums; }
.credential-audit-action { display:grid; gap:2px; }
.credential-audit-action strong {
    color:#12233d; font-size:11.5px; font-weight:600; line-height:1.25;
}
.credential-audit-action small { color:#718198; font-size:10px; line-height:1.25; }
.credential-audit-object { overflow-wrap:anywhere; }

.credential-audit-technical-row > td {
    padding:0 12px 8px !important; border-top:0 !important;
}
.credential-audit-technical-details {
    width:100%; border:1px solid #e2e8f0; border-radius:7px;
    background:#f8fafc; overflow:hidden;
}
.credential-audit-technical-details > summary {
    width:fit-content; min-height:28px; padding:6px 9px; color:#33516f;
    font-size:10.5px; font-weight:700; cursor:pointer; white-space:nowrap;
}
.credential-audit-technical-details[open] > summary { border-bottom:1px solid #e2e8f0; }
.credential-audit-technical-body { display:grid; gap:8px; padding:10px; }
.credential-audit-technical-human { color:#536780; font-size:11px; }
.credential-audit-technical-body pre {
    width:100%; max-width:100%; max-height:280px; margin:0; padding:10px 12px;
    overflow:auto; box-sizing:border-box; border-radius:7px; background:#122033;
    color:#ecf3fb; font-size:10.5px; line-height:1.45;
    white-space:pre-wrap; overflow-wrap:anywhere;
}

@media (max-width:1450px) {
    .credential-audit-toolbar { grid-template-columns:repeat(4,minmax(150px,1fr)) !important; }
    .credential-audit-filter--search { grid-column:span 2; }
    .credential-audit-filter-actions { justify-content:flex-start; }
}
@media (max-width:900px) {
    .credential-audit-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
    .credential-audit-filter--search { grid-column:1/-1; }
}
@media (max-width:620px) {
    .credential-audit-toolbar { grid-template-columns:1fr !important; }
    .credential-audit-filter--search { grid-column:auto; }
    .credential-audit-filter-actions { flex-wrap:wrap; }
    .credential-audit-filter-actions > * { flex:1 1 auto; }
}
/* NETSTYLE_PORTAL_R2_3_AUDIT_UI_END */
/* ============================================================
   NETSTYLE PORTAL R2.4.1 – FEEDBACK / CONFIRM / ERROR SYSTEM
   ============================================================ */
/* NETSTYLE_PORTAL_R2_4_1_FEEDBACK_ERROR_SOFTDELETE */

.portal-messages {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}

.portal-toast-region {
    position: fixed;
    z-index: 5100;
    top: 82px;
    right: 18px;
    display: grid;
    width: min(430px, calc(100vw - 36px));
    gap: 8px;
    pointer-events: none;
}

.portal-message {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 9px;
    border: 1px solid #d9e3ef;
    border-left-width: 4px;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(18, 35, 61, .05);
}

.portal-toast {
    pointer-events: auto;
    box-shadow: 0 14px 36px rgba(18, 35, 61, .16);
}

.portal-message-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.portal-message-copy {
    min-width: 0;
    color: #21354e;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.portal-message-title {
    display: block;
    margin-bottom: 2px;
    color: #12233d;
}

.portal-message-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #718198;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    line-height: 1;
}

.portal-message-close:hover {
    background: #eef3f9;
    color: #1d3552;
}

.portal-message.success {
    border-left-color: #21875f;
    background: #f7fcf9;
}
.portal-message.success .portal-message-icon {
    background: #e5f5ed;
    color: #18734f;
}
.portal-message.success .portal-message-icon::before { content: "✓"; }

.portal-message.info {
    border-left-color: #1769d2;
    background: #f7faff;
}
.portal-message.info .portal-message-icon {
    background: #e8f1fd;
    color: #1769d2;
}
.portal-message.info .portal-message-icon::before { content: "i"; }

.portal-message.warning {
    border-left-color: #c77b16;
    background: #fffaf2;
}
.portal-message.warning .portal-message-icon {
    background: #fff0d6;
    color: #a9650e;
}
.portal-message.warning .portal-message-icon::before { content: "!"; }

.portal-message.error {
    border-left-color: #c84545;
    background: #fff8f8;
}
.portal-message.error .portal-message-icon {
    background: #fde8e8;
    color: #b53333;
}
.portal-message.error .portal-message-icon::before { content: "!"; }

.portal-modal-open {
    overflow: hidden;
}

.portal-confirm-backdrop[hidden] {
    display: none !important;
}

.portal-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 26, 49, .48);
    backdrop-filter: blur(2px);
}

.portal-confirm-dialog {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px 14px;
    width: min(480px, 100%);
    padding: 20px;
    border: 1px solid #d7e0eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(12, 31, 61, .22);
}

.portal-confirm-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #fff0e4;
    color: #b95b17;
    font-size: 20px;
    font-weight: 800;
}

.portal-confirm-content h2 {
    margin: 1px 0 6px;
    color: #12233d;
    font-size: 17px;
    line-height: 1.25;
}

.portal-confirm-content p {
    margin: 0;
    color: #596d85;
    font-size: 12.5px;
    line-height: 1.5;
    white-space: pre-line;
}

.portal-confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 6px;
}

.portal-danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #bd3f3f;
    border-radius: 7px;
    background: #c84545;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.portal-danger-button:hover {
    background: #ae3535;
    border-color: #a43131;
}

.portal-system-error-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #f4f7fb;
}

.portal-system-error-shell {
    width: min(620px, 100%);
}

.portal-system-error-brand {
    margin: 0 0 14px;
    color: #0c1f3d;
}

.portal-system-error-brand strong {
    display: block;
    font-size: 22px;
    letter-spacing: -.6px;
}

.portal-system-error-brand span {
    display: block;
    margin-top: 3px;
    color: #65778e;
    font-size: 9px;
    letter-spacing: 2.2px;
    text-transform: uppercase;
}

.portal-system-error-card {
    padding: 26px;
    border: 1px solid #dbe4ef;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 14px 42px rgba(12, 31, 61, .09);
}

.portal-system-error-code {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-bottom: 12px;
    padding: 0 9px;
    border-radius: 999px;
    background: #edf4ff;
    color: #1769d2;
    font-size: 11px;
    font-weight: 800;
}

.portal-system-error-card h1 {
    margin: 0 0 8px;
    color: #12233d;
    font-size: 24px;
    line-height: 1.2;
}

.portal-system-error-card p {
    margin: 0;
    color: #5f7188;
    line-height: 1.55;
}

.portal-system-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

@media (max-width: 620px) {
    .portal-toast-region {
        top: 70px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .portal-confirm-dialog {
        grid-template-columns: 1fr;
    }

    .portal-confirm-symbol {
        width: 36px;
        height: 36px;
    }

    .portal-confirm-actions {
        grid-column: auto;
        flex-direction: column-reverse;
    }

    .portal-confirm-actions > * {
        width: 100%;
    }

    .portal-message {
        grid-template-columns: 26px minmax(0, 1fr) 26px;
    }
}

/* NETSTYLE_PORTAL_R2_4_1_FEEDBACK_ERROR_SOFTDELETE_END */
/* ============================================================
   NETSTYLE PORTAL R2.6 – SOFT-DELETE HISTORY CONTRACT
   ============================================================ */
/* NETSTYLE_PORTAL_R2_6_SOFTDELETE_HISTORY_CONTRACT */
.softdelete-history-banner {
    grid-template-columns: 28px minmax(0, 1fr);
    margin: 0 0 14px;
}
.softdelete-history-banner .portal-message-title {
    margin-bottom: 4px;
}
.softdelete-history-meta {
    color: #5f7188;
    line-height: 1.5;
}
/* NETSTYLE_PORTAL_R2_6_SOFTDELETE_HISTORY_CONTRACT_END */
/* ============================================================
   NETSTYLE PORTAL R2.8 - CREDENTIAL RUNTIME FULL WIDTH
   ============================================================ */
/* NETSTYLE_PORTAL_R2_8_CREDENTIAL_RUNTIME_FULLWIDTH */

/* Zugangsdaten sind kein normales Einzelfeld:
   Die komplette Runtime-Komponente nutzt die volle Checklistenbreite. */
.checklist-items > .checklist-item--zugangsdaten {
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    align-items: stretch !important;
    gap: 0 !important;
    box-sizing: border-box !important;
}

/* Die Runtime-Komponente besitzt bereits eine eigene Überschrift. */
.checklist-item--zugangsdaten > .checklist-label {
    display: none !important;
}

.checklist-item--zugangsdaten > .checklist-control {
    display: block !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.checklist-item--zugangsdaten .runtime-credential-card--r2,
.checklist-item--zugangsdaten .runtime-credential-list,
.checklist-item--zugangsdaten .runtime-credential-entry {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Desktop: Passwortfeld nimmt den gesamten freien Raum ein. */
@media (min-width: 681px) {
    .checklist-item--zugangsdaten .runtime-credential-secret-row {
        grid-template-columns:
            minmax(68px, auto)
            minmax(0, 1fr)
            auto
            auto !important;
        width: 100% !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-entry-head {
        width: 100% !important;
    }
}

/* Smartphone: Metadaten, Aktionen und Secret-Steuerung untereinander. */
@media (max-width: 680px) {
    .checklist-item--zugangsdaten {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-entry {
        padding: 12px !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-entry-head {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-meta {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 4px !important;
        width: 100% !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-entry-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        justify-content: stretch !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-entry-actions > .secondary-button,
    .checklist-item--zugangsdaten .runtime-credential-vault-form,
    .checklist-item--zugangsdaten .runtime-credential-vault-form .secondary-button {
        width: 100% !important;
        max-width: none !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-secret-row {
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-secret-label {
        white-space: normal !important;
    }

    .checklist-item--zugangsdaten .runtime-credential-secret-row .secondary-button {
        width: 100% !important;
        max-width: none !important;
    }
}

/* NETSTYLE_PORTAL_R2_8_CREDENTIAL_RUNTIME_FULLWIDTH_END */

/* ============================================================
   NETSTYLE PORTAL R2.9 - CREDENTIAL DETAIL UI COMPLETE
   ============================================================ */
/* NETSTYLE_PORTAL_R2_9_CREDENTIAL_DETAIL_UI_COMPLETE */

.credential-detail-panel {
    overflow: hidden !important;
    padding: 0 !important;
}

.credential-detail-grid {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    grid-template-rows: auto auto !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 0 !important;
    border-bottom: 1px solid #dfe7f1;
    background: #ffffff;
}

.credential-detail-grid > div {
    min-width: 0 !important;
    padding: 14px 16px !important;
    border-right: 1px solid #e5ebf3;
    border-bottom: 1px solid #eef2f7;
    box-sizing: border-box !important;
}

.credential-detail-grid > div > strong {
    display: block;
    margin: 0 0 6px !important;
    color: #12233d;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.25;
}

.credential-detail-grid > div > p {
    margin: 0 !important;
    color: #12233d;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.credential-detail-grid > div:nth-child(1) {
    grid-column: 1 / 4;
    grid-row: 1;
}
.credential-detail-grid > div:nth-child(2) {
    grid-column: 4 / 6;
    grid-row: 1;
}
.credential-detail-grid > div:nth-child(3) {
    grid-column: 6 / 8;
    grid-row: 1;
}
.credential-detail-grid > div:nth-child(6) {
    grid-column: 8 / 10;
    grid-row: 1;
}
.credential-detail-grid > div:nth-child(7) {
    grid-column: 10 / 13;
    grid-row: 1;
    border-right: 0;
}

.credential-detail-grid > div:nth-child(4) {
    grid-column: 1 / 7;
    grid-row: 2;
}
.credential-detail-grid > div:nth-child(5) {
    grid-column: 7 / 13;
    grid-row: 2;
    border-right: 0;
}

.credential-detail-panel > p {
    margin: 0 !important;
    padding: 14px 16px !important;
    border-bottom: 1px solid #e5ebf3;
    color: #52677f;
    line-height: 1.45;
}

.credential-detail-panel > .credential-secret-panel {
    margin: 0 !important;
    padding: 16px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f8fbff !important;
}

.credential-detail-panel > .credential-secret-panel > strong {
    margin-bottom: 10px !important;
    color: #12233d;
}

.credential-detail-panel .credential-secret-row {
    width: 100% !important;
    margin-bottom: 8px !important;
}

.credential-detail-panel .credential-secret-row .portal-input {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
}

.credential-detail-panel .credential-secret-row .secondary-button {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
}

@media (max-width: 1100px) {
    .credential-detail-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-rows: auto !important;
    }

    .credential-detail-grid > div:nth-child(1),
    .credential-detail-grid > div:nth-child(2),
    .credential-detail-grid > div:nth-child(3),
    .credential-detail-grid > div:nth-child(6) {
        grid-column: span 2 !important;
        grid-row: auto !important;
    }

    .credential-detail-grid > div:nth-child(7),
    .credential-detail-grid > div:nth-child(4),
    .credential-detail-grid > div:nth-child(5) {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        border-right: 0 !important;
    }
}

@media (max-width: 720px) {
    .credential-detail-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .credential-detail-grid > div,
    .credential-detail-grid > div:nth-child(1),
    .credential-detail-grid > div:nth-child(2),
    .credential-detail-grid > div:nth-child(3),
    .credential-detail-grid > div:nth-child(4),
    .credential-detail-grid > div:nth-child(5),
    .credential-detail-grid > div:nth-child(6),
    .credential-detail-grid > div:nth-child(7) {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        border-right: 0 !important;
    }

    .credential-detail-panel .credential-secret-row {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .credential-detail-panel .credential-secret-row .portal-input,
    .credential-detail-panel .credential-secret-row .secondary-button {
        width: 100% !important;
        max-width: none !important;
    }
}

/* NETSTYLE_PORTAL_R2_9_CREDENTIAL_DETAIL_UI_COMPLETE_END */

/* ============================================================
   NETSTYLE PORTAL R3.0 - CREDENTIAL COCKPIT COMPLETE
   ============================================================ */
/* NETSTYLE_PORTAL_R3_0_CREDENTIAL_COCKPIT_COMPLETE */

.credential-cockpit-heading { margin-bottom:18px !important; }
.credential-cockpit-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; }
.credential-cockpit-title-row h1 { margin:0 !important; }
.credential-cockpit-badges { display:flex; flex-wrap:wrap; gap:6px; }
.credential-cockpit-badge { display:inline-flex; align-items:center; min-height:24px; padding:3px 9px; border:1px solid #cfd9e6; border-radius:999px; background:#f7f9fc; color:#41566f; font-size:10.5px; font-weight:700; line-height:1.1; }
.credential-cockpit-badge.is-good { border-color:#b7dec8; background:#effaf4; color:#236344; }
.credential-cockpit-badge.is-warning { border-color:#ead4a0; background:#fff9eb; color:#855d10; }
.credential-cockpit-badge.is-muted { background:#f2f4f7; color:#68798d; }

.credential-cockpit-grid { display:grid; width:100%; min-width:0; gap:18px; margin-bottom:18px; }
.credential-cockpit-grid--hero { grid-template-columns:minmax(0,2fr) minmax(300px,1fr); }
.credential-cockpit-grid--secondary { grid-template-columns:repeat(2,minmax(0,1fr)); }
.credential-cockpit-card { min-width:0; padding:18px !important; }
.credential-cockpit-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.credential-cockpit-card-head h2 { margin:2px 0 0; color:#12233d; font-size:16px; line-height:1.25; }
.credential-cockpit-eyebrow { display:block; color:#6a7c92; font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.credential-inline-action { flex:0 0 auto; min-height:32px !important; padding:0 11px !important; white-space:nowrap !important; }
.credential-count-badge { display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:30px; padding:0 8px; border-radius:999px; background:#edf5ff; color:#1769d2; font-weight:800; }

.credential-access-list { display:grid; gap:0; border:1px solid #e1e8f1; border-radius:9px; overflow:hidden; }
.credential-access-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:12px; min-width:0; padding:12px 14px; background:#fff; }
.credential-access-row + .credential-access-row { border-top:1px solid #e8edf4; }
.credential-access-row > div { display:grid; gap:4px; min-width:0; }
.credential-access-row strong,.credential-access-row a { min-width:0; overflow-wrap:anywhere; }
.credential-access-label { display:block; color:#687b92; font-size:10.5px; font-weight:700; line-height:1.2; }

.credential-cockpit-secret { margin-top:14px; padding:14px; border:1px solid #d7e2ee; border-radius:9px; background:#f8fbff; }
.credential-cockpit-secret .credential-access-label { margin-bottom:8px; }
.credential-cockpit-secret .credential-secret-row { display:flex !important; align-items:center !important; gap:8px !important; width:100%; margin:0 0 8px !important; }
.credential-cockpit-secret .credential-secret-row .portal-input { flex:1 1 auto !important; width:auto !important; min-width:0 !important; }
.credential-cockpit-secret .credential-secret-row .secondary-button { flex:0 0 auto !important; white-space:nowrap !important; }
.credential-cockpit-secret small { color:#6d7f94; }
.credential-cockpit-description { margin-top:14px; padding-top:14px; border-top:1px solid #e7edf4; }
.credential-cockpit-description p { margin:6px 0 0; line-height:1.5; }

.credential-status-list { display:grid; gap:8px; }
.credential-status-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:8px; min-width:0; padding:8px 0; border-bottom:1px solid #edf1f5; }
.credential-status-dot { width:9px; height:9px; border-radius:999px; background:#98a6b7; }
.credential-status-dot.is-good { background:#2b9b65; }
.credential-status-dot.is-warning { background:#d79a2b; }
.credential-status-row > span:nth-child(2) { color:#52677f; font-size:12px; }
.credential-status-row strong { color:#12233d; font-size:12px; }

.credential-status-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; }
.credential-status-facts > div { display:grid; gap:4px; min-width:0; padding:11px; border-radius:8px; background:#f7f9fc; }
.credential-status-facts span,.credential-context-grid span,.credential-relation-grid span,.credential-technical-grid span { color:#697b91; font-size:10.5px; font-weight:700; }
.credential-status-facts strong,.credential-context-grid strong,.credential-relation-grid strong,.credential-technical-grid strong { min-width:0; color:#12233d; font-size:12px; overflow-wrap:anywhere; }
.credential-status-facts small,.credential-technical-grid small { color:#7b8999; line-height:1.3; }

.credential-context-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.credential-context-grid > div,.credential-technical-grid > div { display:grid; gap:4px; min-width:0; padding:11px; border:1px solid #e5ebf2; border-radius:8px; background:#fff; }
.credential-relation-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:12px; }
.credential-relation-grid > div { display:grid; gap:4px; padding:10px; border-radius:8px; background:#f5f8fc; text-align:center; }
.credential-relation-grid strong { font-size:18px; }

.credential-grant-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.credential-grant-kpis > div { display:grid; gap:3px; padding:10px; border-radius:8px; background:#f5f8fc; text-align:center; }
.credential-grant-kpis strong { color:#12233d; font-size:18px; }
.credential-grant-kpis span { color:#6b7d93; font-size:10px; }
.credential-grant-preview { display:grid; gap:0; margin-top:12px; border-top:1px solid #e8edf4; }
.credential-grant-preview-row { display:grid; grid-template-columns:minmax(140px,.8fr) minmax(0,1.2fr); gap:12px; min-width:0; padding:9px 0; border-bottom:1px solid #edf1f5; }
.credential-grant-preview-row strong,.credential-grant-preview-row span { min-width:0; overflow-wrap:anywhere; }
.credential-grant-preview-row span { color:#687b92; font-size:11.5px; }

.credential-cockpit-activity { margin-bottom:18px; }
.credential-activity-list { display:grid; }
.credential-activity-row { display:grid; grid-template-columns:135px minmax(180px,1.1fr) minmax(150px,1fr) auto; align-items:center; gap:12px; min-width:0; padding:10px 0; border-top:1px solid #edf1f5; }
.credential-activity-row:first-child { border-top:0; }
.credential-activity-row time,.credential-activity-row span { color:#65788f; font-size:11.5px; }
.credential-activity-row strong { color:#12233d; font-size:12px; }
.credential-activity-result { justify-self:end; padding:4px 8px; border-radius:999px; background:#f2f4f7; font-size:10px !important; font-weight:700; }
.credential-activity-result.is-good { background:#edf8f2; color:#246544; }
.credential-activity-result.is-warning { background:#fff6e5; color:#8a6113; }

.credential-cockpit-technical { padding:0 !important; overflow:hidden; }
.credential-cockpit-technical summary { cursor:pointer; padding:15px 18px; color:#12233d; font-weight:700; list-style-position:inside; }
.credential-cockpit-technical details[open] summary { border-bottom:1px solid #e5ebf2; }
.credential-technical-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:16px 18px 18px; }

@media (max-width:1180px) {
    .credential-cockpit-grid--hero,.credential-cockpit-grid--secondary { grid-template-columns:minmax(0,1fr) !important; }
}

@media (max-width:760px) {
    .credential-cockpit-card { padding:14px !important; }
    .credential-cockpit-title-row { align-items:flex-start; }
    .credential-access-row { grid-template-columns:minmax(0,1fr); align-items:stretch; }
    .credential-access-row .credential-inline-action { width:100% !important; }
    .credential-cockpit-secret .credential-secret-row { flex-direction:column !important; align-items:stretch !important; }
    .credential-cockpit-secret .credential-secret-row .portal-input,.credential-cockpit-secret .credential-secret-row .secondary-button { width:100% !important; max-width:none !important; }
    .credential-status-facts,.credential-context-grid,.credential-technical-grid { grid-template-columns:minmax(0,1fr) !important; }
    .credential-relation-grid,.credential-grant-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .credential-grant-preview-row,.credential-activity-row { grid-template-columns:minmax(0,1fr); gap:4px; }
    .credential-activity-result { justify-self:start; }
}

@media (max-width:420px) {
    .credential-cockpit-badges { width:100%; }
    .credential-relation-grid,.credential-grant-kpis { grid-template-columns:minmax(0,1fr); }
}

/* NETSTYLE_PORTAL_R3_0_CREDENTIAL_COCKPIT_COMPLETE_END */

/* ============================================================
   NETSTYLE PORTAL R3.1 - DIRECT RELATIONS + PERSONAL DASHBOARD
   ============================================================ */
/* NETSTYLE_PORTAL_R3_1_DIRECT_RELATIONS_PERSONAL_DASHBOARD */

.credential-relation-grid > .credential-relation-tile {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #f5f8fc;
    color: inherit;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}
.credential-relation-grid > .credential-relation-tile strong { color:#12233d; font-size:18px; }
.credential-relation-grid > .credential-relation-tile span { color:#697b91; font-size:10.5px; font-weight:700; }
.credential-relation-grid > .credential-relation-tile small { color:#1769d2; font-size:9.5px; font-weight:700; }
.credential-relation-grid > .credential-relation-tile.is-linked {
    border-color:#cfe0f5;
    background:#f4f9ff;
    cursor:pointer;
}
.credential-relation-grid > .credential-relation-tile.is-linked:hover,
.credential-relation-grid > .credential-relation-tile.is-linked:focus-visible {
    border-color:#7eb2ef;
    background:#eaf4ff;
    box-shadow:0 0 0 2px rgba(23,105,210,.08);
    outline:none;
}
.credential-relation-grid > .credential-relation-tile.is-empty { opacity:.72; }

.credential-direct-relations {
    display:grid;
    gap:10px;
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid #e7edf4;
}
.credential-direct-relations-head {
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
}
.credential-direct-relations-head small { color:#7a899b; }
.credential-direct-relation-group {
    display:grid;
    grid-template-columns:minmax(100px,130px) minmax(0,1fr);
    align-items:start;
    gap:10px;
    padding:9px 0;
    border-top:1px solid #edf1f5;
    scroll-margin-top:90px;
}
.credential-direct-relation-group:first-of-type { border-top:0; }
.credential-direct-relation-group > strong {
    color:#12233d;
    font-size:11.5px;
    line-height:32px;
}
.credential-direct-relation-group > div {
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    min-width:0;
}
.credential-direct-link {
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
}

@media (max-width:760px) {
    .credential-direct-relations-head {
        align-items:flex-start;
        flex-direction:column;
        gap:3px;
    }
    .credential-direct-relation-group {
        grid-template-columns:minmax(0,1fr);
        gap:5px;
    }
    .credential-direct-relation-group > strong { line-height:1.3; }
    .credential-direct-relation-group > div { display:grid; }
    .credential-direct-link { width:100% !important; }
}

/* NETSTYLE_PORTAL_R3_1_DIRECT_RELATIONS_PERSONAL_DASHBOARD_END */

/* ============================================================
   NETSTYLE PORTAL R3.2 - PERSONAL ACTIVITY / DASHBOARD
   ============================================================ */
/* NETSTYLE_PORTAL_R3_2_PERSONAL_ACTIVITY_DASHBOARD */
.activity-page-heading .activity-scope-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.activity-table .activity-action-column{width:1%;white-space:nowrap;text-align:right}
.dashboard-activity-heading{align-items:flex-start;gap:10px}
.dashboard-activity-heading .dashboard-activity-all-button{margin-left:auto;white-space:nowrap}
.activity-item .activity-open-link{display:inline-flex;align-items:center;justify-content:center;margin-top:7px;min-height:27px;padding:4px 8px;border:1px solid #d4dfeb;border-radius:6px;background:#fff;color:#17324f;font-size:10.5px;font-weight:700;line-height:1;text-decoration:none}
.activity-item .activity-open-link:hover,.activity-item .activity-open-link:focus-visible{border-color:#86b5ee;background:#f4f9ff;color:#1769d2;outline:none}
.checklist-item[id^="punkt-"]{scroll-margin-top:96px}
.checklist-item[id^="punkt-"]:target{border-color:#72a9ea;box-shadow:0 0 0 3px rgba(23,105,210,.12);background:#f8fbff}
@media(max-width:760px){.activity-page-heading .activity-scope-actions,.activity-page-heading .activity-scope-actions .secondary-button{width:100%}.dashboard-activity-heading{flex-direction:column}.dashboard-activity-heading .dashboard-activity-all-button{margin-left:0;width:100%!important}}
/* NETSTYLE_PORTAL_R3_2_PERSONAL_ACTIVITY_DASHBOARD_END */

/* ============================================================
   NETSTYLE PORTAL R3.2.1 - DASHBOARD ACTIVITY HEADER UI FIX
   ============================================================ */
/* NETSTYLE_PORTAL_R3_2_1_DASHBOARD_ACTIVITY_HEADER_UI_FIX */

.dashboard-side-column .dashboard-activity-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.dashboard-side-column .dashboard-activity-heading > div {
    min-width: 0 !important;
}

.dashboard-side-column .dashboard-activity-heading h2 {
    margin: 0 !important;
    white-space: nowrap;
}

.dashboard-side-column .dashboard-activity-all-button {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 30px !important;
    margin-left: auto !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    font-size: 10.5px !important;
}

/* Auf kleinen Displays darf der Link wieder die volle Zeile nutzen. */
@media (max-width: 760px) {
    .dashboard-side-column .dashboard-activity-heading {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .dashboard-side-column .dashboard-activity-all-button {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* NETSTYLE_PORTAL_R3_2_1_DASHBOARD_ACTIVITY_HEADER_UI_FIX_END */

/* ============================================================
   NETSTYLE PORTAL R3.2.2 - DASHBOARD ACTIVITY UI + CHECK FIX
   ============================================================ */
/* NETSTYLE_PORTAL_R3_2_2_DASHBOARD_ACTIVITY_UI_AND_CHECK_FIX */

/*
 * R3.2.1 verwendete einen zu spezifischen Parent-Selektor.
 * Der Dashboard-Header wird hier absichtlich direkt adressiert.
 */
.dashboard-activity-heading {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.dashboard-activity-heading > div {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.dashboard-activity-heading h2 {
    margin: 0 !important;
    white-space: normal !important;
}

.dashboard-activity-heading .dashboard-activity-all-button {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 30px !important;
    margin: 0 0 0 auto !important;
    padding: 0 10px !important;
    white-space: nowrap !important;
    font-size: 10.5px !important;
}

/* Nur auf echten kleinen Displays untereinander. */
@media (max-width: 760px) {
    .dashboard-activity-heading {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .dashboard-activity-heading .dashboard-activity-all-button {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* NETSTYLE_PORTAL_R3_2_2_DASHBOARD_ACTIVITY_UI_AND_CHECK_FIX_END */

/* ============================================================
   NETSTYLE PORTAL R3.2.3 - DASHBOARD ACTIVITY HEADER FINAL FIX
   ============================================================ */
/* NETSTYLE_PORTAL_R3_2_3_DASHBOARD_ACTIVITY_HEADER_FINAL_FIX */
/* NETSTYLE_PORTAL_R3_2_4_ACTIVITY_HEADER_COMPACT_FINAL_V2 */

/*
 * Finale Desktop-Regel:
 * - bewusst CSS Grid statt Flex, damit ein globales flex-wrap des
 *   generischen .panel-header den Button nicht mehr in die zweite Zeile zwingt.
 * - Titel links, Button rechts, immer dieselbe Kopfzeile.
 */
.panel-header.dashboard-activity-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    justify-content: stretch !important;
    column-gap: 8px !important;
    row-gap: 0 !important;
    flex-direction: unset !important;
    flex-wrap: nowrap !important;
}

.panel-header.dashboard-activity-heading > div {
    min-width: 0 !important;
    width: auto !important;
}

.panel-header.dashboard-activity-heading h2 {
    margin: 0 !important;
    min-width: 0 !important;
    /* R3.2.6 V3: keine eigene Schriftgroesse.
       Damit gilt dieselbe generische Panel-H2-Groesse wie bei "Mein Fortschritt". */
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.panel-header.dashboard-activity-heading .dashboard-activity-all-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    justify-self: end !important;
    align-self: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 26px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    white-space: nowrap !important;
    font-size: 9.5px !important;
    line-height: 1 !important;
}

/* Nur auf kleinen Displays untereinander. */
@media (max-width: 760px) {
    .panel-header.dashboard-activity-heading {
        grid-template-columns: minmax(0, 1fr) !important;
        row-gap: 8px !important;
    }

    .panel-header.dashboard-activity-heading h2 {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .panel-header.dashboard-activity-heading .dashboard-activity-all-button {
        justify-self: stretch !important;
        width: 100% !important;
    }
}

/* NETSTYLE_PORTAL_R3_2_3_DASHBOARD_ACTIVITY_HEADER_FINAL_FIX_END */

/* ============================================================
   NETSTYLE PORTAL R3.2.5 - CHECKLIST TEMPLATE SEARCH
   ============================================================ */
/* NETSTYLE_PORTAL_R3_2_5_CHECKLIST_TEMPLATE_SEARCH */
/* NETSTYLE_PORTAL_R3_2_6_TEMPLATE_PICKER_PERSONAL_USAGE_AND_HEADER_FONT_V3 */

.checklist-template-picker {
    position: relative;
    width: 100%;
}

.checklist-template-picker-control {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: stretch;
    width: 100%;
}

.checklist-template-picker-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    color: #6f8298;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
}

.checklist-template-picker-input {
    width: 100%;
    min-width: 0;
    padding-left: 34px !important;
    padding-right: 10px !important;
    border-radius: 8px 0 0 8px !important;
}

.checklist-template-picker-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    padding: 0;
    border: 1px solid #d5dee9;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #fff;
    color: #566a81;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

.checklist-template-picker-toggle:hover,
.checklist-template-picker-toggle:focus-visible {
    background: #f4f8fc;
    color: #1769d2;
    outline: none;
}

.checklist-template-picker.is-open .checklist-template-picker-input,
.checklist-template-picker.is-open .checklist-template-picker-toggle {
    border-color: #79ace9;
}

.checklist-template-picker-list,
.checklist-template-picker-empty {
    position: absolute;
    z-index: 40;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #d5dee9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(20, 42, 72, .14);
}

.checklist-template-picker-option {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid #edf1f5;
    background: #fff;
    color: #14273f;
    text-align: left;
    cursor: pointer;
}

.checklist-template-picker-option:last-child {
    border-bottom: 0;
}

.checklist-template-picker-option:hover,
.checklist-template-picker-option:focus-visible,
.checklist-template-picker-option.is-active {
    background: #eef6ff;
    color: #125fb9;
    outline: none;
}

.checklist-template-picker-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

.checklist-template-picker-empty {
    padding: 12px;
    color: #7c4a3a;
    font-size: 11.5px;
}

.checklist-template-select-source {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 760px) {
    .checklist-template-picker-list,
    .checklist-template-picker-empty {
        max-height: 220px;
    }
}

/* NETSTYLE_PORTAL_R3_2_5_CHECKLIST_TEMPLATE_SEARCH_END */
/* NETSTYLE_PORTAL_R3_2_6_TEMPLATE_PICKER_PERSONAL_USAGE_AND_HEADER_FONT_V3_END */

/* NETSTYLE_PORTAL_R3_3_3_CATEGORY_FILTER_START */
.portal-field--full {
    grid-column: 1 / -1;
}

#id_kategorie {
    width: 100%;
}

@media (max-width: 760px) {
    .portal-field--full {
        grid-column: auto;
    }
}
/* NETSTYLE_PORTAL_R3_3_3_CATEGORY_FILTER_END */

/* ============================================================
   NETSTYLE PORTAL R3.3.7 - UI / CREDENTIAL RUNTIME FINISH
   ============================================================ */
/* NETSTYLE_PORTAL_R3_3_7_UI_RUNTIME_AND_ANNOTATION_PREVIEW */

/* Direkte Objektverknüpfungen skalieren als eigener Vollbreitenblock. */
.credential-direct-relations-panel {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 18px !important;
    overflow: hidden !important;
}
.credential-direct-relations-panel .credential-direct-relations {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: 0 !important;
}
.credential-direct-relations-panel .credential-direct-relations-head {
    padding-bottom: 4px;
}
.credential-direct-relations-panel .credential-direct-relation-group {
    grid-template-columns: minmax(110px, 155px) minmax(0, 1fr) !important;
}
.credential-direct-relations-panel .credential-direct-relation-group > div {
    align-items: center;
}

/* Sicherheit & Status: drei gleichwertige Desktop-Spalten. */
.credential-security-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
    width: 100% !important;
}
.credential-security-grid > .form-field {
    min-width: 0 !important;
    margin: 0 !important;
}
.credential-security-grid > .credential-security-toggle {
    padding-top: 21px !important;
    align-items: stretch !important;
}
.credential-security-grid > .credential-security-toggle > .portal-check-row {
    flex: 1 1 auto !important;
    min-height: 38px !important;
    height: 100% !important;
    box-sizing: border-box !important;
}
.credential-security-grid > .credential-security-class > select,
.credential-security-grid > .credential-security-class > .portal-input {
    width: 100% !important;
}

.runtime-credential-secret-missing strong {
    color: #52677f;
    margin-right: 4px;
}

@media (max-width: 1100px) {
    .credential-security-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .credential-security-grid > .credential-security-toggle {
        padding-top: 0 !important;
    }
}

@media (max-width: 720px) {
    .credential-security-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 760px) {
    .credential-direct-relations-panel .credential-direct-relation-group {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
/* NETSTYLE_PORTAL_R3_3_7_UI_RUNTIME_AND_ANNOTATION_PREVIEW_END */

/* ============================================================
   NETSTYLE PORTAL R3.3.17 R8 - BROWSER INTENSIV FIXPACK
   ============================================================ */
/* NETSTYLE_PORTAL_R3_3_17_BROWSER_INTENSIV_FIXPACK_R8 */

.dashboard-workorder-row[data-row-href] {
    cursor: pointer;
}
.dashboard-workorder-row[data-row-href]:hover > td {
    background: #f7fbff;
}
.dashboard-workorder-row[data-row-href]:focus-visible {
    outline: 2px solid #1772e8;
    outline-offset: -2px;
}

.dashboard-side-column .dashboard-activity-all-button,
.dashboard-side-column .activity-item .activity-open-link {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 54px !important;
    min-width: 54px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 8px !important;
    margin: 0 !important;
    border-radius: 7px !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
.dashboard-side-column .activity-item {
    display: grid !important;
    grid-template-columns: 8px minmax(0, 1fr) 54px !important;
    align-items: start !important;
    column-gap: 10px !important;
}
.dashboard-side-column .activity-item .activity-open-link {
    grid-column: 3 !important;
    justify-self: end !important;
    align-self: start !important;
}

button[data-vorgang-abschliessen="1"]:disabled {
    cursor: not-allowed !important;
    opacity: .46 !important;
    filter: saturate(.35);
}

.pruefplan-error-panel {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 2px !important;
    min-height: 58px !important;
    padding: 10px 14px !important;
    border: 1px solid #f3c6c6 !important;
    border-left: 4px solid #c93737 !important;
    border-radius: 10px !important;
    background: #fff8f8 !important;
    color: #7c2020 !important;
}
.pruefplan-error-panel::before {
    content: "!";
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fbe3e3;
    color: #a62929;
    font-weight: 800;
}
.pruefplan-error-panel > strong,
.pruefplan-error-panel > p {
    margin: 0 !important;
}
.pruefplan-error-panel > strong {
    font-size: 12.5px !important;
}
.pruefplan-error-panel > p {
    color: #8b3a3a !important;
    font-size: 11.5px !important;
}

.pruefplan-preview-list {
    align-items: stretch !important;
}
.pruefplan-preview-row {
    box-sizing: border-box !important;
    height: 100% !important;
    min-height: 118px !important;
    align-content: start !important;
}
.pruefplan-preview-row > div {
    min-width: 0 !important;
}

.pruefplan-form,
.pruefplan-form fieldset,
.pruefplan-form .form-field,
.pruefplan-form .portal-field,
.pruefplan-form .structured-form-grid,
.pruefplan-form .portal-form-grid {
    min-width: 0 !important;
}
.pruefplan-form input:not([type="checkbox"]):not([type="radio"]),
.pruefplan-form select,
.pruefplan-form textarea,
.pruefplan-form .portal-input {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
.pruefplan-form select {
    padding-right: 34px !important;
}
