* {
    box-sizing: border-box;
}

:root {
    --navy: #0c1f3d;
    --navy-2: #10294f;
    --navy-3: #173761;
    --blue: #1769d2;
    --blue-soft: #eaf2fc;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #18263a;
    --muted: #748096;
    --line: #e6ebf2;
    --green: #1d9b67;
    --orange: #d88721;
    --red: #cf4d4d;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(24, 38, 58, 0.06);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

button,
input {
    font: inherit;
}


/* ============================================================
   APP SHELL
   ============================================================ */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 248px;

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            180deg,
            #0b1e3c 0%,
            #0e274b 100%
        );

    color: white;
}

.brand {
    height: 88px;
    padding: 20px 26px;

    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.brand-main {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1;
}

.brand-sub {
    margin-top: 5px;
    font-size: 9px;
    letter-spacing: 3px;
    opacity: .65;
}

.navigation {
    padding: 20px 14px;
    flex: 1;
}

.nav-item {
    height: 44px;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 0 14px;
    margin: 3px 0;

    border-radius: 9px;

    color: rgba(255,255,255,.76);
    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    transition: .15s ease;
}

.nav-item:hover {
    background: rgba(255,255,255,.07);
    color: white;
}

.nav-item.active {
    background: #1769d2;
    color: white;
}

.nav-item.disabled {
    cursor: default;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,.08);
    margin: 14px 10px;
}

.sidebar-footer {
    padding: 18px 24px 22px;

    border-top:
        1px solid rgba(255,255,255,.08);

    display: flex;
    flex-direction: column;
    gap: 3px;

    font-size: 11px;
    color: rgba(255,255,255,.55);
}

.sidebar-footer small {
    opacity: .65;
}

.main-column {
    grid-column: 2;
    min-width: 0;
}

.topbar {
    height: 76px;

    position: sticky;
    top: 0;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 32px;

    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--line);
}

.global-search {
    width: min(440px, 45vw);
    height: 42px;

    display: flex;
    align-items: center;

    padding: 0 12px;

    background: #f6f8fb;
    border: 1px solid #e6eaf0;
    border-radius: 9px;
}

.global-search input {
    flex: 1;

    border: 0;
    outline: 0;
    background: transparent;

    padding: 0 10px;

    color: var(--text);
}

.search-symbol {
    color: #8994a8;
}

.shortcut {
    padding: 4px 7px;

    border: 1px solid #dfe4ec;
    border-radius: 5px;

    background: white;

    color: #7b8799;
    font-size: 11px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 11px;
}

.notification {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border: 1px solid var(--line);
    border-radius: 9px;
}

.avatar {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--navy);
    color: white;

    font-size: 12px;
    font-weight: 700;
}

.user-data {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.user-data strong {
    font-size: 13px;
}

.user-data span {
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
}

.logout-button {
    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    cursor: pointer;

    color: #68758b;

    font-size: 18px;
}

.logout-button:hover {
    background: #f1f4f8;
}


/* ============================================================
   CONTENT
   ============================================================ */

.content {
    padding: 32px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 26px;
}

.page-heading h1 {
    margin: 0;
    font-size: 27px;
    letter-spacing: -.5px;
}

.page-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.primary-button {
    height: 42px;

    padding: 0 17px;

    border: 0;
    border-radius: 9px;

    background: var(--blue);
    color: white;

    font-weight: 600;
}

.primary-button:disabled {
    opacity: .85;
}


/* ============================================================
   KPI
   ============================================================ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;

    margin-bottom: 22px;
}

.kpi-card {
    min-height: 118px;

    display: flex;
    align-items: center;
    gap: 16px;

    padding: 21px;

    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.kpi-icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: var(--blue-soft);
    color: var(--blue);

    font-size: 22px;
}

.kpi-card > div:last-child {
    display: grid;
    grid-template-columns: auto auto;
    align-items: end;
    column-gap: 7px;
}

.kpi-label {
    grid-column: 1 / -1;

    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.kpi-card strong {
    margin-top: 5px;
    font-size: 28px;
    line-height: 1;
}

.kpi-card small {
    padding-bottom: 2px;
    color: var(--muted);
}


/* ============================================================
   PANELS
   ============================================================ */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel-header {
    min-height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 21px;

    border-bottom: 1px solid var(--line);
}

.panel-header h2 {
    margin: 0;
    font-size: 15px;
}

.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.text-link {
    color: var(--blue);
    text-decoration: none;
    font-size: 12px;
}

.dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;

    margin-bottom: 22px;
}

.dashboard-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
}


/* ============================================================
   TABLE
   ============================================================ */

.table-wrapper {
    overflow-x: auto;
}

.workorder-table {
    width: 100%;
    border-collapse: collapse;
}

.workorder-table th {
    padding: 13px 17px;

    text-align: left;

    background: #fafbfd;
    border-bottom: 1px solid var(--line);

    color: #7b8799;

    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.workorder-table td {
    padding: 15px 17px;

    border-bottom: 1px solid #edf0f5;

    font-size: 12px;
    white-space: nowrap;
}

.workorder-table tbody tr:last-child td {
    border-bottom: 0;
}

.workorder-table tbody tr:hover {
    background: #fafcff;
}

.template-cell {
    display: flex;
    flex-direction: column;
}

.template-cell small {
    margin-top: 3px;
    color: var(--muted);
}

.progress-cell {
    min-width: 125px;

    display: flex;
    align-items: center;
    gap: 9px;
}

.progress-track {
    width: 75px;
    height: 6px;

    overflow: hidden;

    background: #e9edf3;
    border-radius: 20px;
}

.progress-value {
    height: 100%;
    background: var(--blue);
    border-radius: inherit;
}

.progress-cell span {
    color: #637087;
    font-size: 11px;
}

.status-badge {
    display: inline-flex;

    padding: 5px 8px;

    border-radius: 20px;

    font-size: 10px;
    font-weight: 700;
}

.status--offen {
    background: #fff4df;
    color: #a76a12;
}

.status--in_bearbeitung {
    background: #e8f1ff;
    color: #2465bd;
}

.status--abgeschlossen {
    background: #e6f6ef;
    color: #188257;
}

.status--archiviert {
    background: #edf0f4;
    color: #697486;
}


/* ============================================================
   DONUT
   ============================================================ */

.progress-panel {
    padding-bottom: 22px;
}

.donut {
    --size: 150px;

    width: var(--size);
    height: var(--size);

    margin: 28px auto 12px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--blue)
            calc(var(--progress) * 1%),
            #e9edf4 0
        );
}

.donut::before {
    content: "";

    position: absolute;
}

.donut-inner {
    width: 112px;
    height: 112px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: white;
}

.donut-inner strong {
    font-size: 27px;
}

.donut-inner span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}


/* ============================================================
   ACTIVITY
   ============================================================ */

.activity-list {
    padding: 5px 20px 18px;
}

.activity-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 11px;

    padding: 13px 0;

    border-bottom: 1px solid #edf0f5;
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 8px;
    height: 8px;

    margin-top: 4px;

    background: var(--blue);
    border-radius: 50%;
}

.activity-item strong {
    font-size: 11px;
}

.activity-item p {
    margin: 4px 0;
    color: #536076;
    font-size: 11px;
    line-height: 1.4;
}

.activity-item small {
    color: #939dae;
    font-size: 10px;
}

.empty-mini {
    padding: 25px 20px;
    color: var(--muted);
    font-size: 12px;
}


/* ============================================================
   CATEGORIES
   ============================================================ */

.categories-panel {
    margin-bottom: 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;

    padding: 18px 20px 22px;
}

.category-card {
    min-height: 84px;

    display: flex;
    align-items: center;
    gap: 13px;

    padding: 15px;

    border: 1px solid var(--line);
    border-radius: 11px;

    background: #fff;
}

.category-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: #eef4fd;
    color: var(--blue);

    font-size: 19px;
}

.category-card > div:last-child {
    display: flex;
    flex-direction: column;
}

.category-card strong {
    font-size: 12px;
}

.category-card span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.empty-state {
    padding: 45px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-state strong {
    color: var(--text);
}

.empty-state p {
    margin-bottom: 0;
}


/* ============================================================
   LOGIN
   ============================================================ */

.login-body {
    background: var(--navy);
}

.login-shell {
    min-height: 100vh;

    display: grid;
    grid-template-columns: 1.05fr .95fr;
}

.login-brand {
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 54px 70px 70px;

    overflow: hidden;

    color: white;

    background:
        radial-gradient(
            circle at 30% 80%,
            rgba(23,105,210,.32),
            transparent 38%
        ),
        linear-gradient(
            145deg,
            #08182f 0%,
            #102c54 100%
        );
}

.login-logo {
    position: relative;
    z-index: 1;
}

.login-copy {
    position: relative;
    z-index: 1;

    max-width: 620px;
}

.eyebrow {
    color: #5fa1f1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.login-copy h1 {
    margin: 18px 0;

    font-size: clamp(35px, 4.2vw, 62px);
    line-height: 1.04;
    letter-spacing: -2px;
}

.login-copy p {
    max-width: 520px;

    color: rgba(255,255,255,.68);

    font-size: 16px;
    line-height: 1.6;
}

.login-panel {
    display: grid;
    place-items: center;

    padding: 40px;

    background: #f4f7fb;
}

.login-card {
    width: min(420px, 100%);

    padding: 38px;

    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;

    box-shadow:
        0 24px 70px rgba(14,35,65,.14);
}

.login-card-header {
    margin-bottom: 28px;
}

.login-card-header h2 {
    margin: 10px 0 8px;
    font-size: 28px;
}

.login-card-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.form-field {
    margin-bottom: 17px;
}

.form-field label {
    display: block;

    margin-bottom: 7px;

    color: #46536a;
    font-size: 12px;
    font-weight: 600;
}

.form-field input {
    width: 100%;
    height: 44px;

    padding: 0 12px;

    border: 1px solid #dce2eb;
    border-radius: 8px;

    outline: 0;

    background: #fbfcfe;
}

.form-field input:focus {
    border-color: #5893dc;

    box-shadow:
        0 0 0 3px rgba(23,105,210,.09);
}

.login-button {
    width: 100%;
    height: 46px;

    margin-top: 8px;

    border: 0;
    border-radius: 8px;

    background: var(--blue);
    color: white;

    cursor: pointer;

    font-weight: 700;
}

.login-button:hover {
    background: #125ebd;
}

.form-error {
    margin-bottom: 18px;
    padding: 10px 12px;

    border-radius: 7px;

    background: #fff0f0;
    color: #a63737;

    font-size: 12px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-main {
        grid-template-columns: 1fr;
    }

    .dashboard-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 850px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .main-column {
        width: 100%;
    }

    .topbar {
        padding: 0 18px;
    }

    .global-search {
        display: none;
    }

    .content {
        padding: 20px;
    }

    .page-heading {
        align-items: flex-start;
        gap: 20px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-side {
        display: flex;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        display: none;
    }
}


/* ============================================================
   FUNCTIONAL PORTAL ELEMENTS
   ============================================================ */

a.primary-button,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-decoration: none;
    cursor: pointer;
}

.secondary-button {
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 16px;

    border: 1px solid #d8e0ea;
    border-radius: 9px;

    background: #fff;
    color: #34445c;

    text-decoration: none;
    cursor: pointer;

    font-weight: 600;
}

.secondary-button:hover {
    background: #f5f7fa;
}

.notification {
    color: #32445d;
    text-decoration: none;
}

.search-submit {
    padding: 0;
    border: 0;
    background: transparent;
    color: #8994a8;
    cursor: pointer;
}

.table-link {
    color: #143a67;
    font-weight: 700;
    text-decoration: none;
}

.table-link:hover {
    color: var(--blue);
    text-decoration: underline;
}

.portal-messages {
    margin-bottom: 18px;
}

.portal-message {
    padding: 12px 15px;

    border: 1px solid #cfe0f6;
    border-radius: 9px;

    background: #eef5fd;
    color: #174f92;

    font-size: 13px;
}

.form-panel {
    padding: 25px;
}

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

.portal-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.portal-field label {
    font-size: 12px;
    font-weight: 700;
    color: #46546a;
}

.portal-input {
    width: 100%;
    min-height: 42px;

    padding: 8px 11px;

    border: 1px solid #d8e0ea;
    border-radius: 8px;

    background: #fff;
    color: var(--text);

    outline: 0;
}

.portal-input:focus {
    border-color: #5f9be6;

    box-shadow:
        0 0 0 3px rgba(23,105,210,.08);
}

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

.field-error {
    color: #b23e3e;
    font-size: 11px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 28px;
}

.list-filter {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 220px auto;
    gap: 10px;

    padding: 17px;

    border-bottom: 1px solid var(--line);
}

.detail-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;

    margin-bottom: 20px;
}

.summary-card {
    padding: 17px 19px;

    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-card span {
    color: var(--muted);
    font-size: 11px;
}

.summary-card strong {
    font-size: 17px;
}

.checklist-section {
    margin-bottom: 18px;
}

.checklist-items {
    padding: 0 20px;
}

.checklist-item {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(350px, 1.2fr);
    gap: 25px;

    padding: 20px 0;

    border-bottom: 1px solid #edf0f5;
}

.checklist-item:last-child {
    border-bottom: 0;
}

.checklist-label strong {
    font-size: 13px;
}

.checklist-label p {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.5;
}

.required-mark {
    display: inline-block;

    margin-left: 8px;
    padding: 3px 6px;

    border-radius: 20px;

    background: #fff1e4;
    color: #b66b19;

    font-size: 9px;
    font-weight: 700;
}

.checklist-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.completed-control {
    display: flex;
    align-items: center;
    gap: 7px;

    color: #516076;

    font-size: 11px;
    font-weight: 600;
}

.info-box {
    padding: 12px 14px;

    border-radius: 8px;

    background: #eef5fd;
    color: #265d9c;

    font-size: 12px;
}

.sticky-actions {
    position: sticky;
    bottom: 0;

    z-index: 8;

    display: flex;
    justify-content: flex-end;
    gap: 10px;

    padding: 15px 0;

    background: rgba(244,247,251,.95);
}

.knowledge-panel {
    padding: 28px;
}

.knowledge-panel h2 {
    margin-top: 0;
}

.knowledge-panel p {
    max-width: 750px;

    color: var(--muted);
    line-height: 1.6;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}

.search-result {
    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 15px 18px;

    border-bottom: 1px solid #edf0f5;

    color: var(--text);
    text-decoration: none;
}

.search-result strong {
    font-size: 12px;
}

.search-result span {
    color: var(--muted);
    font-size: 11px;
}

.search-result:hover {
    background: #fafcff;
}

@media (max-width: 900px) {
    .form-grid,
    .detail-summary,
    .search-results {
        grid-template-columns: 1fr;
    }

    .checklist-item {
        grid-template-columns: 1fr;
    }

    .list-filter {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   TEMPLATE / FORM BUILDER
   ============================================================ */

.heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heading-actions form,
.builder-actions form {
    margin: 0;
}

.builder-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;

    margin-bottom: 20px;
}

.builder-list {
    padding: 14px;
}

.builder-item {
    display: grid;
    grid-template-columns:
        34px
        55px
        minmax(0, 1fr)
        auto;

    gap: 12px;

    align-items: center;

    min-height: 92px;

    margin-bottom: 9px;
    padding: 13px;

    border: 1px solid #e2e8f0;
    border-radius: 11px;

    background: white;

    transition:
        box-shadow .15s ease,
        transform .15s ease,
        opacity .15s ease;
}

.builder-item:last-child {
    margin-bottom: 0;
}

.builder-item[draggable="true"] {
    cursor: grab;
}

.builder-item.dragging {
    opacity: .45;
    transform: scale(.995);

    box-shadow:
        0 12px 30px
        rgba(20, 40, 70, .15);
}

.drag-handle {
    color: #8c98aa;

    font-size: 22px;

    text-align: center;

    user-select: none;
}

.builder-position {
    color: #8b96a8;

    font-size: 11px;
    font-weight: 700;

    text-align: center;
}

.builder-content {
    min-width: 0;
}

.builder-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.builder-title-row strong {
    font-size: 13px;
}

.builder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: 7px;

    color: var(--muted);

    font-size: 10px;
}

.builder-content p {
    margin: 7px 0 0;

    color: #657188;

    font-size: 11px;
    line-height: 1.45;
}

.field-type-badge {
    padding: 3px 7px;

    border-radius: 20px;

    background: #edf4fd;
    color: #2865ac;

    font-size: 9px;
    font-weight: 700;
}

.builder-actions {
    display: flex;
    gap: 7px;
}

.small-button {
    min-height: 32px;
    height: 32px;

    padding: 0 10px;

    font-size: 10px;
}

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 12px;

    border: 1px solid #f1cccc;
    border-radius: 8px;

    background: #fff5f5;
    color: #b43d3d;

    cursor: pointer;

    font-weight: 600;
}

.danger-button:hover {
    background: #ffecec;
}

@media (max-width: 1000px) {
    .builder-item {
        grid-template-columns:
            30px
            minmax(0, 1fr);
    }

    .builder-position {
        display: none;
    }

    .builder-actions {
        grid-column: 2;

        justify-content: flex-start;
    }

    .builder-summary {
        grid-template-columns: 1fr;
    }

    .heading-actions {
        flex-wrap: wrap;
    }
}


/* ============================================================
   WISSENSDATENBANK / ANYTHINGLLM
   ============================================================ */

.knowledge-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;

    width: 100%;
}


/* ------------------------------------------------------------
   GEMEINSAME KARTENSTRUKTUR
   ------------------------------------------------------------ */

.knowledge-query-panel,
.knowledge-answer,
.knowledge-sources,
.knowledge-error {
    width: 100%;
    max-width: none;

    overflow: hidden;
}

.knowledge-query-panel .panel-header,
.knowledge-answer .panel-header,
.knowledge-sources .panel-header {
    padding: 18px 22px;

    border-bottom: 1px solid #e5eaf1;
}

.knowledge-query-panel .panel-header h2,
.knowledge-answer .panel-header h2,
.knowledge-sources .panel-header h2 {
    margin: 0 0 3px;

    font-size: 15px;
    font-weight: 700;
}

.knowledge-query-panel .panel-header p,
.knowledge-answer .panel-header p,
.knowledge-sources .panel-header p {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.45;
}


/* ------------------------------------------------------------
   SUCHE
   ------------------------------------------------------------ */

.knowledge-query-panel form {
    padding: 18px 22px 20px;
}

.knowledge-query-panel .portal-field {
    margin: 0;
}

.knowledge-query-panel .portal-field label {
    display: block;

    margin-bottom: 7px;

    font-size: 11px;
    font-weight: 700;
}

.knowledge-question {
    display: block;

    width: 100%;
    min-height: 105px;
    max-height: 260px;

    padding: 13px 14px;

    resize: vertical;

    font-family: inherit;
    font-size: 13px;
    line-height: 1.55;
}

.knowledge-actions {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 14px;
}

.knowledge-actions button:disabled {
    opacity: .65;
    cursor: wait;
}


/* ------------------------------------------------------------
   ANTWORT
   ------------------------------------------------------------ */

.knowledge-answer {
    position: relative;

    border-left: 3px solid #1769d2;
}

.knowledge-answer .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding-left: 20px;
}

.knowledge-answer-text {
    padding: 18px 22px 20px;

    color: #293548;

    font-size: 13px;
    line-height: 1.7;
}

.knowledge-answer-text p {
    margin: 0 0 12px;
}

.knowledge-answer-text p:last-child {
    margin-bottom: 0;
}

.knowledge-source-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding: 4px 9px;

    border-radius: 20px;

    background: #edf4fd;
    color: #2865ac;

    white-space: nowrap;

    font-size: 10px;
    font-weight: 700;
}


/* ------------------------------------------------------------
   QUELLEN
   ------------------------------------------------------------ */

.knowledge-sources {
    padding-bottom: 20px;
}

.source-list {
    display: grid;
    gap: 10px;

    padding: 18px 22px 0;
}

.source-card {
    padding: 14px 16px;

    border: 1px solid #e2e8f0;
    border-radius: 9px;

    background: #fbfcfe;
}

.source-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.source-card-header strong {
    color: #17243a;

    font-size: 12px;
}

.source-snippet {
    margin-top: 10px;

    color: #637086;

    font-size: 11px;
    line-height: 1.55;
}


/* ------------------------------------------------------------
   KEINE QUELLE
   ------------------------------------------------------------ */

.knowledge-no-sources {
    margin: 18px 22px 0;
    padding: 15px 16px;

    border: 1px dashed #d7dee9;
    border-radius: 9px;

    background: #fafbfd;
}

.knowledge-no-sources strong {
    display: block;

    margin-bottom: 4px;

    color: #223047;

    font-size: 12px;
}

.knowledge-no-sources p {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.5;
}


/* ------------------------------------------------------------
   FEHLER
   ------------------------------------------------------------ */

.knowledge-error {
    padding: 18px 22px;

    border-left: 3px solid #c95454;

    background: #fffafa;
}

.knowledge-error h2 {
    margin: 0 0 5px;

    font-size: 14px;
}

.knowledge-error p {
    margin: 0;

    color: #704646;

    font-size: 12px;
}


/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 800px) {

    .knowledge-query-panel .panel-header,
    .knowledge-answer .panel-header,
    .knowledge-sources .panel-header,
    .knowledge-query-panel form,
    .knowledge-answer-text {
        padding-left: 16px;
        padding-right: 16px;
    }

    .knowledge-no-sources,
    .source-list {
        margin-left: 0;
        margin-right: 0;

        padding-left: 16px;
        padding-right: 16px;
    }

    .knowledge-no-sources {
        margin-left: 16px;
        margin-right: 16px;
    }

    .knowledge-actions,
    .source-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .knowledge-answer .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ============================================================
   CHECKLISTEN-BUILDER – ABSCHNITTE
   ============================================================ */

.section-builder {
    display: flex;
    flex-direction: column;
    gap: 18px;
}


.builder-summary {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
}


.builder-section {
    overflow: hidden;

    border: 1px solid #dfe5ee;
    border-radius: 12px;

    background: #ffffff;

    box-shadow:
        0 2px 8px
        rgba(30, 50, 80, .04);

    transition:
        opacity .15s ease,
        box-shadow .15s ease;
}


.builder-section.section-dragging {
    opacity: .55;

    box-shadow:
        0 14px 35px
        rgba(20, 45, 80, .16);
}


.builder-section-header {
    display: grid;

    grid-template-columns:
        28px
        32px
        minmax(0, 1fr)
        auto
        auto;

    align-items: center;

    gap: 11px;

    min-height: 66px;

    padding: 12px 15px;

    border-bottom:
        1px solid #e7ecf2;

    background: #f8fafc;
}


.section-drag-handle,
.point-drag-handle {
    display: flex;

    align-items: center;
    justify-content: center;

    color: #8996a8;

    font-size: 18px;

    cursor: grab;

    user-select: none;
}


.section-drag-handle:active,
.point-drag-handle:active {
    cursor: grabbing;
}


.builder-section-number {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    border-radius: 7px;

    background: #e9f2fd;
    color: #1769d2;

    font-size: 11px;
    font-weight: 800;
}


.builder-section-heading {
    min-width: 0;
}


.builder-section-heading h2 {
    margin: 0;

    color: #1c2a40;

    font-size: 13px;
    font-weight: 750;
}


.builder-section-heading p {
    margin: 4px 0 0;

    color: #778397;

    font-size: 10px;
    line-height: 1.4;
}


.builder-section-meta {
    display: flex;

    align-items: center;

    gap: 7px;

    color: #778397;

    white-space: nowrap;

    font-size: 10px;
}


.builder-section-actions {
    display: flex;

    align-items: center;

    gap: 6px;
}


.builder-section-actions form,
.builder-actions form {
    margin: 0;
}


.section-point-list {
    min-height: 55px;

    padding: 10px 12px;

    background: #ffffff;
}


.section-point-list .builder-item {
    grid-template-columns:
        28px
        46px
        minmax(0, 1fr)
        auto;

    min-height: 74px;

    margin-bottom: 8px;

    padding: 11px 12px;
}


.section-point-list .builder-item:last-of-type {
    margin-bottom: 0;
}


.section-point-list .builder-item.dragging {
    opacity: .45;

    box-shadow:
        0 10px 28px
        rgba(20, 45, 80, .14);
}


.section-empty {
    padding: 17px;

    border: 1px dashed #d7dee8;
    border-radius: 8px;

    background: #fafbfd;

    color: #8b96a6;

    text-align: center;

    font-size: 10px;
}


.section-empty[hidden] {
    display: none;
}


.builder-section-footer {
    padding: 9px 14px 11px;

    border-top:
        1px solid #edf0f4;

    background: #fbfcfe;
}


.section-add-element {
    display: inline-flex;

    align-items: center;

    color: #1769d2;

    font-size: 10px;
    font-weight: 700;

    text-decoration: none;
}


.section-add-element:hover {
    text-decoration: underline;
}


.builder-bottom-action {
    margin-top: 18px;

    text-align: center;
}


@media (max-width: 1000px) {

    .builder-summary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .builder-section-header {
        grid-template-columns:
            28px
            32px
            minmax(0, 1fr);
    }


    .builder-section-meta,
    .builder-section-actions {
        grid-column: 3;
    }


    .section-point-list .builder-item {
        grid-template-columns:
            28px
            minmax(0, 1fr);
    }


    .section-point-list .builder-position {
        display: none;
    }


    .section-point-list .builder-actions {
        grid-column: 2;
    }
}


@media (max-width: 650px) {

    .builder-summary {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   VORGANG – STRUKTURBAUSTEINE
   ============================================================ */

.checklist-item:has(.checklist-layout-heading),
.checklist-item:has(.checklist-layout-divider),
.checklist-item:has(.checklist-layout-warning) {
    grid-template-columns: 1fr;
}

.checklist-item:has(.checklist-layout-heading)
.checklist-label,
.checklist-item:has(.checklist-layout-divider)
.checklist-label,
.checklist-item:has(.checklist-layout-warning)
.checklist-label {
    display: none;
}

.checklist-item:has(.checklist-layout-heading)
.checklist-control,
.checklist-item:has(.checklist-layout-divider)
.checklist-control,
.checklist-item:has(.checklist-layout-warning)
.checklist-control {
    width: 100%;
}


.checklist-layout-heading {
    padding: 8px 0 2px;
}

.checklist-layout-heading h3 {
    margin: 0;

    color: #14253d;

    font-size: 17px;
    font-weight: 750;
}

.checklist-layout-heading p {
    margin: 5px 0 0;

    color: #68778c;

    font-size: 12px;
    line-height: 1.5;
}


.checklist-layout-divider {
    width: 100%;
    height: 1px;

    margin: 9px 0;

    background: #dce4ee;
}


.checklist-layout-warning {
    display: grid;

    grid-template-columns: 30px minmax(0, 1fr);

    gap: 10px;

    padding: 12px 13px;

    border: 1px solid #efd49a;
    border-radius: 8px;

    background: #fff9eb;
    color: #624b1c;
}

.checklist-layout-warning-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    border-radius: 50%;

    background: #ffe7ad;
    color: #a56600;

    font-weight: 800;
}

.checklist-layout-warning strong {
    color: #634715;
}

.checklist-layout-warning p {
    margin: 4px 0 0;

    color: #735b2c;

    font-size: 12px;
    line-height: 1.5;
}


/* ============================================================
   VORGANG – KONFIGURIERTE EINGABEFELDER
   ============================================================ */

.runtime-checkbox {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    min-height: 38px;

    padding: 0 11px;

    border: 1px solid #d9e2ed;
    border-radius: 7px;

    background: #fff;

    color: #33455d;

    font-size: 12px;

    cursor: pointer;
}

.runtime-checkbox input {
    width: 17px;
    height: 17px;

    margin: 0;

    accent-color: #1769d2;
}


.runtime-number-field {
    display: flex;
    align-items: stretch;

    width: 100%;
}

.runtime-number-field .portal-input {
    min-width: 0;

    flex: 1;

    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.runtime-number-unit {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 48px;

    padding: 0 11px;

    border: 1px solid #d9e2ed;
    border-left: 0;

    border-radius:
        0
        7px
        7px
        0;

    background: #f4f7fa;
    color: #58697f;

    font-size: 11px;
    font-weight: 650;
}


.runtime-field-hint {
    display: block;

    margin-top: 5px;

    color: #77869a;

    font-size: 10px;
}


/* ============================================================
   WISSENSBAUSTEINE – DETAIL
   ============================================================ */

.knowledge-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 7px;

    color: #748298;

    font-size: 11px;
}

.knowledge-heading-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.knowledge-content {
    color: #2f4056;

    font-size: 14px;
    line-height: 1.7;
}

.knowledge-content p:first-child {
    margin-top: 0;
}

.knowledge-content p:last-child {
    margin-bottom: 0;
}

.knowledge-state-form {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 14px;

    align-items: end;

    padding: 14px 0;

    border-bottom: 1px solid #e6ebf1;
}

.knowledge-state-form:last-child {
    border-bottom: 0;
}

.knowledge-state-action {
    padding-bottom: 1px;
}

.knowledge-document-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 8px 20px;

    margin-top: 14px;

    color: #748298;

    font-size: 11px;
}

.knowledge-empty {
    padding: 20px;

    color: #68798e;

    text-align: center;
}

.knowledge-empty p {
    margin-bottom: 0;
}

.knowledge-archive-notice {
    padding: 16px;

    border: 1px solid #d8dee8;
    border-radius: 8px;

    background: #f6f8fa;
}

.knowledge-archive-notice p {
    margin-bottom: 0;

    color: #68798e;
}


@media (max-width: 800px) {

    .knowledge-state-form {
        grid-template-columns: 1fr;
    }

    .knowledge-state-action {
        padding-bottom: 0;
    }
}


/* ============================================================
   WISSENSBAUSTEINE – VERSIONEN
   ============================================================ */

.knowledge-version-info {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.knowledge-version-info > div {
    display: flex;
    flex-direction: column;

    gap: 5px;

    min-width: 0;
}

.knowledge-version-info strong {
    color: #69798d;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: .04em;
}

.knowledge-version-info span {
    color: #2f4056;

    font-size: 13px;
}


@media (max-width: 900px) {

    .knowledge-version-info {
        grid-template-columns:
            1fr;
    }

}


/* NETSTYLE WISSENSBAUSTEINE LISTE START */

.knowledge-page-heading {
    margin-bottom: 20px;
}

.knowledge-toolbar-panel {
    margin-bottom: 18px;
    padding: 14px;

    border: 1px solid #e3e9f0;
    border-radius: 11px;

    background: #ffffff;

    box-shadow:
        0 4px 16px rgba(26, 45, 71, .035);
}

.knowledge-toolbar {
    display: flex;
    align-items: center;

    gap: 10px;

    width: 100%;
}

.knowledge-search {
    position: relative;

    flex: 1 1 460px;

    min-width: 280px;
}

.knowledge-search-icon {
    position: absolute;
    top: 50%;
    left: 13px;

    transform: translateY(-50%);

    color: #8190a3;

    font-size: 17px;

    pointer-events: none;
}

.knowledge-search input {
    width: 100%;
    height: 42px;

    padding: 0 14px 0 39px;

    border: 1px solid #dbe3ec;
    border-radius: 8px;

    background: #f9fbfd;

    color: #20354e;

    font: inherit;

    outline: none;
}

.knowledge-search input:focus {
    border-color: #176fd1;
    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(23, 111, 209, .08);
}

.knowledge-filter-select {
    flex: 0 0 200px;

    height: 42px;

    padding: 0 34px 0 12px;

    border: 1px solid #dbe3ec;
    border-radius: 8px;

    background: #ffffff;

    color: #34485f;

    font: inherit;

    outline: none;
}

.knowledge-filter-select:focus {
    border-color: #176fd1;
}

.knowledge-filter-button {
    height: 42px;
}

.knowledge-results-panel {
    padding-top: 4px;
    padding-bottom: 4px;
}

.knowledge-card {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    gap: 24px;

    align-items: center;

    padding: 19px 3px;

    border-bottom: 1px solid #e9edf3;
}

.knowledge-card:last-child {
    border-bottom: 0;
}

.knowledge-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 7px;
}

.knowledge-category,
.knowledge-status,
.knowledge-version {
    display: inline-flex;
    align-items: center;

    min-height: 22px;

    padding: 3px 8px;

    border-radius: 5px;

    font-size: 10px;
    font-weight: 700;

    line-height: 1;
}

.knowledge-category {
    background: #edf4fc;
    color: #35658f;
}

.knowledge-version {
    background: #f2f4f7;
    color: #6d7988;
}

.knowledge-status-entwurf {
    background: #fff5dc;
    color: #936b13;
}

.knowledge-status-veroeffentlicht {
    background: #e9f6ed;
    color: #357249;
}

.knowledge-status-archiviert {
    background: #f0f1f3;
    color: #747b84;
}

.knowledge-card h2 {
    margin: 0 0 6px;

    font-size: 17px;
    line-height: 1.3;
}

.knowledge-card h2 a {
    color: #132a46;
    text-decoration: none;
}

.knowledge-card h2 a:hover {
    color: #176fd1;
}

.knowledge-card p {
    max-width: 900px;

    margin: 0;

    color: #69798c;

    font-size: 13px;
    line-height: 1.55;
}

.knowledge-card-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 10px;

    min-width: 150px;
}

.knowledge-card-actions > span {
    color: #8592a2;

    font-size: 11px;

    white-space: nowrap;
}

.knowledge-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 330px;

    padding: 50px 30px;

    border: 1px solid #e3e9f0;
    border-radius: 11px;

    background: #ffffff;

    text-align: center;

    box-shadow:
        0 4px 18px rgba(26, 45, 71, .035);
}

.knowledge-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 58px;
    height: 58px;

    margin-bottom: 18px;

    border-radius: 14px;

    background: #edf4fc;

    color: #176fd1;

    font-size: 25px;
}

.knowledge-empty-state h2 {
    margin: 0 0 8px;

    color: #1b304a;

    font-size: 19px;
}

.knowledge-empty-state p {
    max-width: 520px;

    margin: 0 0 22px;

    color: #748397;

    font-size: 13px;
    line-height: 1.6;
}

.knowledge-pagination {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 15px;

    margin-top: 18px;
}


@media (max-width: 1050px) {

    .knowledge-toolbar {
        flex-wrap: wrap;
    }

    .knowledge-search {
        flex-basis: 100%;
    }

    .knowledge-filter-select {
        flex: 1 1 180px;
    }

}


@media (max-width: 700px) {

    .knowledge-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .knowledge-search {
        min-width: 0;
    }

    .knowledge-filter-select {
        flex: none;
        width: 100%;
    }

    .knowledge-card {
        grid-template-columns: 1fr;
    }

    .knowledge-card-actions {
        align-items: flex-start;
    }

}

/* NETSTYLE WISSENSBAUSTEINE LISTE ENDE */



/* ============================================================
   VORGANG – EINGEFRORENE ANLEITUNG
   ============================================================ */

.snapshot-knowledge-page {
    max-width: 980px;
    margin: 0 auto;
}

.snapshot-knowledge-back {
    margin-bottom: 18px;
}

.snapshot-knowledge-back a {
    color: #44617f;
    text-decoration: none;
    font-size: 13px;
}

.snapshot-knowledge-back a:hover {
    text-decoration: underline;
}

.snapshot-knowledge-header {
    padding: 25px 28px;

    border: 1px solid #dde6ef;
    border-radius: 12px;

    background: #ffffff;
}

.snapshot-knowledge-eyebrow {
    margin-bottom: 7px;

    color: #2872ba;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .06em;
    text-transform: uppercase;
}

.snapshot-knowledge-header h1 {
    margin: 0;

    color: #17314f;

    font-size: 25px;
    line-height: 1.25;
}

.snapshot-knowledge-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 8px 18px;

    margin-top: 11px;

    color: #718196;

    font-size: 12px;
}

.snapshot-knowledge-summary {
    margin-top: 14px;
    padding: 16px 20px;

    border-left: 3px solid #4e8dcc;
    border-radius: 7px;

    background: #f5f9fd;

    color: #40566e;

    font-size: 14px;
    line-height: 1.55;
}

.snapshot-knowledge-content {
    margin-top: 14px;
    padding: 26px 28px;

    border: 1px solid #e1e7ee;
    border-radius: 12px;

    background: #ffffff;

    color: #273b51;

    font-size: 14px;
    line-height: 1.7;
}

.snapshot-knowledge-footer {
    display: flex;
    flex-direction: column;

    gap: 3px;

    margin-top: 14px;
    padding: 13px 17px;

    border: 1px solid #e1e7ee;
    border-radius: 8px;

    background: #f8fafc;

    color: #728196;

    font-size: 11px;
}

.snapshot-knowledge-footer strong {
    color: #40566e;
}


/* ============================================================
   VORGANG – EINGEFRORENE ANLEITUNG
   ============================================================ */

.snapshot-knowledge-page {
    max-width: 980px;
    margin: 0 auto;
}

.snapshot-knowledge-back {
    margin-bottom: 18px;
}

.snapshot-knowledge-back a {
    color: #44617f;
    text-decoration: none;
    font-size: 13px;
}

.snapshot-knowledge-back a:hover {
    text-decoration: underline;
}

.snapshot-knowledge-header {
    padding: 25px 28px;

    border: 1px solid #dde6ef;
    border-radius: 12px;

    background: #ffffff;
}

.snapshot-knowledge-eyebrow {
    margin-bottom: 7px;

    color: #2872ba;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .06em;
    text-transform: uppercase;
}

.snapshot-knowledge-header h1 {
    margin: 0;

    color: #17314f;

    font-size: 25px;
    line-height: 1.25;
}

.snapshot-knowledge-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 8px 18px;

    margin-top: 11px;

    color: #718196;

    font-size: 12px;
}

.snapshot-knowledge-summary {
    margin-top: 14px;
    padding: 16px 20px;

    border-left: 3px solid #4e8dcc;
    border-radius: 7px;

    background: #f5f9fd;

    color: #40566e;

    font-size: 14px;
    line-height: 1.55;
}

.snapshot-knowledge-content {
    margin-top: 14px;
    padding: 26px 28px;

    border: 1px solid #e1e7ee;
    border-radius: 12px;

    background: #ffffff;

    color: #273b51;

    font-size: 14px;
    line-height: 1.7;
}

.snapshot-knowledge-footer {
    display: flex;
    flex-direction: column;

    gap: 3px;

    margin-top: 14px;
    padding: 13px 17px;

    border: 1px solid #e1e7ee;
    border-radius: 8px;

    background: #f8fafc;

    color: #728196;

    font-size: 11px;
}

.snapshot-knowledge-footer strong {
    color: #40566e;
}


/* ============================================================
   NETSTYLE RUNTIME ANLEITUNG START
   ============================================================ */

.checklist-item--anleitung .checklist-label {
    display: none;
}

.checklist-item--anleitung .checklist-control {
    grid-column: 1 / -1;
    width: 100%;
}

.runtime-knowledge-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;

    width: 100%;
    box-sizing: border-box;

    padding: 17px 18px;

    border: 1px solid #d7e3ef;
    border-radius: 10px;

    background: #f8fbfe;
}

.runtime-knowledge-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    border-radius: 9px;

    background: #e7f1fb;
    color: #176bb8;

    font-size: 21px;
    font-weight: 700;
}

.runtime-knowledge-card-body {
    min-width: 0;
}

.runtime-knowledge-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;

    margin-bottom: 5px;

    color: #657b92;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .035em;
    text-transform: uppercase;
}

.runtime-knowledge-card h3 {
    margin: 0;

    color: #18334f;

    font-size: 15px;
    line-height: 1.35;
}

.runtime-knowledge-source-title {
    margin-top: 4px;

    color: #45627f;

    font-size: 12px;
    font-weight: 600;
}

.runtime-knowledge-help {
    margin: 7px 0 0;

    color: #6e7f91;

    font-size: 12px;
    line-height: 1.45;
}

.runtime-knowledge-summary {
    margin: 8px 0 0;

    color: #40566e;

    font-size: 12px;
    line-height: 1.5;
}

.runtime-knowledge-actions {
    display: flex;

    margin-top: 12px;
}

.runtime-knowledge-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    text-decoration: none;
}

@media (max-width: 650px) {

    .runtime-knowledge-card {
        grid-template-columns: 1fr;
    }

}

/* NETSTYLE RUNTIME ANLEITUNG ENDE */


/* ============================================================
   Runtime – geschützte Bildvorschau
   ============================================================ */

.runtime-image-preview {
    margin-top: 0.85rem;
}

.runtime-image-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 8px;
}

.runtime-image-preview-actions {
    margin-top: 0.45rem;
    font-size: 0.875rem;
}


/* ============================================================
   NETSTYLE CHECKLISTEN-RUNTIME V2
   ============================================================ */


/* ------------------------------------------------------------
   Einzelner Prüfpunkt
   ------------------------------------------------------------ */

.checklist-item {
    display: grid;
    grid-template-columns:
        minmax(220px, 300px)
        minmax(0, 1fr);

    column-gap: 32px;
    row-gap: 10px;

    align-items: start;

    padding: 20px 18px;

    border-bottom: 1px solid #e7edf3;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}

.checklist-item:last-child {
    border-bottom: 0;
}

.checklist-item:hover {
    background: #fbfdff;
}


/* ------------------------------------------------------------
   Linke Seite – Bezeichnung
   ------------------------------------------------------------ */

.checklist-label {
    min-width: 0;
    padding-top: 5px;
}

.checklist-label strong {
    display: inline;

    color: #18334f;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.checklist-label p {
    margin: 6px 0 0;

    color: #718196;

    font-size: 12px;
    line-height: 1.5;
}


/* Pflicht-Badge */

.required-mark {
    display: inline-flex;
    align-items: center;

    min-height: 20px;

    margin-left: 7px;
    padding: 2px 7px;

    border: 1px solid #f2d5ad;
    border-radius: 999px;

    background: #fff8ed;

    color: #a45c08;

    font-size: 9px;
    font-weight: 700;

    line-height: 1;
    letter-spacing: .025em;
    text-transform: uppercase;

    vertical-align: 1px;
}


/* ------------------------------------------------------------
   Rechte Seite – Eingabe
   ------------------------------------------------------------ */

.checklist-control {
    width: 100%;
    max-width: 820px;
    min-width: 0;
}


/* ------------------------------------------------------------
   Allgemeine Eingabefelder
   ------------------------------------------------------------ */

.checklist-control .portal-input {
    width: 100%;
    box-sizing: border-box;

    min-height: 42px;

    padding: 9px 12px;

    border: 1px solid #d7e0e9;
    border-radius: 8px;

    background: #ffffff;

    color: #233a54;

    font: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}

.checklist-control .portal-input:hover {
    border-color: #bdcbd9;
}

.checklist-control .portal-input:focus {
    border-color: #176fd1;

    background: #ffffff;

    box-shadow:
        0 0 0 3px rgba(23, 111, 209, .08);
}

.checklist-control .portal-input::placeholder {
    color: #98a5b4;
}


/* Textarea */

.checklist-control .portal-textarea {
    min-height: 108px;
    resize: vertical;
    line-height: 1.5;
}


/* ------------------------------------------------------------
   Checkbox / Bestätigung
   ------------------------------------------------------------ */

.runtime-checkbox {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 42px;
    box-sizing: border-box;

    padding: 9px 12px;

    border: 1px solid #d7e0e9;
    border-radius: 8px;

    background: #f9fbfd;

    color: #334b65;

    font-size: 13px;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background-color .15s ease,
        box-shadow .15s ease;
}

.runtime-checkbox:hover {
    border-color: #bdd0e2;
    background: #f5f9fd;
}

.runtime-checkbox:focus-within {
    border-color: #176fd1;

    box-shadow:
        0 0 0 3px rgba(23, 111, 209, .08);
}

.runtime-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;

    margin: 0 9px 0 0;

    accent-color: #176fd1;
}


/* ------------------------------------------------------------
   Zahl + Einheit
   ------------------------------------------------------------ */

.runtime-number-field {
    display: flex;
    align-items: stretch;

    width: 100%;
}

.runtime-number-field .portal-input {
    flex: 1 1 auto;
}

.runtime-number-unit {
    display: inline-flex;
    align-items: center;

    margin-left: 8px;
    padding: 0 12px;

    border: 1px solid #d7e0e9;
    border-radius: 8px;

    background: #f5f8fb;

    color: #65788e;

    font-size: 12px;
    font-weight: 600;
}


/* ------------------------------------------------------------
   Auswahlfelder
   ------------------------------------------------------------ */

.checklist-control select.portal-input:not([multiple]) {
    cursor: pointer;
}


/* Mehrfachauswahl */

.checklist-control select.portal-input[multiple] {
    min-height: 112px;

    padding: 5px;

    background: #ffffff;
}

.checklist-control select.portal-input[multiple] option {
    margin: 2px 0;
    padding: 8px 10px;

    border-radius: 5px;

    color: #324960;
}


/* ------------------------------------------------------------
   DATEI / BILD Upload
   ------------------------------------------------------------ */

.checklist-control input[type="file"].portal-input {
    min-height: 58px;

    padding: 8px;

    border: 1px dashed #bdcddd;
    border-radius: 9px;

    background: #f8fbfe;

    color: #62758a;

    cursor: pointer;
}

.checklist-control input[type="file"].portal-input:hover {
    border-color: #7eadd9;
    background: #f4f9fd;
}

.checklist-control input[type="file"]::file-selector-button {
    min-height: 38px;

    margin-right: 12px;
    padding: 0 14px;

    border: 1px solid #cbd8e5;
    border-radius: 7px;

    background: #ffffff;

    color: #24415f;

    font: inherit;
    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}

.checklist-control input[type="file"]::file-selector-button:hover {
    border-color: #9fbedb;
    background: #edf5fc;
}

.runtime-field-hint {
    display: block;

    margin-top: 6px;

    color: #7b8b9d;

    font-size: 11px;
    line-height: 1.4;
}


/* ------------------------------------------------------------
   Vorhandene Datei
   ------------------------------------------------------------ */

.checklist-control > a {
    display: inline-flex;
    align-items: center;

    margin-top: 8px;

    color: #176bb8;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
}

.checklist-control > a:hover {
    text-decoration: underline;
}


/* ------------------------------------------------------------
   Bildvorschau
   ------------------------------------------------------------ */

.runtime-image-preview {
    width: fit-content;
    max-width: 100%;

    margin-top: 12px;
    padding: 9px;

    border: 1px solid #dce5ee;
    border-radius: 10px;

    background: #f8fafc;

    box-shadow:
        0 2px 8px rgba(26, 45, 71, .035);
}

.runtime-image-preview > a {
    display: block;
}

.runtime-image-preview img {
    display: block;

    width: auto;
    max-width: 100%;
    max-height: 340px;

    border-radius: 7px;

    object-fit: contain;

    background: #eef2f6;
}

.runtime-image-preview-actions {
    display: flex;
    align-items: center;

    min-height: 28px;

    margin-top: 7px;
    padding: 0 3px;

    font-size: 11px;
}

.runtime-image-preview-actions a {
    color: #176bb8;
    font-weight: 600;
    text-decoration: none;
}

.runtime-image-preview-actions a:hover {
    text-decoration: underline;
}


/* ------------------------------------------------------------
   Anleitung bleibt Full-Width
   ------------------------------------------------------------ */

.checklist-item--anleitung {
    grid-template-columns: 1fr;
}

.checklist-item--anleitung .checklist-control {
    grid-column: 1 / -1;

    max-width: none;
}


/* ------------------------------------------------------------
   Mobile / Tablet
   ------------------------------------------------------------ */

@media (max-width: 1000px) {

    .checklist-item {
        grid-template-columns:
            minmax(190px, 250px)
            minmax(0, 1fr);

        column-gap: 22px;

        padding:
            18px 14px;
    }

}


@media (max-width: 760px) {

    .checklist-item {
        grid-template-columns: 1fr;

        gap: 10px;

        padding:
            16px 12px;
    }

    .checklist-label {
        padding-top: 0;
    }

    .checklist-control {
        max-width: none;
    }

    .runtime-number-field {
        flex-wrap: wrap;
        gap: 7px;
    }

    .runtime-number-unit {
        margin-left: 0;
        min-height: 36px;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2 ENDE */


/* NETSTYLE CHECKLISTEN-RUNTIME V2.1 START */


/* ============================================================
   Mehrfachauswahl
   ============================================================ */

.runtime-multiselect {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(180px, 1fr)
        );

    gap: 8px;

    width: 100%;
}


.runtime-multiselect-option {
    display: flex;
    align-items: center;

    min-height: 42px;
    box-sizing: border-box;

    padding: 9px 12px;

    border: 1px solid #d7e0e9;
    border-radius: 8px;

    background: #ffffff;

    color: #334b65;

    font-size: 13px;
    line-height: 1.35;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background-color .15s ease,
        box-shadow .15s ease;
}


.runtime-multiselect-option:hover {
    border-color: #abc6df;
    background: #f7fbff;
}


.runtime-multiselect-option:focus-within {
    border-color: #176fd1;

    box-shadow:
        0 0 0 3px
        rgba(23, 111, 209, .08);
}


.runtime-multiselect-option:has(
    input:checked
) {
    border-color: #8bb9e3;

    background: #eef6fd;

    box-shadow:
        inset 0 0 0 1px
        rgba(23, 111, 209, .05);
}


.runtime-multiselect-option input[type="checkbox"] {
    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    margin: 0 9px 0 0;

    accent-color: #176fd1;
}


.runtime-multiselect-option span {
    min-width: 0;
}


/* ============================================================
   Erledigt-Schalter
   ============================================================ */

.checklist-control > .completed-control {
    display: flex;
    align-items: center;

    width: fit-content;

    margin-top: 11px;
    margin-left: auto;

    color: #65788d;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
    user-select: none;
}


.checklist-control > .completed-control input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;

    pointer-events: none;
}


.completed-control-switch {
    position: relative;

    display: inline-block;
    flex: 0 0 auto;

    width: 34px;
    height: 19px;

    margin-right: 7px;

    border: 1px solid #c6d2dd;
    border-radius: 999px;

    background: #e7edf3;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}


.completed-control-switch::after {
    content: "";

    position: absolute;

    top: 2px;
    left: 2px;

    width: 13px;
    height: 13px;

    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 1px 3px
        rgba(24, 51, 79, .24);

    transition:
        transform .15s ease;
}


.checklist-control > .completed-control input:checked
+ .completed-control-switch {
    border-color: #176fd1;
    background: #176fd1;
}


.checklist-control > .completed-control input:checked
+ .completed-control-switch::after {
    transform: translateX(15px);
}


.checklist-control > .completed-control input:focus-visible
+ .completed-control-switch {
    box-shadow:
        0 0 0 3px
        rgba(23, 111, 209, .13);
}


.checklist-control > .completed-control:hover
.completed-control-text {
    color: #25486a;
}


/* ============================================================
   Erledigter Prüfpunkt
   ============================================================ */

.checklist-item--done {
    background: #fafcfd;
}


.checklist-item--done:hover {
    background: #f7fafc;
}


.checklist-item--done
.checklist-label strong {
    color: #607489;
}


.checklist-item--done
.completed-control-text {
    color: #176bb8;

    font-weight: 700;
}


/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 760px) {

    .runtime-multiselect {
        grid-template-columns: 1fr;
    }

    .checklist-control > .completed-control {
        margin-left: 0;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.1 ENDE */


/* ============================================================
   NETSTYLE CHECKLISTEN-RUNTIME V2.2
   Finale Spaltenaufteilung
   ============================================================ */


/*
 * Gesamte Zeile:
 *
 * Beschreibung        Eingabebereich             Erledigt
 * ca. 36 %            ca. 48–50 %                ca. 14 %
 */

.checklist-item {
    grid-template-columns:
        minmax(340px, 36%)
        minmax(0, 1fr);

    column-gap: 24px;
}


/* Beschreibung erhält bewusst mehr Raum */

.checklist-label {
    padding-right: 14px;
}


/*
 * Der bisherige rechte Bereich wird intern noch einmal geteilt:
 *
 * Eingabe | Punkt erledigt
 */

.checklist-control {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        180px;

    column-gap: 20px;

    align-items: start;

    width: 100%;
    max-width: none;
}


/*
 * Alle normalen Feldinhalte stehen in der Eingabespalte.
 */

.checklist-control > * {
    grid-column: 1;
}


/*
 * "Punkt erledigt" steht auf derselben Höhe
 * ganz rechts.
 */

.checklist-control > .completed-control {
    grid-column: 2;
    grid-row: 1;

    align-self: center;
    justify-self: stretch;

    width: 100%;
    min-height: 42px;
    box-sizing: border-box;

    margin: 0;

    padding-left: 18px;

    border-left: 1px solid #e7edf3;

    white-space: nowrap;
}


/*
 * Mehrfachauswahl nutzt die Eingabespalte sinnvoll,
 * ohne übergroße Einzeloptionen.
 */

.runtime-multiselect {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    max-width: 100%;
}


/*
 * Zahl + Einheit ebenfalls nur innerhalb
 * des eigentlichen Eingabebereichs.
 */

.runtime-number-field {
    max-width: 100%;
}


/*
 * DATEI und BILD dürfen die verfügbare
 * Eingabespalte komplett nutzen.
 */

.checklist-item--datei
.checklist-control > input[type="file"],

.checklist-item--bild
.checklist-control > input[type="file"] {
    width: 100%;
}


/* ------------------------------------------------------------
   Elemente ohne "Punkt erledigt"
   ------------------------------------------------------------ */

.checklist-item--anleitung {
    grid-template-columns: 1fr;
}

.checklist-item--anleitung
.checklist-control {
    display: block;

    grid-column: 1 / -1;

    max-width: none;
}


.checklist-item--ueberschrift,
.checklist-item--trennlinie,
.checklist-item--warnung {
    grid-template-columns: 1fr;
}


.checklist-item--ueberschrift
.checklist-control,

.checklist-item--trennlinie
.checklist-control,

.checklist-item--warnung
.checklist-control {
    display: block;

    grid-column: 1 / -1;

    max-width: none;
}


/*
 * INFO besitzt eine Beschreibung, aber keinen
 * Erledigt-Schalter. Deshalb kein leerer
 * rechter Statusbereich.
 */

.checklist-item--info
.checklist-control {
    grid-template-columns: 1fr;
}


/* ------------------------------------------------------------
   Mittlere Bildschirmbreite
   ------------------------------------------------------------ */

@media (max-width: 1150px) {

    .checklist-item {
        grid-template-columns:
            minmax(280px, 34%)
            minmax(0, 1fr);

        column-gap: 20px;
    }

    .checklist-control {
        grid-template-columns:
            minmax(0, 1fr)
            160px;

        column-gap: 16px;
    }

}


/* ------------------------------------------------------------
   Tablet / Smartphone
   ------------------------------------------------------------ */

@media (max-width: 760px) {

    .checklist-item {
        grid-template-columns: 1fr;
    }

    .checklist-control {
        grid-template-columns: 1fr;

        row-gap: 10px;
    }

    .checklist-control > .completed-control {
        grid-column: 1;
        grid-row: auto;

        width: fit-content;

        padding-left: 0;

        border-left: 0;
    }

    .runtime-multiselect {
        grid-template-columns: 1fr;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.2 ENDE */


/* ============================================================
   NETSTYLE CHECKLISTEN-RUNTIME V2.3
   Vorgangskopf / Fortschritt
   ============================================================ */

.page-heading {
    margin-bottom: 18px;
}

.page-heading h1 {
    margin-bottom: 4px;
}

.page-heading p {
    margin: 0;

    color: #728198;

    font-size: 12px;
}


/* Drei kompakte Informationskarten */

.detail-summary {
    gap: 14px;

    margin-bottom: 18px;
}

.summary-card {
    min-height: 76px;
    box-sizing: border-box;

    padding: 14px 16px;

    border: 1px solid #e0e7ef;
    border-radius: 10px;

    background: #ffffff;
}

.summary-card > span,
.summary-card-topline > span {
    color: #74859a;

    font-size: 10px;
    font-weight: 600;
}

.summary-card > strong {
    display: block;

    margin-top: 3px;

    color: #102b49;

    font-size: 15px;
    line-height: 1.25;
}


/* Fortschrittskarte */

.summary-card--progress {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card-topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 12px;
}

.summary-card-topline strong {
    color: #102b49;

    font-size: 15px;
    line-height: 1;
}


/* Fortschrittsbalken */

.runtime-progress {
    overflow: hidden;

    width: 100%;
    height: 6px;

    margin-top: 10px;

    border-radius: 999px;

    background: #eaf0f6;
}

.runtime-progress-fill {
    height: 100%;

    border-radius: inherit;

    background: #176fd1;

    transition: width .25s ease;
}


/* Abschnittskopf etwas kompakter und klarer */

.checklist-section > .panel-header {
    min-height: 56px;
    box-sizing: border-box;

    padding: 15px 18px;

    border-bottom: 1px solid #e3eaf1;
}

.checklist-section > .panel-header h2 {
    margin: 0;

    color: #102b49;

    font-size: 14px;
    font-weight: 700;
}


/* Mobil */

@media (max-width: 760px) {

    .detail-summary {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-height: 68px;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.3 ENDE */


/* NETSTYLE CHECKLISTEN-RUNTIME V2.4 START */


/* ============================================================
   Sticky Aktionsleiste
   ============================================================ */

.sticky-actions {
    position: sticky;

    bottom: 0;
    z-index: 30;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    min-height: 68px;
    box-sizing: border-box;

    margin-top: 18px;
    padding: 12px 0;

    border-top: 1px solid #dfe7ef;

    background:
        linear-gradient(
            to bottom,
            rgba(245, 248, 252, .90),
            rgba(245, 248, 252, .99) 32%
        );

    backdrop-filter: blur(8px);

    box-shadow:
        0 -8px 22px
        rgba(24, 51, 79, .035);
}


/* ============================================================
   Buttons innerhalb der Aktionsleiste
   ============================================================ */

.sticky-actions
.secondary-button,

.sticky-actions
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 96px;
    min-height: 42px;
    box-sizing: border-box;

    padding: 0 17px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 700;

    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background-color .15s ease,
        box-shadow .15s ease,
        transform .08s ease;
}


/* Zurück / Speichern */

.sticky-actions
.secondary-button {
    border: 1px solid #d5dfe9;

    background: #ffffff;

    color: #29435e;
}


.sticky-actions
.secondary-button:hover {
    border-color: #aec3d8;

    background: #f8fbfe;
}


.sticky-actions
.secondary-button:active {
    transform: translateY(1px);
}


/* Vorgang abschließen */

.sticky-actions
.primary-button {
    min-width: 168px;

    border: 1px solid #176fd1;

    background: #176fd1;

    color: #ffffff;

    box-shadow:
        0 3px 9px
        rgba(23, 111, 209, .14);
}


.sticky-actions
.primary-button:hover {
    border-color: #1262bc;

    background: #1262bc;

    box-shadow:
        0 4px 12px
        rgba(23, 111, 209, .19);
}


.sticky-actions
.primary-button:active {
    transform: translateY(1px);
}


/* Tastaturfokus */

.sticky-actions
.secondary-button:focus-visible,

.sticky-actions
.primary-button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px
        rgba(23, 111, 209, .13);
}


/* ============================================================
   Kleine Bildschirme
   ============================================================ */

@media (max-width: 760px) {

    .sticky-actions {
        flex-wrap: wrap;

        gap: 8px;

        min-height: auto;

        padding: 10px 0;
    }

    .sticky-actions
    .secondary-button {
        flex: 1 1 100px;
    }

    .sticky-actions
    .primary-button {
        flex: 1 1 100%;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.4 ENDE */


/* ============================================================
   NETSTYLE CHECKLISTEN-RUNTIME V2.5
   Statusspalte + große BILD-Uploadfläche
   ============================================================ */


/* ------------------------------------------------------------
   Rechte Statusspalte
   ------------------------------------------------------------ */

.checklist-control {
    --runtime-status-width: 165px;
    --runtime-status-gap: 20px;

    position: relative;

    grid-template-columns:
        minmax(0, 1fr)
        var(--runtime-status-width);

    column-gap:
        var(--runtime-status-gap);
}


/*
 * Die Trennlinie gehört zur gesamten Statusspalte
 * und nicht mehr nur zum Schalter.
 */

.checklist-control:has(> .completed-control)::after {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;

    right: calc(
        var(--runtime-status-width)
        + 10px
    );

    width: 1px;

    background: #e4ebf2;

    pointer-events: none;
}


/*
 * Status bleibt immer in der ersten Eingabezeile.
 *
 * Auch bei Langtext, Upload und Bildvorschau
 * wandert der Schalter nicht nach unten.
 */

.checklist-control > .completed-control {
    grid-column: 2;
    grid-row: 1;

    align-self: center;
    justify-self: stretch;

    width: 100%;
    min-height: 42px;

    margin: 0;

    padding: 0 0 0 14px;

    border-left: 0;

    box-sizing: border-box;

    white-space: nowrap;
}


/* ------------------------------------------------------------
   BILD Upload – äußerer Block
   ------------------------------------------------------------ */

.runtime-upload-block {
    grid-column: 1;

    width: 100%;
    min-width: 0;
}


/* ------------------------------------------------------------
   Große Uploadfläche
   ------------------------------------------------------------ */

.runtime-upload-zone {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 128px;

    box-sizing: border-box;

    padding: 20px 24px;

    overflow: hidden;

    border: 1px dashed #a9c8e6;
    border-radius: 10px;

    background:
        linear-gradient(
            180deg,
            #fbfdff 0%,
            #f7fbff 100%
        );

    cursor: pointer;

    transition:
        border-color .15s ease,
        background-color .15s ease,
        box-shadow .15s ease;
}


.runtime-upload-zone:hover {
    border-color: #5f9fd9;

    background:
        linear-gradient(
            180deg,
            #f9fcff 0%,
            #f1f7fd 100%
        );

    box-shadow:
        inset 0 0 0 1px
        rgba(23, 111, 209, .035);
}


.runtime-upload-zone:focus-within {
    border-color: #176fd1;

    box-shadow:
        0 0 0 3px
        rgba(23, 111, 209, .09);
}


/*
 * Das echte File-Input liegt unsichtbar über der
 * gesamten Fläche.
 *
 * Dadurch funktionieren Klick und natives
 * Drag-and-Drop weiterhin direkt im Browser.
 */

.runtime-upload-input {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    margin: 0;

    opacity: 0;

    cursor: pointer;
}


/* ------------------------------------------------------------
   Upload-Symbol
   ------------------------------------------------------------ */

.runtime-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 42px;
    height: 42px;

    margin-right: 14px;

    border: 1px solid #cfe0f0;
    border-radius: 10px;

    background: #edf6fe;

    color: #176fd1;

    font-size: 25px;
    font-weight: 500;

    line-height: 1;
}


/* ------------------------------------------------------------
   Upload-Texte
   ------------------------------------------------------------ */

.runtime-upload-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
}


.runtime-upload-content strong {
    color: #163654;

    font-size: 13px;
    font-weight: 700;

    line-height: 1.35;
}


.runtime-upload-action {
    margin-top: 2px;

    color: #176fd1;

    font-size: 12px;
    font-weight: 600;
}


.runtime-upload-content small {
    margin-top: 5px;

    color: #798a9d;

    font-size: 10px;
    font-weight: 500;

    line-height: 1.35;
}


/* ------------------------------------------------------------
   Vorhandenes Bild unter der Uploadfläche
   ------------------------------------------------------------ */

.runtime-upload-block
.runtime-image-preview {
    margin-top: 12px;
}


/*
 * Vorschau bewusst kompakt.
 * Das Original bleibt unverändert.
 */

.runtime-upload-block
.runtime-image-preview img {
    max-height: 320px;
}


/* ------------------------------------------------------------
   BILD-Zeile
   ------------------------------------------------------------ */

.checklist-item--bild
.checklist-control {
    align-items: start;
}


/*
 * Bei der großen Uploadfläche sitzt "Punkt erledigt"
 * auf Höhe des Uploadfeldes, aber nicht auf Höhe
 * einer darunter liegenden Vorschau.
 */

.checklist-item--bild
.completed-control {
    align-self: center;
}


/* ------------------------------------------------------------
   Mittlere Bildschirmbreite
   ------------------------------------------------------------ */

@media (max-width: 1150px) {

    .checklist-control {
        --runtime-status-width: 150px;
        --runtime-status-gap: 16px;
    }

    .checklist-control:has(> .completed-control)::after {
        right: calc(
            var(--runtime-status-width)
            + 8px
        );
    }

}


/* ------------------------------------------------------------
   Mobil: wieder untereinander
   ------------------------------------------------------------ */

@media (max-width: 760px) {

    .checklist-control {
        grid-template-columns: 1fr;

        row-gap: 10px;
    }

    .checklist-control:has(> .completed-control)::after {
        display: none;
    }

    .checklist-control > .completed-control {
        grid-column: 1;
        grid-row: auto;

        width: fit-content;

        padding-left: 0;
    }

    .runtime-upload-zone {
        min-height: 110px;

        padding: 16px;
    }

    .runtime-upload-icon {
        width: 38px;
        height: 38px;

        margin-right: 11px;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.5 ENDE */


/* ============================================================
   NETSTYLE CHECKLISTEN-RUNTIME V2.6
   DATEI-Dropzone / Statusausrichtung
   ============================================================ */


/* ------------------------------------------------------------
   Status immer oben am eigentlichen Eingabebereich
   ------------------------------------------------------------ */

.checklist-control > .completed-control {
    align-self: start;

    display: flex;
    align-items: center;

    min-height: 42px;

    padding-top: 0;
}


/*
 * Bei BILD und DATEI etwas Abstand nach oben,
 * damit der Status optisch auf Höhe des
 * Uploadbereichs sitzt.
 */

.checklist-item--bild
.checklist-control > .completed-control,

.checklist-item--datei
.checklist-control > .completed-control {
    padding-top: 14px;
}


/* ------------------------------------------------------------
   DATEI – kompakte Dropzone
   ------------------------------------------------------------ */

.runtime-upload-zone--file {
    justify-content: flex-start;

    min-height: 86px;

    padding: 14px 18px;
}


/* etwas kleineres Symbol als beim Bild */

.runtime-upload-zone--file
.runtime-upload-icon {
    width: 38px;
    height: 38px;

    margin-right: 12px;

    font-size: 22px;
}


/* ------------------------------------------------------------
   Bereits hochgeladene Datei
   ------------------------------------------------------------ */

.runtime-file-existing {
    display: flex;
    align-items: center;

    gap: 8px;

    width: fit-content;
    max-width: 100%;

    margin-top: 9px;
    padding: 7px 10px;

    border: 1px solid #dce5ee;
    border-radius: 7px;

    background: #f8fafc;

    font-size: 11px;
}


.runtime-file-existing-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    border-radius: 5px;

    background: #eaf3fb;

    color: #176fd1;

    font-weight: 700;
}


.runtime-file-existing a {
    color: #176bb8;

    font-weight: 600;

    text-decoration: none;
}


.runtime-file-existing a:hover {
    text-decoration: underline;
}


/* ------------------------------------------------------------
   Mobile
   ------------------------------------------------------------ */

@media (max-width: 760px) {

    .checklist-item--bild
    .checklist-control > .completed-control,

    .checklist-item--datei
    .checklist-control > .completed-control {
        padding-top: 0;
    }

    .runtime-upload-zone--file {
        min-height: 78px;

        padding: 12px 14px;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.6 ENDE */


/* ============================================================
   NETSTYLE CHECKLISTEN-RUNTIME V2.7
   Echte DATEI-/BILD-Dropzones
   ============================================================ */

.runtime-upload-block {
    width: 100%;
    min-width: 0;
}


/* Basis */

.runtime-upload-zone {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    box-sizing: border-box;

    padding: 18px 22px;

    border: 1px dashed #a8c7e5;
    border-radius: 10px;

    background: #f9fcff;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background-color .15s ease,
        box-shadow .15s ease,
        transform .1s ease;
}


/* DATEI bewusst kompakter */

.runtime-upload-zone--file {
    min-height: 90px;
}


/* BILD größer wie freigegebene Visualisierung */

.runtime-upload-zone--image {
    min-height: 132px;
}


/* Hover */

.runtime-upload-zone:hover {
    border-color: #6da7da;

    background: #f4f9fe;
}


/* Tatsächliches Drag&Drop */

.runtime-upload-zone.is-dragover {
    border-color: #176fd1;

    background: #eaf4fe;

    box-shadow:
        inset 0 0 0 2px
        rgba(23, 111, 209, .08),
        0 0 0 3px
        rgba(23, 111, 209, .08);

    transform: translateY(-1px);
}


/* Datei gewählt */

.runtime-upload-zone.has-file {
    border-style: solid;
    border-color: #8bb9e3;

    background: #f4f9fe;
}


/*
 * Echtes File-Input bleibt technisch vorhanden,
 * ist aber über die gesamte Dropzone unsichtbar.
 */

.runtime-upload-input {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    margin: 0;

    opacity: 0;

    cursor: pointer;
}


/* Symbol */

.runtime-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 42px;
    height: 42px;

    margin-right: 14px;

    border: 1px solid #cee0f1;
    border-radius: 10px;

    background: #eaf4fe;

    color: #176fd1;

    font-size: 25px;
    font-weight: 600;
}


/* Texte */

.runtime-upload-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    min-width: 0;
}


.runtime-upload-content strong {
    color: #173650;

    font-size: 13px;
    font-weight: 700;
}


.runtime-upload-action {
    margin-top: 2px;

    color: #176fd1;

    font-size: 12px;
    font-weight: 600;
}


.runtime-upload-content small {
    margin-top: 5px;

    color: #788a9d;

    font-size: 10px;
}


/* Gewählte Datei */

.runtime-upload-selected {
    display: block;

    max-width: 100%;

    margin-top: 8px;

    overflow: hidden;

    color: #244b70;

    font-size: 11px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.runtime-upload-selected[hidden] {
    display: none;
}


/* bestehende Datei */

.runtime-file-existing {
    display: flex;
    align-items: center;

    gap: 8px;

    width: fit-content;

    margin-top: 9px;
    padding: 7px 10px;

    border: 1px solid #dce5ee;
    border-radius: 7px;

    background: #f8fafc;

    font-size: 11px;
}


.runtime-file-existing a {
    color: #176bb8;

    font-weight: 600;
    text-decoration: none;
}


/* Mobil */

@media (max-width: 760px) {

    .runtime-upload-zone--file,
    .runtime-upload-zone--image {
        min-height: 105px;

        padding: 15px;
    }

    .runtime-upload-icon {
        width: 38px;
        height: 38px;

        margin-right: 11px;
    }

}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.7 ENDE */


/* ============================================================
   NETSTYLE CHECKLISTEN-RUNTIME V2.8
   Anhänge – Vorschau / Öffnen / Löschen
   ============================================================ */

.runtime-upload-pending {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    margin-top: 10px;
    padding: 10px;

    border: 1px solid #d9e4ee;
    border-radius: 9px;

    background: #f8fbfe;
}

.runtime-upload-pending[hidden] {
    display: none;
}


/* Bild vor dem Speichern */

.runtime-upload-local-image-link {
    flex: 0 0 auto;

    display: block;
}

.runtime-upload-local-image {
    display: block;

    width: 150px;
    height: 100px;

    object-fit: contain;

    border: 1px solid #dce5ee;
    border-radius: 7px;

    background: #fff;
}


/* Datei-/Bildinformationen */

.runtime-upload-pending-info {
    display: flex;
    flex-direction: column;

    min-width: 0;

    padding-top: 2px;
}

.runtime-upload-pending-info strong {
    max-width: 100%;

    overflow: hidden;

    color: #173650;

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.runtime-upload-pending-info > span {
    margin-top: 3px;

    color: #75879a;

    font-size: 10px;
}


/* Aktionen */

.runtime-upload-pending-actions,
.runtime-image-preview-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 13px;

    margin-top: 8px;
}

.runtime-upload-pending-actions a,
.runtime-image-preview-actions a,
.runtime-file-existing a {
    color: #176bb8;

    font-size: 11px;
    font-weight: 700;

    text-decoration: none;
}

.runtime-upload-pending-actions a:hover,
.runtime-image-preview-actions a:hover,
.runtime-file-existing a:hover {
    text-decoration: underline;
}


/* Löschen bewusst als sekundäre rote Textaktion */

.runtime-upload-clear,
.runtime-attachment-delete {
    padding: 0;

    border: 0;

    background: transparent;

    color: #b23b3b;

    font: inherit;
    font-size: 11px;
    font-weight: 700;

    cursor: pointer;
}

.runtime-upload-clear:hover,
.runtime-attachment-delete:hover {
    text-decoration: underline;
}


/* Gespeicherte Datei */

.runtime-file-existing {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 10px;

    width: fit-content;

    margin-top: 10px;
    padding: 8px 11px;

    border: 1px solid #dce5ee;
    border-radius: 8px;

    background: #f8fafc;
}


/* NETSTYLE CHECKLISTEN-RUNTIME V2.8 ENDE */


/* ============================================================
   CHECKLISTEN-RUNTIME V2.9
   Mehrfach-Anhänge
   ============================================================ */

.runtime-upload-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 8px;

    color: #6b7e90;

    font-size: 11px;
}

.runtime-upload-status strong {
    color: #314b63;
    font-size: 11px;
}


.runtime-attachment-list {
    display: grid;
    grid-template-columns: 1fr;

    gap: 8px;

    margin-top: 10px;
}

.runtime-attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    min-width: 0;

    padding: 10px 12px;

    border: 1px solid #dce5ee;
    border-radius: 8px;

    background: #f8fafc;
}

.runtime-attachment-card-main {
    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;
}

.runtime-attachment-icon {
    flex: 0 0 auto;

    color: #176bb8;

    font-size: 15px;
}

.runtime-attachment-info {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.runtime-attachment-info strong {
    overflow: hidden;

    color: #173650;

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.runtime-attachment-info span {
    margin-top: 2px;

    color: #77899a;

    font-size: 10px;
}

.runtime-attachment-actions {
    display: flex;
    align-items: center;

    flex: 0 0 auto;

    gap: 13px;
}

.runtime-attachment-actions a {
    color: #176bb8;

    font-size: 11px;
    font-weight: 700;

    text-decoration: none;
}

.runtime-attachment-actions a:hover {
    text-decoration: underline;
}


/* Gespeicherte Bilder */

.runtime-image-grid {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fill,
            minmax(165px, 1fr)
        );

    gap: 12px;

    margin-top: 10px;
}

.runtime-image-card {
    min-width: 0;

    padding: 8px;

    border: 1px solid #dce5ee;
    border-radius: 9px;

    background: #f8fafc;
}

.runtime-image-card-preview {
    display: block;

    overflow: hidden;

    width: 100%;
    height: 115px;

    border: 1px solid #e2e8ef;
    border-radius: 7px;

    background: #fff;
}

.runtime-image-card-preview img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.runtime-image-card-info {
    display: flex;
    flex-direction: column;

    min-width: 0;

    margin-top: 7px;
}

.runtime-image-card-info strong {
    overflow: hidden;

    color: #173650;

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.runtime-image-card-info span {
    margin-top: 2px;

    color: #788a9b;

    font-size: 10px;
}


/* Noch nicht gespeicherte Mehrfachauswahl */

.runtime-upload-pending-list {
    display: grid;
    grid-template-columns: 1fr;

    gap: 8px;

    margin-top: 10px;
}

.runtime-upload-pending-card {
    display: flex;
    align-items: center;

    gap: 11px;

    min-width: 0;

    padding: 9px 10px;

    border: 1px dashed #b9ccdc;
    border-radius: 8px;

    background: #f8fbfe;
}

.runtime-upload-pending-card--image {
    align-items: flex-start;
}

.runtime-upload-pending-card
.runtime-upload-local-image {
    width: 110px;
    height: 75px;
}


/* Kleine Displays */

@media (max-width: 760px) {

    .runtime-attachment-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .runtime-attachment-actions {
        width: 100%;
    }

    .runtime-image-grid {
        grid-template-columns: 1fr;
    }
}

/* CHECKLISTEN-RUNTIME V2.9 ENDE */


/* ============================================================
   BENUTZER / PROFILBILD
   ============================================================ */

.avatar {
    overflow: hidden;
    flex: 0 0 auto;
}

.avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.profile-image-editor {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 24px;
    align-items: center;

    margin-bottom: 28px;
    padding-bottom: 24px;

    border-bottom: 1px solid var(--line);
}


.profile-image-preview {
    width: 96px;
    height: 96px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border-radius: 50%;

    background: var(--navy);
    color: #fff;

    font-size: 25px;
    font-weight: 700;
}


.profile-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.profile-image-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.profile-image-fields input[type="file"] {
    min-height: auto;
    padding: 9px;
}


.profile-delete-control {
    width: fit-content;
}


.user-active-field {
    justify-content: end;
    min-height: 64px;
}


.user-password-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;

    margin-top: 28px;
    padding-top: 24px;

    border-top: 1px solid var(--line);
}


.user-password-field {
    width: 100%;
}


.user-list-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}


.table-avatar {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    flex: 0 0 34px;

    overflow: hidden;

    border-radius: 50%;

    background: var(--navy);
    color: #fff;

    font-size: 10px;
    font-weight: 700;
}


.table-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


@media (max-width: 700px) {

    .profile-image-editor {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   BENUTZER PROFIL – FEINSCHLIFF
   ============================================================ */

.profile-image-preview span {
    line-height: 1;
}

.profile-image-fields input[type="file"] {
    width: 100%;

    border: 1px solid #d8e0ea;
    border-radius: 8px;

    background: #fff;

    color: var(--text);
}

.profile-image-fields input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 12px;

    border: 0;
    border-right: 1px solid #d8e0ea;

    background: #f4f7fb;
    color: #203650;

    cursor: pointer;

    font-weight: 600;
}

.profile-image-fields input[type="file"]::file-selector-button:hover {
    background: #eaf1f9;
}


/* ============================================================
   PROFILBILD – DROPZONE
   ============================================================ */

.profile-upload-input {
    position: absolute;

    width: 1px;
    height: 1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);

    white-space: nowrap;
}


.profile-upload-dropzone {
    width: 100%;
    min-height: 126px;

    display: flex;
    align-items: center;
    gap: 18px;

    box-sizing: border-box;

    padding: 20px 24px;

    border: 2px dashed #c7d5e5;
    border-radius: 10px;

    background: #f8fafc;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background-color .15s ease,
        box-shadow .15s ease;
}


.profile-upload-dropzone:hover,
.profile-upload-dropzone:focus-visible {
    border-color: #176fd1;

    background: #f2f7fd;

    outline: none;

    box-shadow:
        0 0 0 3px rgba(23,111,209,.07);
}


.profile-upload-dropzone.is-dragover {
    border-color: #176fd1;

    background: #eaf3fc;

    box-shadow:
        inset 0 0 0 1px rgba(23,111,209,.15);
}


.profile-upload-dropzone-icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    flex: 0 0 46px;

    border-radius: 50%;

    background: #e6f0fc;
    color: #176fd1;

    font-size: 24px;
    font-weight: 500;
}


.profile-upload-dropzone-text {
    display: flex;
    flex-direction: column;
    gap: 4px;

    min-width: 0;
}


.profile-upload-dropzone-text strong {
    color: #203650;

    font-size: 13px;
}


.profile-upload-dropzone-text span {
    color: #63758a;

    font-size: 12px;
}


.profile-upload-dropzone-text small {
    margin-top: 3px;

    color: #8492a3;

    font-size: 11px;
}


.profile-upload-selected {
    min-width: 220px;
    max-width: 360px;

    margin-left: auto;
    padding: 11px 13px;

    box-sizing: border-box;

    border: 1px solid #d5e1ef;
    border-radius: 8px;

    background: #fff;
}


.profile-upload-selected strong,
.profile-upload-selected span {
    display: block;
}


.profile-upload-selected strong {
    overflow: hidden;

    color: #203650;

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.profile-upload-selected span {
    margin-top: 3px;

    color: #7b8b9d;

    font-size: 11px;
}


.profile-upload-remove {
    margin-top: 7px;
    padding: 0;

    border: 0;

    background: transparent;
    color: #176fd1;

    cursor: pointer;

    font-size: 11px;
    font-weight: 600;
}


.profile-upload-remove:hover {
    text-decoration: underline;
}


@media (max-width: 800px) {

    .profile-upload-dropzone {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-upload-selected {
        width: 100%;
        min-width: 0;
        max-width: none;

        margin-left: 0;
    }

}


/* ============================================================
   VORGANG – NUR-LESEMODUS
   ============================================================ */

.runtime-readonly-notice {
    display: flex;
    align-items: center;
    gap: 13px;

    margin-bottom: 18px;
    padding: 13px 16px;

    border: 1px solid #cfe0f4;
    border-radius: 9px;

    background: #f2f7fd;
    color: #294d78;
}


.runtime-readonly-notice-icon {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    flex: 0 0 32px;

    border-radius: 50%;

    background: #dfeefa;
    color: #176fd1;

    font-size: 15px;
}


.runtime-readonly-notice strong,
.runtime-readonly-notice span {
    display: block;
}


.runtime-readonly-notice strong {
    margin-bottom: 2px;

    color: #1d426e;

    font-size: 13px;
}


.runtime-readonly-notice span {
    color: #607994;

    font-size: 12px;
}


.runtime-permission-fieldset {
    min-width: 0;

    margin: 0;
    padding: 0;

    border: 0;
}


.runtime-permission-fieldset:disabled {
    opacity: 1;
}


.runtime-permission-fieldset:disabled .portal-input {
    opacity: 1;

    background: #f7f9fc;
    color: #34485f;

    -webkit-text-fill-color: #34485f;

    cursor: default;
}


.runtime-permission-fieldset:disabled
.runtime-checkbox,
.runtime-permission-fieldset:disabled
.runtime-multiselect-option {
    cursor: default;
}


.runtime-readonly-completion {
    display: inline-flex;
    align-items: center;

    min-height: 30px;

    margin-top: 12px;
    padding: 0 10px;

    border: 1px solid #dce3eb;
    border-radius: 999px;

    background: #f6f8fa;
    color: #758395;

    font-size: 11px;
    font-weight: 700;
}


.runtime-readonly-completion--done {
    border-color: #cfe6d6;

    background: #eef8f1;
    color: #33734a;
}


/* ============================================================
   DASHBOARD – AKTIVITÄTEN / MANAGEMENT
   ============================================================ */

.activity-user {
    display: block;

    margin-top: 4px;

    color: #425a74;

    font-size: 11px;
    font-weight: 600;
}


.activity-user + small {
    display: block;

    margin-top: 3px;
}


/* ============================================================
   TABELLEN – AKTIONSBUTTON
   ============================================================ */

.table-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 30px;

    padding: 0 12px;

    border: 1px solid #cbd9e9;
    border-radius: 7px;

    background: #ffffff;
    color: #176fd1;

    font-size: 11px;
    font-weight: 700;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}


.table-action-button:hover {
    border-color: #176fd1;

    background: #f2f7fd;

    text-decoration: none;
}


.table-action-button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(23,111,209,.10);
}


/* ============================================================
   DASHBOARD – AKTIVITÄTENKONTEXT
   ============================================================ */

.activity-context {
    display: block;

    margin-top: 5px;

    color: #718096;

    font-size: 10px;
    line-height: 1.45;
}


.activity-context-link {
    color: #315a87;

    font-weight: 700;

    text-decoration: none;
}


.activity-context-link:hover {
    text-decoration: underline;
}


.activity-user {
    display: block;

    margin-top: 4px;

    color: #425a74;

    font-size: 11px;
    font-weight: 600;
}


.activity-user + small {
    display: block;

    margin-top: 3px;
}


/* ============================================================
   VORGÄNGE – SORTIERBARE TABELLE
   ============================================================ */

.table-sort {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: inherit;

    text-decoration: none;
}


.table-sort span {
    color: #9aa8b8;

    font-size: 11px;
}


.table-sort:hover {
    color: var(--blue);

    text-decoration: none;
}


.table-sort:hover span,
.table-sort.is-active span {
    color: var(--blue);
}


.table-sort.is-active {
    color: #324d6b;
}


/* ============================================================
   VORGÄNGE – DIREKTE TABELLENFILTER
   ============================================================ */

.table-filter-link {
    color: inherit;

    text-decoration: none;

    border-bottom:
        1px dotted transparent;
}


.table-filter-link:hover {
    color: var(--blue);

    border-bottom-color:
        rgba(23, 111, 209, .45);
}


.status-filter-link {
    display: inline-flex;

    text-decoration: none;
}


.status-filter-link:hover {
    text-decoration: none;
}


.status-filter-link:hover .status-badge {
    box-shadow:
        0 0 0 2px rgba(23, 111, 209, .10);
}

/* ============================================================
   VORGÄNGE – KOMPAKTE FILTERLEISTE / RESET
   ============================================================ */

.list-filter--workorders {
    display: grid !important;

    grid-template-columns:
        minmax(320px, 1fr)
        minmax(170px, 220px)
        max-content
        max-content !important;

    align-items: center;

    gap: 10px;
}


.list-filter--workorders
.workorder-filter-search {
    min-width: 0;
}


.list-filter--workorders
.workorder-filter-select {
    min-width: 0;
}


.list-filter--workorders
.workorder-filter-reset {
    grid-column: auto !important;

    display: inline-flex !important;

    align-items: center;
    justify-content: center;

    justify-self: start;

    width: auto !important;
    min-width: 0 !important;

    height: 40px;

    margin: 0 !important;

    padding: 0 12px !important;

    border: 1px solid #d8e0e9;

    border-radius: 8px;

    background: #ffffff;

    color: #66758a;

    font-size: 12px;
    font-weight: 600;

    line-height: 1;

    text-decoration: none;

    white-space: nowrap;

    box-shadow: none;
}


.list-filter--workorders
.workorder-filter-reset:hover {
    border-color: var(--blue);

    color: var(--blue);

    background: #f7faff;

    text-decoration: none;
}


@media (max-width: 800px) {

    .list-filter--workorders {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(150px, 190px)
            max-content
            max-content !important;
    }

}


@media (max-width: 650px) {

    .list-filter--workorders {
        grid-template-columns:
            1fr
            1fr !important;
    }

    .list-filter--workorders
    .workorder-filter-search {
        grid-column: 1 / -1;
    }

}


@media (max-width: 480px) {

    .list-filter--workorders {
        grid-template-columns:
            1fr !important;
    }

    .list-filter--workorders
    .workorder-filter-search {
        grid-column: auto;
    }

    .list-filter--workorders
    .workorder-filter-reset {
        justify-self: start;
    }

}


/* ============================================================
   VORGANG – READONLY ERLEDIGT-SCHALTER
   ============================================================ */

.completed-control--readonly {
    cursor: default;
}

.completed-control--readonly
.completed-control-switch {
    cursor: default;
}

.completed-control--readonly
.completed-control-text {
    cursor: default;
}


/* ============================================================
   DASHBOARD – HEADER-AKTIONEN
   ============================================================ */

.dashboard-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;

    flex-wrap: wrap;
}


.dashboard-header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    min-width: 0;

    min-height: 36px;

    margin: 0;

    padding: 0 13px;

    white-space: nowrap;
}


@media (max-width: 650px) {

    .dashboard-header-actions {
        width: 100%;

        justify-content: flex-start;

        margin-top: 10px;
    }

}


/* ============================================================
   DASHBOARD – HEADER-BUTTONS EINHEITLICH
   ============================================================ */

.dashboard-header-actions
.dashboard-header-button {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;

    min-height: 36px;
    height: 36px;

    padding: 0 10px !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    font-size: 12px;
    line-height: 1;

    white-space: nowrap;
}


/* ============================================================
   GENERISCHE LISTEN – KOPFAKTIONEN
   ============================================================ */

.page-heading--with-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 18px;
}


.list-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;
}


.list-header-button {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;

    height: 36px;
    min-height: 36px;

    padding: 0 10px !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    font-size: 12px;
    line-height: 1;

    white-space: nowrap;
}


@media (max-width: 650px) {

    .page-heading--with-actions {
        align-items: flex-start;
        flex-direction: column;
    }

}


/* === NETSTYLE PORTAL UI FINAL START === */

:root {
    --portal-row-button-width: 92px;
    --portal-row-button-height: 32px;

    --portal-toolbar-button-width: 92px;
    --portal-toolbar-height: 40px;

    --portal-button-gap: 8px;
    --portal-right-edge: 14px;
}


/* ------------------------------------------------------------
   ANLEGEN
   ------------------------------------------------------------ */

.portal-create-button {
    display: inline-flex !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    height: 36px !important;
    min-height: 36px !important;

    padding: 0 14px !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    white-space: nowrap !important;
}

.page-heading
.portal-create-button {
    margin-left: auto !important;
    margin-right:
        var(
            --portal-right-edge
        ) !important;
}


/* ------------------------------------------------------------
   LISTENFILTER
   ------------------------------------------------------------ */

.enterprise-list-toolbar {
    display: flex !important;
    align-items: center !important;

    gap:
        var(
            --portal-button-gap
        ) !important;

    padding:
        11px
        var(--portal-right-edge)
        11px
        14px !important;
}

.enterprise-list-search {
    position: relative;

    min-width: 0 !important;

    flex: 1 1 auto !important;
}

.enterprise-list-search > span {
    position: absolute;

    top: 50%;
    left: 13px;

    transform:
        translateY(-50%);

    color: #8390a2;

    pointer-events: none;
}

.enterprise-list-search input {
    box-sizing: border-box !important;

    width: 100% !important;

    height:
        var(
            --portal-toolbar-height
        ) !important;

    min-height:
        var(
            --portal-toolbar-height
        ) !important;

    padding-left: 37px !important;
}

.enterprise-list-toolbar select {
    height:
        var(
            --portal-toolbar-height
        ) !important;

    min-height:
        var(
            --portal-toolbar-height
        ) !important;
}

.enterprise-filter-button,
.enterprise-reset-button,
.knowledge-filter-button,
.knowledge-reset-button,
.workorder-filter-reset {
    display: inline-flex !important;

    width:
        var(
            --portal-toolbar-button-width
        ) !important;

    min-width:
        var(
            --portal-toolbar-button-width
        ) !important;

    max-width:
        var(
            --portal-toolbar-button-width
        ) !important;

    height:
        var(
            --portal-toolbar-height
        ) !important;

    min-height:
        var(
            --portal-toolbar-height
        ) !important;

    padding: 0 7px !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    font-size: 11px !important;

    line-height: 1 !important;

    white-space: nowrap !important;
}


/* ------------------------------------------------------------
   TABELLENAKTIONEN
   ------------------------------------------------------------ */

.enterprise-row-button,
.knowledge-action-button,
.table-action-button {
    display: inline-flex !important;

    width:
        var(
            --portal-row-button-width
        ) !important;

    min-width:
        var(
            --portal-row-button-width
        ) !important;

    max-width:
        var(
            --portal-row-button-width
        ) !important;

    height:
        var(
            --portal-row-button-height
        ) !important;

    min-height:
        var(
            --portal-row-button-height
        ) !important;

    padding: 0 7px !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    font-size: 10px !important;

    line-height: 1 !important;

    white-space: nowrap !important;
}

.enterprise-row-actions,
.knowledge-row-actions,
.action-buttons,
.table-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;

    gap:
        var(
            --portal-button-gap
        ) !important;

    flex-wrap: nowrap !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-actions-table
thead th:last-child {
    padding-right:
        var(
            --portal-right-edge
        ) !important;

    text-align: center !important;

    white-space: nowrap !important;
}

.enterprise-actions-table
tbody td:last-child {
    padding-right:
        var(
            --portal-right-edge
        ) !important;

    text-align: right !important;

    white-space: nowrap !important;
}

.enterprise-actions-table.action-count-1
thead th:last-child,
.enterprise-actions-table.action-count-1
tbody td:last-child {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

.enterprise-actions-table.action-count-2
thead th:last-child,
.enterprise-actions-table.action-count-2
tbody td:last-child {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
}

.enterprise-actions-table.action-count-3
thead th:last-child,
.enterprise-actions-table.action-count-3
tbody td:last-child {
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
}


/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 760px) {

    .enterprise-list-toolbar {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .enterprise-filter-button,
    .enterprise-reset-button {
        width: 100% !important;
        max-width: none !important;
    }

    .page-heading
    .portal-create-button {
        margin-right: 0 !important;
    }
}

/* === NETSTYLE PORTAL UI FINAL END === */


/* === NETSTYLE PORTAL UI FINAL START === */

:root {
    --portal-row-button-width: 92px;
    --portal-row-button-height: 32px;

    --portal-toolbar-button-width: 92px;
    --portal-toolbar-height: 40px;

    --portal-button-gap: 8px;
    --portal-right-edge: 14px;
}


/* ------------------------------------------------------------
   ANLEGEN
   ------------------------------------------------------------ */

.portal-create-button {
    display: inline-flex !important;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    height: 36px !important;
    min-height: 36px !important;

    padding: 0 14px !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    white-space: nowrap !important;
}

.page-heading
.portal-create-button {
    margin-left: auto !important;
    margin-right:
        var(
            --portal-right-edge
        ) !important;
}


/* ------------------------------------------------------------
   LISTENFILTER
   ------------------------------------------------------------ */

.enterprise-list-toolbar {
    display: flex !important;
    align-items: center !important;

    gap:
        var(
            --portal-button-gap
        ) !important;

    padding:
        11px
        var(--portal-right-edge)
        11px
        14px !important;
}

.enterprise-list-search {
    position: relative;

    min-width: 0 !important;

    flex: 1 1 auto !important;
}

.enterprise-list-search > span {
    position: absolute;

    top: 50%;
    left: 13px;

    transform:
        translateY(-50%);

    color: #8390a2;

    pointer-events: none;
}

.enterprise-list-search input {
    box-sizing: border-box !important;

    width: 100% !important;

    height:
        var(
            --portal-toolbar-height
        ) !important;

    min-height:
        var(
            --portal-toolbar-height
        ) !important;

    padding-left: 37px !important;
}

.enterprise-list-toolbar select {
    height:
        var(
            --portal-toolbar-height
        ) !important;

    min-height:
        var(
            --portal-toolbar-height
        ) !important;
}

.enterprise-filter-button,
.enterprise-reset-button,
.knowledge-filter-button,
.knowledge-reset-button,
.workorder-filter-reset {
    display: inline-flex !important;

    width:
        var(
            --portal-toolbar-button-width
        ) !important;

    min-width:
        var(
            --portal-toolbar-button-width
        ) !important;

    max-width:
        var(
            --portal-toolbar-button-width
        ) !important;

    height:
        var(
            --portal-toolbar-height
        ) !important;

    min-height:
        var(
            --portal-toolbar-height
        ) !important;

    padding: 0 7px !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    font-size: 11px !important;

    line-height: 1 !important;

    white-space: nowrap !important;
}


/* ------------------------------------------------------------
   TABELLENAKTIONEN
   ------------------------------------------------------------ */

.enterprise-row-button,
.knowledge-action-button,
.table-action-button {
    display: inline-flex !important;

    width:
        var(
            --portal-row-button-width
        ) !important;

    min-width:
        var(
            --portal-row-button-width
        ) !important;

    max-width:
        var(
            --portal-row-button-width
        ) !important;

    height:
        var(
            --portal-row-button-height
        ) !important;

    min-height:
        var(
            --portal-row-button-height
        ) !important;

    padding: 0 7px !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    font-size: 10px !important;

    line-height: 1 !important;

    white-space: nowrap !important;
}

.enterprise-row-actions,
.knowledge-row-actions,
.action-buttons,
.table-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;

    gap:
        var(
            --portal-button-gap
        ) !important;

    flex-wrap: nowrap !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-actions-table
thead th:last-child {
    padding-right:
        var(
            --portal-right-edge
        ) !important;

    text-align: center !important;

    white-space: nowrap !important;
}

.enterprise-actions-table
tbody td:last-child {
    padding-right:
        var(
            --portal-right-edge
        ) !important;

    text-align: right !important;

    white-space: nowrap !important;
}

.enterprise-actions-table.action-count-1
thead th:last-child,
.enterprise-actions-table.action-count-1
tbody td:last-child {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

.enterprise-actions-table.action-count-2
thead th:last-child,
.enterprise-actions-table.action-count-2
tbody td:last-child {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
}

.enterprise-actions-table.action-count-3
thead th:last-child,
.enterprise-actions-table.action-count-3
tbody td:last-child {
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
}


/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 760px) {

    .enterprise-list-toolbar {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .enterprise-filter-button,
    .enterprise-reset-button {
        width: 100% !important;
        max-width: none !important;
    }

    .page-heading
    .portal-create-button {
        margin-right: 0 !important;
    }
}

/* === NETSTYLE PORTAL UI FINAL END === */

/* === NETSTYLE UI FINISH 20260911 CUSTOMERS START === */
.customer-overview-table {
    min-width: 1120px;
}

.customer-primary-cell,
.customer-contact-cell,
.customer-location-cell {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.customer-primary-cell strong,
.customer-contact-cell strong,
.customer-location-cell strong {
    color: #1f3450;
    font-size: 11px;
}

.customer-primary-cell span,
.customer-location-cell span {
    color: #7a8aa0;
    font-size: 10px;
}

.customer-contact-cell a {
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: #4e6682;
    font-size: 10px;
    text-decoration: none;
}

.customer-contact-cell a:hover {
    color: #1769d2;
    text-decoration: underline;
}

.customer-count-badge {
    display: inline-flex;
    min-width: 30px;
    height: 26px;
    padding: 0 9px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #edf4ff;
    color: #1769d2;
    font-size: 11px;
    font-weight: 750;
}

.customer-action-column {
    width: 112px;
    min-width: 112px;
    text-align: right;
}

.customer-action-button {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    justify-content: center !important;
}
/* === NETSTYLE UI FINISH 20260911 CUSTOMERS END === */

/* === NETSTYLE FINAL DASHBOARD FUNCTION 20260911 START === */
.categories-panel .panel-header {
    align-items: center;
}

.dashboard-category-all-button {
    min-width: 118px;
}

.dashboard-category-link {
    position: relative;
    text-decoration: none;
    color: inherit;
    cursor: pointer;

    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease,
        background .16s ease;
}

.dashboard-category-link:hover {
    border-color: #b8ccec;
    background: #fbfdff;
    box-shadow: 0 8px 22px rgba(24, 62, 112, .08);
    transform: translateY(-1px);
}

.dashboard-category-link:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.dashboard-category-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dashboard-category-copy > strong {
    color: var(--text);
}

.dashboard-category-copy > span {
    color: var(--muted);
}

.dashboard-category-copy > small {
    margin-top: 5px;
    color: var(--blue);
    font-weight: 700;
    font-size: 11px;
}

.dashboard-category-filter-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 18px;
    padding: 16px 18px;
}

.dashboard-category-filter-note > div {
    display: flex;
    align-items: baseline;
    gap: 9px;
    min-width: 0;
}

.dashboard-category-filter-note strong {
    color: var(--text);
}

.dashboard-category-filter-note > div > span:last-child {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-category-filter-label,
.template-category-filter-status > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.template-category-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 14px;
}

.template-category-filter .enterprise-list-toolbar {
    flex: 1 1 auto;
}

.template-category-select {
    min-width: 260px;
    max-width: 420px;
}

.template-category-filter-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .categories-panel .panel-header,
    .dashboard-category-filter-note,
    .template-category-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-category-all-button {
        width: 100%;
    }

    .dashboard-category-filter-note > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .template-category-select {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .template-category-filter-status {
        align-items: flex-start;
    }
}
/* === NETSTYLE FINAL DASHBOARD FUNCTION 20260911 END === */

/* === NETSTYLE PAGEWISE DESIGN FIX 02B START === */
:root {
    /*
     * Verbindlicher Standard für Aktionen IN Tabellenzeilen.
     * Bewusst kompakter als primäre Seiten-/Toolbar-Buttons.
     */
    --portal-row-action-width: 88px;
    --portal-row-action-height: 32px;

    /*
     * Aktionsspaltenbreiten passend zu 1/2/3 kompakten Row-Actions.
     * Dadurch werden keine 196/376/556 px mehr für kleine Zeilenaktionen
     * reserviert.
     */
    --portal-action-count-1-width: 112px;
    --portal-action-count-2-width: 208px;
    --portal-action-count-3-width: 304px;
}


/* ------------------------------------------------------------
   Suchbare Kundenwahl
   ------------------------------------------------------------ */

.customer-combobox {
    position: relative;
    width: 100%;
    min-width: 0;
}

.customer-combobox-native {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.customer-combobox-input {
    width: 100%;
}

.customer-combobox-list {
    position: absolute;
    z-index: 80;
    top: calc(100% + 5px);
    left: 0;
    right: 0;

    max-height: 320px;
    overflow-y: auto;

    padding: 5px;

    border: 1px solid #d7e0ec;
    border-radius: 9px;

    background: #fff;

    box-shadow:
        0 12px 30px
        rgba(22, 48, 82, .14);
}

.customer-combobox-option {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 36px;

    padding: 8px 10px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: #263a54;

    font: inherit;
    font-size: 12px;

    text-align: left;
    cursor: pointer;
}

.customer-combobox-option:hover,
.customer-combobox-option.is-active {
    background: #eef5ff;
    color: #145fb8;
}

.customer-combobox-empty {
    padding: 12px 10px;
    color: #72839a;
    font-size: 11px;
}


/* ------------------------------------------------------------
   Tabellenzeilen-Aktionen – EIN verbindlicher Standard
   ------------------------------------------------------------ */

.enterprise-row-button,

.enterprise-actions-table
tbody td:last-child
> a,

.enterprise-actions-table
tbody td:last-child
> button {
    width:
        var(
            --portal-row-action-width
        ) !important;

    min-width:
        var(
            --portal-row-action-width
        ) !important;

    max-width:
        var(
            --portal-row-action-width
        ) !important;

    height:
        var(
            --portal-row-action-height
        ) !important;

    min-height:
        var(
            --portal-row-action-height
        ) !important;

    padding: 0 8px !important;

    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    line-height: 1 !important;
    white-space: nowrap !important;
}


/* Vorgangslisten: explizite Aktion rechts */

.workorder-list-table
.workorder-action-cell {
    text-align: right !important;
}

.workorder-list-table
.workorder-open-button {
    width:
        var(
            --portal-row-action-width
        ) !important;

    min-width:
        var(
            --portal-row-action-width
        ) !important;

    max-width:
        var(
            --portal-row-action-width
        ) !important;

    height:
        var(
            --portal-row-action-height
        ) !important;

    min-height:
        var(
            --portal-row-action-height
        ) !important;

    justify-content: center !important;
}
/* === NETSTYLE PAGEWISE DESIGN FIX 02B END === */

/* ============================================================
   DASHBOARD PAGE-HEADING ACTIONS 1J
   ============================================================ */

.dashboard-page-heading-actions {
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.dashboard-page-heading-button {
    min-height: 36px !important;
    height: 36px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

@media (max-width: 700px) {
    .dashboard-page-heading-actions {
        width: 100% !important;
        margin-left: 0 !important;
        justify-content: flex-start !important;
    }
}

/* DASHBOARD PAGE-HEADING ACTIONS 1J ENDE */



/* NETSTYLE_SECURE_4B_CSS_START */
.customer-tabs{display:flex;gap:5px;flex-wrap:wrap;margin:0 0 16px}.customer-tabs a{padding:9px 13px;border:1px solid #d9e1eb;border-radius:8px;text-decoration:none;color:inherit;background:#fff}.customer-tabs a.is-active{background:#1769d2;color:#fff;border-color:#1769d2}.customer-kpis{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}.customer-overview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.customer-overview-grid a{padding:18px;border:1px solid #dce5ef;border-radius:10px;text-decoration:none;background:#fff}.runtime-credential-card{display:flex;flex-direction:column;gap:10px;padding:14px;border:1px solid #d9e4f0;border-radius:10px;background:#f8fbff}.runtime-credential-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}.runtime-secret-warning{color:#6a7787}.enterprise-row-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.enterprise-row-actions form{margin:0}
/* NETSTYLE_SECURE_4B_CSS_END */

/* ============================================================
   NETSTYLE PORTAL COMPLETION – CUSTOMER / INVENTORY
   ============================================================ */
.eyebrow{font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#6f8198;margin-bottom:4px}
.customer-cockpit-heading{align-items:flex-start}
.customer-tabs-main{margin-bottom:18px;padding:4px;background:#eef3f9;border:1px solid #dce5ef;border-radius:12px}
.customer-tabs-main a{display:flex;align-items:center;gap:7px;background:transparent;border-color:transparent;font-weight:650}
.customer-tabs-main a span{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 6px;border-radius:999px;background:#e3ebf6;font-size:.72rem;color:#53657d}
.customer-tabs-main a.is-active span{background:rgba(255,255,255,.2);color:#fff}
.customer-kpis-primary{margin-bottom:18px}
.customer-overview-panels{margin-bottom:18px}
.customer-masterdata-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border:1px solid #e1e8f0;border-radius:10px;overflow:hidden}
.customer-masterdata-grid>div{padding:13px 15px;border-bottom:1px solid #e8eef5}
.customer-masterdata-grid>div:nth-child(odd){border-right:1px solid #e8eef5}
.customer-note{margin-top:16px;padding:14px;background:#f7f9fc;border:1px solid #e1e8f0;border-radius:10px}
.customer-overview-grid-large{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
.customer-overview-grid-large a{display:flex;flex-direction:column;gap:5px;transition:.16s ease}
.customer-overview-grid-large a:hover{border-color:#1769d2;box-shadow:0 7px 20px rgba(23,105,210,.08);transform:translateY(-1px)}
.customer-overview-grid-large a span{font-size:.82rem;color:#718198;line-height:1.45}
.customer-name-link{text-decoration:none;color:inherit}
.customer-name-link:hover{color:#1769d2}
.inventar-kpis{margin-bottom:18px}
.inventar-launch-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px}
.inventar-launch-card{display:flex;gap:14px;align-items:flex-start;padding:20px;border:1px solid #dce5ef;border-radius:12px;background:#fff;text-decoration:none;color:inherit;box-shadow:0 4px 16px rgba(25,54,91,.04);transition:.16s ease}
.inventar-launch-card:hover{border-color:#1769d2;box-shadow:0 9px 24px rgba(23,105,210,.08);transform:translateY(-1px)}
.inventar-launch-card strong{display:block;font-size:1rem;margin-bottom:4px}
.inventar-launch-card p{margin:0;color:#718198;font-size:.84rem;line-height:1.45}
.inventar-launch-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;background:#eef5ff;color:#1769d2;font-size:1.2rem;flex:0 0 40px}
.portal-two-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:18px}
.compact-list{display:flex;flex-direction:column;gap:7px}
.compact-list>a{display:flex;flex-direction:column;gap:2px;padding:10px 11px;border:1px solid #e3eaf2;border-radius:8px;text-decoration:none;color:inherit;background:#fff}
.compact-list>a:hover{border-color:#b9cce7;background:#f9fbfe}
.compact-list>a span{font-size:.78rem;color:#73849a}
.empty-state{margin:6px 0;color:#718198}
.asset-detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:0;padding:0;overflow:hidden}
.asset-detail-grid>div{display:flex;flex-direction:column;gap:4px;padding:15px 17px;border-right:1px solid #e8eef5;border-bottom:1px solid #e8eef5;min-height:74px}
.asset-detail-grid>div span{font-size:.74rem;text-transform:uppercase;letter-spacing:.04em;color:#7d8da1;font-weight:700}
.asset-detail-grid>div strong{font-size:.92rem;overflow-wrap:anywhere}
.asset-credential-row{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:11px 0;border-bottom:1px solid #edf1f6}
.asset-credential-row:last-child{border-bottom:0}
.asset-credential-row>div:first-child{display:flex;flex-direction:column;gap:2px}
.asset-credential-row span{font-size:.78rem;color:#74849a}
.portal-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}
.portal-form-grid>p{margin:0;display:flex;flex-direction:column;gap:6px}
.portal-form-grid>p:has(textarea){grid-column:1/-1}
.portal-form-grid .helptext{font-size:.76rem;color:#76879b}
.portal-form-grid ul.errorlist{margin:0;padding-left:18px;color:#b42318;font-size:.8rem}
.form-actions-full{grid-column:1/-1;justify-content:flex-end;margin-top:4px}
.preline{white-space:pre-line}
.search-result-grid{align-items:start}
.status-badge.status--wartung,.status-badge.status--test{background:#fff4d6;color:#845b00}
.status-badge.status--defekt,.status-badge.status--abgelaufen{background:#ffe6e5;color:#a3261f}
.status-badge.status--reserve,.status-badge.status--abgekuendigt{background:#edf1f6;color:#526176}
.status-badge.status--ausgemustert,.status-badge.status--archiviert{background:#edf1f6;color:#526176}
@media (max-width:1100px){.inventar-launch-grid{grid-template-columns:1fr}.portal-two-column{grid-template-columns:1fr}.portal-form-grid{grid-template-columns:1fr}.form-actions-full,.portal-form-grid>p:has(textarea){grid-column:auto}.customer-masterdata-grid{grid-template-columns:1fr}.customer-masterdata-grid>div:nth-child(odd){border-right:0}}

/* Portalweite KPI-Karten – bislang nur Auditseiten-spezifisch vorhanden */
.audit-kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:0 0 18px}
.audit-kpi-card{display:flex;flex-direction:column;gap:5px;min-height:88px;padding:14px 16px;border:1px solid #dce5ef;border-radius:11px;background:#fff;box-shadow:0 3px 12px rgba(25,54,91,.035)}
.audit-kpi-card span{font-size:.76rem;font-weight:700;color:#718198;text-transform:uppercase;letter-spacing:.035em}
.audit-kpi-card strong{font-size:1.55rem;line-height:1;color:#102a4c}
.kpi-card-link{text-decoration:none;color:inherit;transition:.16s ease}
.kpi-card-link:hover{border-color:#1769d2;box-shadow:0 7px 20px rgba(23,105,210,.08);transform:translateY(-1px)}
.customer-overview-table .customer-action-column{width:190px;min-width:190px}
.customer-overview-table .enterprise-row-actions{justify-content:flex-end;flex-wrap:nowrap}

/* ============================================================
   NETSTYLE PORTAL UX FINAL – TABLES / LOOKUPS / SEARCH / FORMS
   ============================================================ */
.enterprise-list-toolbar--wrap{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px!important;align-items:center}.enterprise-list-toolbar--wrap>.primary-button,.enterprise-list-toolbar--wrap>.secondary-button{width:auto;min-width:112px;justify-self:start}.table-sort{display:inline-flex;align-items:center;gap:5px;color:inherit;text-decoration:none;font-weight:750;white-space:nowrap}.table-sort:hover,.table-sort.is-active{color:#1769d2}.table-empty-state{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:18px;color:#718198}.table-empty-state strong{color:#263b57}.pagination-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border-top:1px solid #e6edf5;flex-wrap:wrap}.pagination-actions{display:flex;gap:6px;align-items:center}.pagination-current{font-size:.8rem;color:#6f8198}.customer-autocomplete{position:relative;min-width:0}.customer-autocomplete-list{position:absolute;z-index:60;top:calc(100% + 4px);left:0;right:0;max-height:310px;overflow:auto;background:#fff;border:1px solid #cfdbe9;border-radius:9px;box-shadow:0 12px 30px rgba(21,47,82,.16);padding:5px}.customer-autocomplete-option{display:block;width:100%;border:0;background:transparent;text-align:left;padding:9px 10px;border-radius:6px;cursor:pointer;color:#152c4b}.customer-autocomplete-option:hover,.customer-autocomplete-option.is-active{background:#eef5ff;color:#1769d2}.customer-autocomplete-empty{padding:10px;color:#728299;font-size:.82rem}.portal-section-tabs{display:flex;gap:5px;flex-wrap:wrap;margin:-4px 0 16px;padding:4px;background:#eef3f9;border:1px solid #dce5ef;border-radius:11px}.portal-section-tabs a{padding:8px 12px;border-radius:7px;text-decoration:none;color:#18314f;font-weight:700}.portal-section-tabs a.is-active{background:#1769d2;color:#fff}.structured-form fieldset{border:1px solid #dce5ef;border-radius:11px;padding:18px;margin:0 0 16px;background:#fff}.structured-form legend{padding:0 8px;font-weight:800;color:#173150}.structured-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}.form-field{display:flex;flex-direction:column;gap:6px;min-width:0}.form-field-full{grid-column:1/-1}.form-field label{font-weight:700;color:#263b57}.form-field small,.fieldset-help{font-size:.78rem;color:#75869c;line-height:1.45}.field-error,.form-error-summary{color:#a3261f;font-size:.8rem}.form-error-summary{padding:10px 12px;border:1px solid #f0beb9;background:#fff5f4;border-radius:8px;margin-bottom:14px}.checkbox-field{justify-content:flex-end}.checkbox-field label{display:flex;gap:8px;align-items:center}.sticky-form-actions{position:sticky;bottom:0;z-index:15;padding:12px 0;background:linear-gradient(to bottom,rgba(247,249,252,0),#f7f9fc 28%);justify-content:flex-end}.credential-scope-options{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:10px;margin-bottom:14px}.credential-scope-card{display:flex;gap:9px;align-items:center;border:1px solid #d8e2ed;border-radius:9px;padding:12px 14px;background:#f9fbfe;font-weight:750;cursor:pointer}.credential-scope-card:has(input:checked){border-color:#1769d2;background:#eef5ff;color:#1358ae}.advanced-vault-details,.technical-details{border:1px solid #dce5ef;border-radius:9px;background:#f8fafc;padding:10px 12px;margin:12px 0}.advanced-vault-details>summary,.technical-details>summary{cursor:pointer;font-weight:750;color:#334b68}.technical-details pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#101b2b;color:#e7eef8;padding:10px;border-radius:7px;font-size:.72rem}.toolbar-checkbox{display:flex;align-items:center;gap:7px;white-space:nowrap;color:#435873;font-size:.82rem}.audit-human-detail{line-height:1.4;max-width:540px}.break-safe{overflow-wrap:anywhere;word-break:normal}.search-hero-panel{padding:14px}.search-hero-form{display:grid;grid-template-columns:auto minmax(260px,1fr) auto auto;align-items:center;gap:9px}.search-hero-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:9px;background:#eef5ff;color:#1769d2;font-size:1.15rem}.search-hero-input{min-height:44px;font-size:1rem}.search-summary{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:14px 0;padding:12px 16px;border:1px solid #dce5ef;border-radius:10px;background:#fff}.search-summary>div{display:flex;align-items:baseline;gap:8px}.search-summary strong{font-size:1.45rem;color:#102a4c}.search-summary span,.search-summary p{color:#6f8198}.search-summary p{margin:0;font-size:.8rem}.search-result-grid--cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.search-result-card{min-height:210px}.search-result-card .panel-header{display:flex;justify-content:space-between;align-items:flex-start}.result-count{display:inline-flex;min-width:30px;height:26px;padding:0 8px;align-items:center;justify-content:center;border-radius:999px;background:#e8f1fd;color:#1769d2;font-weight:800}.search-empty-guide{text-align:center;padding:40px 20px;color:#6f8198}.search-empty-guide strong{display:block;color:#263b57;font-size:1.05rem;margin-bottom:6px}.mini-badge{display:inline-flex;align-items:center;padding:2px 7px;border-radius:999px;background:#edf3fb;color:#50657e;font-size:.7rem;font-weight:750}.compact-action{font-size:.78rem}.kpi-card-link{cursor:pointer}.audit-kpi-card.kpi-card-link:focus-visible,.inventar-launch-card:focus-visible{outline:3px solid rgba(23,105,210,.25);outline-offset:2px}
@media(max-width:900px){.structured-form-grid,.search-result-grid--cards{grid-template-columns:1fr}.form-field-full{grid-column:auto}.search-hero-form{grid-template-columns:auto 1fr}.search-hero-form>.primary-button,.search-hero-form>.secondary-button{grid-column:auto}.credential-scope-options{grid-template-columns:1fr}}

/* NETSTYLE UX FINAL – conditional license fields */
[data-license-details].is-secondary .license-contract-field { opacity: .62; }
[data-license-details] .license-contract-field.is-muted::after { content: "Optional bei diesem Lizenztyp"; display:block; font-size:.75rem; color:var(--muted, #6b7890); margin-top:.25rem; }

/* NETSTYLE UX FINAL – finishing corrections */
.mini-badge-muted{background:#f2f5f8;color:#718198}
.customer-tabs-main>a>span{display:inline-flex;min-width:22px;height:20px;margin-left:4px;padding:0 6px;align-items:center;justify-content:center;border-radius:999px;background:#e7eef7;color:#536981;font-size:.72rem;font-weight:800}
.customer-tabs-main>a.is-active>span{background:rgba(255,255,255,.18);color:#fff}
.customer-overview-grid-large>a{display:flex;flex-direction:column;gap:5px;min-height:105px}
.customer-overview-grid-large>a span{color:#718198;font-size:.79rem;line-height:1.4}
.customer-overview-grid-large>a em{margin-top:auto;color:#1769d2;font-size:.76rem;font-style:normal;font-weight:750}
.customer-masterdata-grid a{overflow-wrap:anywhere}
.portal-pagination-placeholder{display:none}

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

.dashboard-workorder-row {
    cursor: pointer;
}
.dashboard-workorder-row:hover {
    background: #f6f9fd;
}
.dashboard-workorder-row:focus-visible {
    outline: 2px solid #1769d2;
    outline-offset: -2px;
}

.dashboard-side .activity-item {
    display: grid !important;
    grid-template-columns:
        8px minmax(0, 1fr) auto !important;
    align-items: start !important;
    column-gap: 10px !important;
}
.dashboard-side .activity-item > .activity-dot {
    grid-column: 1;
}
.dashboard-side
.activity-item
> div:not(.activity-dot) {
    grid-column: 2;
    min-width: 0;
}
.dashboard-side .activity-item .activity-open-link {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    margin: 0 0 0 auto !important;
    min-height: 32px !important;
    padding: 7px 11px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
.dashboard-side .dashboard-activity-all-button {
    min-height: 32px !important;
    padding: 7px 11px !important;
    font-size: 11px !important;
    line-height: 1 !important;
}

.activity-table-fixed {
    table-layout: fixed !important;
    min-width: 1180px;
}
.activity-table-fixed
.activity-col-time {
    width: 140px;
}
.activity-table-fixed
.activity-col-workorder {
    width: 150px;
}
.activity-table-fixed
.activity-col-checklist {
    width: 250px;
}
.activity-table-fixed
.activity-col-type {
    width: 190px;
}
.activity-table-fixed
.activity-col-user {
    width: 165px;
}
.activity-table-fixed
.activity-col-description {
    width: auto;
}
.activity-table-fixed
.activity-col-action {
    width: 90px;
}
.activity-table-fixed th:last-child,
.activity-table-fixed td:last-child {
    text-align: right;
    white-space: nowrap;
}

[data-vorgang-abschliessen]:disabled {
    cursor: not-allowed !important;
    opacity: .48 !important;
}

.pruefplan-error-panel {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    border: 1px solid #f0c7b8 !important;
    border-radius: 10px !important;
    background: #fff8f5 !important;
    color: #6f2d1d !important;
}
.pruefplan-error-panel::before {
    content: "!";
    display: inline-flex;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff0e9;
    color: #b23c18;
    font-weight: 800;
}
.pruefplan-error-panel strong,
.pruefplan-error-panel p {
    margin: 0 !important;
}
.pruefplan-error-panel p {
    margin-top: 3px !important;
}

.pruefplan-preview-list {
    align-items: stretch !important;
}
.pruefplan-preview-row {
    min-height: 118px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}
.pruefplan-preview-row
.pruefplan-weekend-shift,
.pruefplan-preview-row
.school-holiday-note {
    margin-top: 6px !important;
}

.pruefplan-form .portal-input,
.pruefplan-form select,
.pruefplan-form input,
.pruefplan-form textarea {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
.pruefplan-form select {
    min-height: 38px !important;
}

.category-template-stack {
    display: grid;
    gap: 5px;
    margin-top: 6px;
}
.category-template-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    color: #1769d2;
    text-decoration: none;
    font-weight: 600;
}
.category-template-link:hover,
.category-template-link:focus-visible {
    text-decoration: underline;
}
.category-template-meta {
    color: #7a899b;
    font-size: 11px;
}
.category-template-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eef5fd;
    color: #1769d2;
    font-weight: 800;
}
.category-template-panel
.enterprise-list-toolbar {
    margin: 0;
}
.category-template-panel
.category-template-table {
    margin-top: 12px;
}
.category-template-row[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .dashboard-side .activity-item {
        grid-template-columns:
            8px minmax(0, 1fr) !important;
    }

    .dashboard-side
    .activity-item
    .activity-open-link {
        grid-column: 2;
        grid-row: auto;
        justify-self: end;
        margin-top: 7px !important;
    }
}

/* ============================================================
   NETSTYLE PORTAL R3.3.20 - BROWSER VISUAL HARDENING
   ============================================================ */
/* NETSTYLE_PORTAL_R3_3_20_BROWSER_VISUAL_HARDENING */

.dashboard-workorder-row {
    cursor: pointer;
}
.dashboard-workorder-row:hover {
    background: #f6f9fd;
}
.dashboard-workorder-row:focus-visible {
    outline: 2px solid #1769d2;
    outline-offset: -2px;
}

/* Aktivitaeten: "Öffnen" rechtsbuendig und exakt dieselbe
   Button-Geometrie wie "Alle". */
.dashboard-side .activity-item,
.dashboard-side-column .activity-item {
    display: grid !important;
    grid-template-columns: 8px minmax(0, 1fr) auto !important;
    align-items: start !important;
    column-gap: 10px !important;
}
.dashboard-side .activity-item > .activity-dot,
.dashboard-side-column .activity-item > .activity-dot {
    grid-column: 1;
}
.dashboard-side .activity-item > div:not(.activity-dot),
.dashboard-side-column .activity-item > div:not(.activity-dot) {
    grid-column: 2;
    min-width: 0;
}
.dashboard-side .activity-item .activity-open-link,
.dashboard-side-column .activity-item .activity-open-link {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    margin: 0 !important;
}
.dashboard-side .activity-item .activity-open-link,
.dashboard-side-column .activity-item .activity-open-link,
.dashboard-side .dashboard-activity-all-button,
.dashboard-side-column .dashboard-activity-all-button {
    min-height: 32px !important;
    padding: 7px 11px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* Abschluss ist optisch und technisch gesperrt, solange das Gate false ist. */
[data-vorgang-abschliessen]:disabled {
    cursor: not-allowed !important;
    opacity: .48 !important;
}

/* Prüfplan: Hinweis als Portal-Panel statt rohem Fehlerstreifen. */
.pruefplan-error-panel {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    border: 1px solid #f0c7b8 !important;
    border-radius: 10px !important;
    background: #fff8f5 !important;
    color: #6f2d1d !important;
}
.pruefplan-error-panel::before {
    content: "!";
    display: inline-flex;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff0e9;
    color: #b23c18;
    font-weight: 800;
}
.pruefplan-error-panel strong,
.pruefplan-error-panel p {
    margin: 0 !important;
}
.pruefplan-error-panel p {
    margin-top: 3px !important;
}

/* Prüfplan-Vorschau: Karten immer gleichartig/gleichhoch. */
.pruefplan-preview-list {
    align-items: stretch !important;
}
.pruefplan-preview-row {
    min-height: 118px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}
.pruefplan-preview-row .pruefplan-weekend-shift,
.pruefplan-preview-row .school-holiday-note {
    margin-top: 6px !important;
}

/* Bearbeiten: Select/Input/Textarea ohne optische Brüche. */
.pruefplan-form .portal-input,
.pruefplan-form select,
.pruefplan-form input,
.pruefplan-form textarea {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
.pruefplan-form select {
    min-height: 38px !important;
}

@media (max-width: 900px) {
    .dashboard-side .activity-item,
    .dashboard-side-column .activity-item {
        grid-template-columns: 8px minmax(0, 1fr) !important;
    }
    .dashboard-side .activity-item .activity-open-link,
    .dashboard-side-column .activity-item .activity-open-link {
        grid-column: 2;
        grid-row: auto;
        justify-self: end;
        margin-top: 7px !important;
    }
}

/* 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;
}

/* NETSTYLE_PORTAL_R3_3_5_GLOBAL_IMAGE_LIGHTBOX compatibility */
.portal-lightbox-open {
  overflow: hidden;
}

.portal-image-lightbox[hidden] {
  display: none !important;
}

.portal-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  font-family: inherit;
}

.portal-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 17, 33, 0.90);
  backdrop-filter: blur(5px);
}

.portal-image-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1680px);
  height: min(94vh, 1050px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  background: #081729;
  box-shadow: 0 28px 90px rgba(0,0,0,0.45);
}

.portal-image-lightbox__header,
.portal-image-lightbox__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 9px 12px;
  background: #0d213b;
  color: #fff;
}

.portal-image-lightbox__header {
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.portal-image-lightbox__heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.portal-image-lightbox__heading strong {
  max-width: min(58vw, 900px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.portal-image-lightbox__heading span {
  color: #9fb3cc;
  font-size: 11px;
}

.portal-image-lightbox__header-actions,
.portal-image-lightbox__toolgroup,
.portal-image-lightbox__colors {
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-image-lightbox button {
  min-width: 34px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #f8fbff;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.portal-image-lightbox button:hover,
.portal-image-lightbox button:focus-visible,
.portal-image-lightbox button.is-active {
  border-color: rgba(96,165,250,0.9);
  background: rgba(37,99,235,0.28);
  outline: none;
}

.portal-image-lightbox__close {
  width: 38px;
  min-width: 38px !important;
  height: 38px;
  padding: 0 !important;
  font-size: 24px !important;
  line-height: 1;
}

.portal-image-lightbox__workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(-45deg, rgba(255,255,255,.025) 25%, transparent 25%) 0 14px / 28px 28px,
    #071321;
}

.portal-image-lightbox__stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
}

.portal-image-lightbox__stage.is-zoomed {
  display: block;
  overflow: auto;
}

.portal-image-lightbox__stage.is-zoomed .portal-image-lightbox__image-wrap {
  margin: 0 auto;
}

.portal-image-lightbox__image-wrap {
  position: relative;
  display: block;
  max-width: none;
  max-height: none;
}

.portal-image-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 4px;
  box-shadow: 0 10px 36px rgba(0,0,0,0.35);
}

.portal-image-lightbox__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
}

.portal-image-lightbox__canvas.is-editable { pointer-events: auto; }

.portal-image-lightbox__nav {
  align-self: center;
  justify-self: center;
  width: 42px;
  min-width: 42px !important;
  height: 64px;
  padding: 0 !important;
  border-radius: 11px !important;
  font-size: 34px !important;
  line-height: 1;
}

.portal-image-lightbox__toolbar {
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.portal-image-lightbox__toolgroup {
  padding-right: 8px;
  border-right: 1px solid rgba(255,255,255,0.12);
}

.portal-image-lightbox__colors button {
  width: 24px;
  min-width: 24px !important;
  height: 24px;
  min-height: 24px !important;
  padding: 0 !important;
  border-radius: 50%;
  background: var(--lb-color) !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}

.portal-image-lightbox__colors button.is-active {
  box-shadow: 0 0 0 2px #60a5fa, inset 0 0 0 1px rgba(0,0,0,.25);
}

.portal-image-lightbox__status {
  min-width: 170px;
  margin-left: auto;
  color: #b7c7da;
  text-align: right;
  font-size: 10px;
}

.portal-image-lightbox__status.is-error {
  color: #fecaca;
}

.portal-image-lightbox__note-editor {
  position: fixed;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(170px, 260px) auto auto;
  gap: 5px;
  padding: 7px;
  border: 1px solid #93c5fd;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}

.portal-image-lightbox__note-editor[hidden] {
  display: none !important;
}

.portal-image-lightbox__note-editor input {
  min-width: 0;
  height: 34px;
  border: 1px solid #d5dfeb;
  border-radius: 7px;
  padding: 0 9px;
  color: #172b46;
  font: inherit;
  font-size: 11px;
}

.portal-image-lightbox__note-editor button {
  min-height: 34px;
  background: #1769d2;
}

.knowledge-image-card > a,
.knowledge-existing-image > a,
.runtime-image-card-preview,
[data-portal-image-lightbox] {
  cursor: zoom-in;
}

@media (max-width: 900px) {
  .portal-image-lightbox__dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .portal-image-lightbox__workspace {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .portal-image-lightbox__stage {
    padding: 12px;
  }

  .portal-image-lightbox__image {
    max-width: calc(100vw - 108px);
    max-height: calc(100vh - 180px);
  }

  .portal-image-lightbox__header-actions .portal-image-lightbox__button {
    display: none;
  }

  .portal-image-lightbox__status {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }
}


/* NETSTYLE_PORTAL_R3_3_6_PERSISTENT_EDITABLE_IMAGE_LIGHTBOX */
.portal-image-lightbox__edit-controls { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.portal-image-lightbox__save.is-dirty { border-color:#86efac; background:#166534; }
.portal-image-lightbox__custom-color { display:inline-flex; align-items:center; gap:5px; min-height:30px; padding:2px 7px; border:1px solid rgba(255,255,255,.14); border-radius:8px; color:#d6e2f1; font-size:10px; }
.portal-image-lightbox__custom-color input { width:28px; height:24px; padding:0; border:0; border-radius:5px; background:transparent; cursor:pointer; }
.portal-image-lightbox [hidden] { display:none !important; }

/* ============================================================
   NETSTYLE PORTAL R3.3.7 - ANNOTATED THUMBNAIL PREVIEW
   ============================================================ */
/* NETSTYLE_PORTAL_R3_3_8_ANNOTATED_THUMBNAIL_SVG_PREVIEW */
a[data-lightbox-annotations-url] {
    position: relative !important;
    isolation: isolate;
}

.portal-image-thumbnail-annotations {
    position: absolute !important;
    inset: 0 !important;
    z-index: 3 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

a[data-lightbox-annotations-url] > img {
    position: relative;
    z-index: 1;
}
/* NETSTYLE_PORTAL_R3_3_8_ANNOTATED_THUMBNAIL_SVG_PREVIEW_END */

/* NETSTYLE_TECHNIKPORTAL_R3_3_29_THEME */
:root {
  --portal-brand-primary: #1769D2;
  --portal-brand-hover: #1458AF;
  --portal-brand-active: #10488E;
  --portal-brand-soft: #E8F1FC;
  --portal-brand-on-primary: #FFFFFF;
  --portal-bg: #F5F8FC;
  --portal-surface: #FFFFFF;
  --portal-surface-raised: #FFFFFF;
  --portal-surface-muted: #F8FAFC;
  --portal-text: #12233D;
  --portal-text-muted: #65778E;
  --portal-border: #D7E0EB;
  --portal-border-strong: #BFCBDD;
  --portal-focus: var(--portal-brand-primary);
  --portal-shadow: 0 8px 26px rgba(18,35,61,.08);
  --portal-sidebar: #0B1F38;
  --portal-sidebar-text: #F8FBFF;
  --portal-sidebar-muted: #BFD0E4;
  --portal-success: #15803D;
  --portal-warning: #B45309;
  --portal-danger: #B42318;
  --portal-info: #1769D2;
}

:root { --portal-focus: var(--portal-brand-accent, var(--portal-brand-primary)); }

html[data-theme-mode="dark"] {
  --portal-bg: #0B1220;
  --portal-surface: #111C2D;
  --portal-surface-raised: #152238;
  --portal-surface-muted: #0E192A;
  --portal-text: #E8EEF7;
  --portal-text-muted: #A9B8CC;
  --portal-border: #2A3A51;
  --portal-border-strong: #3B4F6A;
  --portal-shadow: 0 10px 30px rgba(0,0,0,.28);
  --portal-sidebar: #07111F;
  --portal-sidebar-text: #F8FBFF;
  --portal-sidebar-muted: #AFC0D5;
}

@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] {
    --portal-bg: #0B1220;
    --portal-surface: #111C2D;
    --portal-surface-raised: #152238;
    --portal-surface-muted: #0E192A;
    --portal-text: #E8EEF7;
    --portal-text-muted: #A9B8CC;
    --portal-border: #2A3A51;
    --portal-border-strong: #3B4F6A;
    --portal-shadow: 0 10px 30px rgba(0,0,0,.28);
    --portal-sidebar: #07111F;
    --portal-sidebar-text: #F8FBFF;
    --portal-sidebar-muted: #AFC0D5;
  }
}

html[data-color-mode="monochrom"] {
  --portal-brand-primary: #475569 !important;
  --portal-brand-hover: #334155 !important;
  --portal-brand-active: #1E293B !important;
  --portal-brand-soft: #F1F5F9 !important;
  --portal-brand-on-primary: #FFFFFF !important;
}
html[data-color-mode="kontrast"] {
  --portal-brand-primary: #005FCC !important;
  --portal-brand-hover: #004A9F !important;
  --portal-brand-active: #003A7D !important;
  --portal-brand-soft: #E6F1FF !important;
  --portal-brand-on-primary: #FFFFFF !important;
  --portal-border: #64748B;
  --portal-border-strong: #334155;
}

html, body { color-scheme: light; }
html[data-theme-mode="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { html[data-theme-mode="system"] { color-scheme: dark; } }

body, .main-column, .content { background: var(--portal-bg) !important; color: var(--portal-text) !important; }
.sidebar { background: var(--portal-brand-sidebar, var(--portal-sidebar)) !important; color: var(--portal-sidebar-text) !important; }
.sidebar-footer, .brand-sub { color: var(--portal-sidebar-muted) !important; }
.brand-link { text-decoration: none !important; color: inherit !important; }
.brand-text-wrap { display: flex; flex-direction: column; min-width: 0; }
.brand-logo-image { display:block; width:100%; height:44px; object-fit:contain; object-position:left center; }

.topbar, .panel, .portal-card, .dashboard-card, fieldset, .user-menu-dropdown,
.audit-note, .compact-list > a, .compact-list > div {
  background: var(--portal-surface) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
.panel { box-shadow: var(--portal-shadow); }
.page-heading h1, .panel h2, .panel h3, legend, strong { color: var(--portal-text); }
.page-heading p, .panel p, small, .fieldset-help, .user-data span { color: var(--portal-text-muted) !important; }

.portal-input, input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  background: var(--portal-surface-raised) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
.portal-input:focus, input:focus, select:focus, textarea:focus { border-color: var(--portal-focus) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-focus) 18%, transparent) !important; }

.primary-button, button.primary-button, a.primary-button,
.search-submit, .progress-bar > span, .status-progress-fill {
  background: var(--portal-brand-primary) !important;
  color: var(--portal-brand-on-primary) !important;
  border-color: var(--portal-brand-primary) !important;
}
.primary-button:hover, button.primary-button:hover, a.primary-button:hover { background: var(--portal-brand-hover) !important; border-color: var(--portal-brand-hover) !important; }
.primary-button:active { background: var(--portal-brand-active) !important; }
.secondary-button, a.secondary-button, button.secondary-button {
  background: var(--portal-surface) !important;
  color: var(--portal-brand-primary) !important;
  border-color: var(--portal-border-strong) !important;
}
.secondary-button:hover { background: var(--portal-brand-soft) !important; border-color: var(--portal-brand-primary) !important; }
.table-link, a:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) { color: var(--portal-brand-primary); }

.workorder-table th { background: var(--portal-surface-muted) !important; color: var(--portal-text) !important; border-color: var(--portal-border) !important; }
.workorder-table td { background: var(--portal-surface) !important; color: var(--portal-text) !important; border-color: var(--portal-border) !important; }
.workorder-table tbody tr:hover td { background: color-mix(in srgb, var(--portal-brand-soft) 55%, var(--portal-surface)) !important; }
.table-sort { color: var(--portal-text) !important; }
.table-sort.is-active { color: var(--portal-brand-primary) !important; }

.nav-item { color: var(--portal-sidebar-muted) !important; }
.nav-item:hover, .nav-item.is-active, .navigation .nav-item[aria-current="page"] { background: color-mix(in srgb, var(--portal-brand-primary) 24%, transparent) !important; color: #fff !important; }

.user-menu-trigger { display:flex; align-items:center; gap:9px; border:0; background:transparent; padding:3px 5px; border-radius:9px; cursor:pointer; color:var(--portal-text); }
.user-menu-trigger:hover, .user-menu-trigger[aria-expanded="true"] { background: var(--portal-surface-muted); }
.user-menu-chevron { color:var(--portal-text-muted); font-size:15px; }
.portal-user-menu { position:relative; }
.user-menu-dropdown { position:absolute; z-index:1500; right:0; top:calc(100% + 8px); min-width:255px; padding:8px; border:1px solid var(--portal-border); border-radius:12px; box-shadow:var(--portal-shadow); }
.user-menu-dropdown[hidden] { display:none !important; }
.user-menu-dropdown a, .user-menu-logout { display:flex; width:100%; box-sizing:border-box; align-items:center; min-height:38px; padding:8px 10px; border:0; border-radius:8px; background:transparent; color:var(--portal-text) !important; text-decoration:none; text-align:left; font:inherit; cursor:pointer; }
.user-menu-dropdown a:hover, .user-menu-logout:hover { background:var(--portal-brand-soft) !important; color:var(--portal-brand-primary) !important; }
.user-menu-heading { display:flex; flex-direction:column; padding:8px 10px 10px; }
.user-menu-heading span { color:var(--portal-text-muted); font-size:12px; }
.user-menu-divider { height:1px; background:var(--portal-border); margin:6px 4px; }
.user-menu-dropdown form { margin:0; }

.organisation-branding-grid { display:grid; grid-template-columns:minmax(220px, .7fr) minmax(320px, 1.3fr); gap:22px; align-items:start; }
.organisation-logo-card, .organisation-branding-fields { min-width:0; }
.organisation-logo-preview { min-height:112px; border:1px dashed var(--portal-border-strong); border-radius:12px; display:flex; align-items:center; justify-content:center; padding:16px; margin-top:8px; background:var(--portal-surface-muted); }
.organisation-logo-preview img { display:block; max-width:100%; max-height:92px; object-fit:contain; }
.organisation-logo-fallback { display:flex; flex-direction:column; color:var(--portal-text); }
.organisation-logo-fallback strong { font-size:26px; }
.organisation-logo-fallback span { color:var(--portal-text-muted); font-size:12px; }
.brand-color-row { display:grid; grid-template-columns:minmax(0,1fr) 48px 34px; gap:8px; align-items:center; }
.brand-color-row input[type="color"] { width:48px !important; min-height:38px; padding:3px !important; }
.brand-color-swatch { width:32px; height:32px; border:1px solid var(--portal-border); border-radius:8px; }
[data-custom-color-field].is-muted { opacity:.68; }

.worktime-table { display:grid; gap:8px; margin-top:16px; }
.worktime-row { display:grid; grid-template-columns:minmax(130px,1.25fr) repeat(3,minmax(105px,1fr)); gap:10px; align-items:start; padding:10px; border:1px solid var(--portal-border); border-radius:10px; background:var(--portal-surface-muted); }
.worktime-row--head { font-size:12px; font-weight:700; color:var(--portal-text-muted); background:transparent; border:0; padding:0 10px 3px; }
.worktime-row.is-disabled { opacity:.48; }
.worktime-row .field-error { margin-top:4px; }

.report-kpi-grid, .audit-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.report-kpi, .audit-kpi { border:1px solid var(--portal-border); border-radius:12px; background:var(--portal-surface); padding:14px 16px; min-width:0; }
.report-kpi span, .audit-kpi span { display:block; color:var(--portal-text-muted); font-size:12px; }
.report-kpi strong, .audit-kpi strong { display:block; margin-top:4px; font-size:24px; }
.report-section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:16px; }
.report-filter { display:grid; grid-template-columns:repeat(4,minmax(140px,1fr)) auto; gap:10px; align-items:end; }
.report-filter label { display:grid; gap:5px; font-size:12px; font-weight:700; color:var(--portal-text-muted); }
.report-meter { height:7px; border-radius:999px; overflow:hidden; background:var(--portal-border); min-width:90px; }
.report-meter > span { display:block; height:100%; background:var(--portal-brand-primary); }
.audit-summary-panel { margin-bottom:16px; }
.audit-result-caption { color:var(--portal-text-muted); font-size:12px; margin:10px 0 0; }

html[data-density="kompakt"] .workorder-table th,
html[data-density="kompakt"] .workorder-table td { padding-top:7px !important; padding-bottom:7px !important; }
html[data-density="kompakt"] .panel { padding-top:12px !important; padding-bottom:12px !important; }
html[data-density="kompakt"] .portal-input { min-height:34px !important; }

html[data-reduce-motion="1"] *, html[data-reduce-motion="1"] *::before, html[data-reduce-motion="1"] *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; } }

html[data-theme-mode="dark"] .status-badge,
html[data-theme-mode="dark"] .audit-value,
html[data-theme-mode="dark"] .calendar-toggle-card,
html[data-theme-mode="dark"] .weekday-card { filter:saturate(.9) brightness(.94); }
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] .status-badge,
  html[data-theme-mode="system"] .audit-value,
  html[data-theme-mode="system"] .calendar-toggle-card,
  html[data-theme-mode="system"] .weekday-card { filter:saturate(.9) brightness(.94); }
}

@media (max-width: 1050px) {
  .report-kpi-grid, .audit-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-section-grid, .organisation-branding-grid { grid-template-columns:1fr; }
  .report-filter { grid-template-columns:repeat(2,minmax(140px,1fr)); }
}
@media (max-width: 700px) {
  .worktime-row, .worktime-row--head { grid-template-columns:1fr; }
  .worktime-row--head { display:none; }
  .report-kpi-grid, .audit-kpi-grid, .report-filter { grid-template-columns:1fr; }
  .user-menu-trigger .user-data { display:none; }
}

/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R5 – browser audit hardening              */
/* ========================================================================== */

/* Subnavigation: active state must remain legible even though the generic
   branded-link rule above is more specific than the legacy subnav selector. */
.portal-subnav,
.customer-tabs {
  background: var(--portal-surface-muted) !important;
  border-color: var(--portal-border) !important;
}
.portal-subnav a,
.customer-tabs > a {
  color: var(--portal-text) !important;
}
.portal-subnav a:hover,
.customer-tabs > a:hover {
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
}
.portal-subnav a.is-active,
.customer-tabs > a.is-active {
  background: var(--portal-brand-primary) !important;
  border-color: var(--portal-brand-primary) !important;
  color: var(--portal-brand-on-primary) !important;
}
.portal-subnav a.is-active:hover,
.customer-tabs > a.is-active:hover {
  background: var(--portal-brand-hover) !important;
  color: var(--portal-brand-on-primary) !important;
}

/* Branding editor */
.organisation-branding-editor {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(480px, 1.45fr);
  gap: 18px;
  align-items: start;
}
.branding-editor-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: var(--portal-surface-muted);
}
.branding-block-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.branding-block-heading h3 { margin: 0 0 3px; }
.branding-block-heading p { margin: 0; }

.organisation-logo-preview {
  min-height: 118px;
  margin: 0 0 12px;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  background: var(--portal-surface);
}
.organisation-logo-dropzone.portal-dropzone--builder {
  min-height: 132px !important;
  border-color: var(--portal-border-strong) !important;
  background: var(--portal-surface) !important;
}
.organisation-logo-dropzone.portal-dropzone--builder:hover,
.organisation-logo-dropzone.portal-dropzone--builder.is-dragover {
  border-color: var(--portal-brand-primary) !important;
  background: var(--portal-brand-soft) !important;
}
.organisation-logo-dropzone .portal-dropzone-icon {
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
}
.organisation-logo-dropzone .portal-dropzone-title { color: var(--portal-text) !important; }
.organisation-logo-dropzone .portal-dropzone-copy,
.organisation-logo-dropzone .portal-dropzone-file { color: var(--portal-text-muted) !important; }
.branding-logo-remove { margin-top: 10px; }

.branding-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.branding-preset-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 78px;
  padding: 11px;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  background: var(--portal-surface);
  cursor: pointer;
  box-sizing: border-box;
}
.branding-preset-card:hover {
  border-color: var(--portal-brand-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--portal-brand-accent) 12%, transparent);
}
.branding-preset-card.is-selected {
  border-color: var(--portal-brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--portal-brand-primary) 16%, transparent);
}
.branding-preset-card input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.branding-preset-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  height: 18px;
}
.branding-preset-swatches i {
  display: block;
  min-width: 0;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--portal-border-strong) 70%, transparent);
  background: var(--portal-surface-muted);
}
.branding-custom-palette {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.brand-color-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 32px;
  gap: 7px;
  align-items: center;
}
.brand-color-control input[type="color"] {
  width: 46px !important;
  min-height: 38px !important;
  padding: 3px !important;
}
.branding-live-preview {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 130px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: var(--portal-surface);
}
.branding-preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 12px;
  background: var(--branding-preview-sidebar, var(--portal-brand-sidebar));
}
.branding-preview-sidebar span {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
}
.branding-preview-main { padding: 16px; }
.branding-preview-main p { margin: 4px 0 12px; }
.branding-preview-main button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: var(--branding-preview-primary, var(--portal-brand-primary));
  color: #fff;
  font: inherit;
  font-weight: 700;
}
.branding-preview-accent {
  width: 58px;
  height: 7px;
  margin-bottom: 11px;
  border-radius: 999px;
  background: var(--branding-preview-accent, var(--portal-brand-accent));
}
.branding-profile-manager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--portal-border);
}
.branding-profile-load,
.branding-profile-save {
  display: grid;
  gap: 8px;
  align-content: start;
}
.branding-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Calendar/worktime layout */
.organisation-worktime-panel { margin-bottom: 16px; }
.calendar-policy-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
  align-items: stretch;
}

/* Stronger dark-mode coverage for legacy components that still carry hardcoded
   light backgrounds in the consolidated design baseline. */
html[data-theme-mode="dark"] body,
html[data-theme-mode="dark"] .main-column,
html[data-theme-mode="dark"] .content,
html[data-theme-mode="dark"] .page-shell,
html[data-theme-mode="dark"] .portal-page {
  background: var(--portal-bg) !important;
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] .topbar,
html[data-theme-mode="dark"] .panel,
html[data-theme-mode="dark"] fieldset,
html[data-theme-mode="dark"] .portal-card,
html[data-theme-mode="dark"] .dashboard-card,
html[data-theme-mode="dark"] .kpi-card,
html[data-theme-mode="dark"] .calendar-toggle-card,
html[data-theme-mode="dark"] .weekday-card,
html[data-theme-mode="dark"] .enterprise-list-toolbar-panel,
html[data-theme-mode="dark"] .portal-confirm-dialog,
html[data-theme-mode="dark"] .portal-message,
html[data-theme-mode="dark"] .branding-editor-block,
html[data-theme-mode="dark"] .branding-preset-card,
html[data-theme-mode="dark"] .branding-live-preview,
html[data-theme-mode="dark"] .organisation-logo-preview,
html[data-theme-mode="dark"] .organisation-logo-dropzone.portal-dropzone--builder {
  background: var(--portal-surface) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html[data-theme-mode="dark"] .portal-subnav,
html[data-theme-mode="dark"] .customer-tabs,
html[data-theme-mode="dark"] .worktime-row,
html[data-theme-mode="dark"] .compact-list > a,
html[data-theme-mode="dark"] .compact-list > div {
  background: var(--portal-surface-muted) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html[data-theme-mode="dark"] .portal-dropzone--builder .portal-dropzone-title,
html[data-theme-mode="dark"] label,
html[data-theme-mode="dark"] .portal-field label,
html[data-theme-mode="dark"] .form-field label {
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] .shortcut {
  background: var(--portal-surface-muted) !important;
  border-color: var(--portal-border) !important;
  color: var(--portal-text-muted) !important;
}

@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] body,
  html[data-theme-mode="system"] .main-column,
  html[data-theme-mode="system"] .content {
    background: var(--portal-bg) !important;
    color: var(--portal-text) !important;
  }
}

@media (max-width: 1180px) {
  .organisation-branding-editor { grid-template-columns: 1fr; }
  .branding-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branding-custom-palette { grid-template-columns: 1fr; }
  .calendar-policy-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .branding-preset-grid,
  .branding-profile-manager { grid-template-columns: 1fr; }
}

/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R7 – browser visual consistency            */
/* ========================================================================== */

/* Topbar search: one coherent portal control, no browser-default fragments. */
.global-search {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  width: min(720px, 60vw) !important;
  height: 40px !important;
  padding: 3px 4px 3px 12px !important;
  border: 1px solid var(--portal-border) !important;
  border-radius: 10px !important;
  background: var(--portal-surface-raised) !important;
  box-shadow: none !important;
}
.global-search:focus-within {
  border-color: var(--portal-focus) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-focus) 16%, transparent) !important;
}
.global-search-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  margin-left: 1px;
  border: 2px solid var(--portal-text-muted);
  border-radius: 50%;
  box-sizing: border-box;
}
.global-search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--portal-text-muted);
  transform: rotate(45deg);
  transform-origin: left center;
}
.global-search input[type="search"] {
  width: 100% !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--portal-text) !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.global-search input[type="search"]::placeholder { color: var(--portal-text-muted) !important; opacity: .9; }
.global-search-submit.search-submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: auto !important;
  min-width: 92px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
}
.global-search-submit kbd {
  padding: 2px 5px;
  border: 1px solid color-mix(in srgb, var(--portal-brand-on-primary) 36%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--portal-brand-on-primary) 12%, transparent);
  color: inherit;
  font: inherit;
  font-size: 9px;
  font-weight: 700;
}

/* The consolidated legacy CSS contains !important light surfaces with higher
   selector specificity. Dark mode must beat those contracts explicitly. */
html[data-theme-mode="dark"] .portal-form.structured-form > fieldset,
html[data-theme-mode="dark"] .structured-form fieldset,
html[data-theme-mode="dark"] .user-work-calendar,
html[data-theme-mode="dark"] .personal-settings-panel .portal-form > fieldset {
  background: var(--portal-surface) !important;
  border-color: var(--portal-border) !important;
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] .portal-form.structured-form > fieldset > legend,
html[data-theme-mode="dark"] .structured-form fieldset > legend,
html[data-theme-mode="dark"] .user-work-calendar > legend {
  background: var(--portal-surface) !important;
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] .category-card,
html[data-theme-mode="dark"] .dashboard-category-link,
html[data-theme-mode="dark"] .customer-overview-grid a,
html[data-theme-mode="dark"] .inventar-launch-card,
html[data-theme-mode="dark"] .audit-kpi-card,
html[data-theme-mode="dark"] .search-summary,
html[data-theme-mode="dark"] .customer-autocomplete-list,
html[data-theme-mode="dark"] .credential-access-row,
html[data-theme-mode="dark"] .credential-context-grid > div,
html[data-theme-mode="dark"] .credential-technical-grid > div {
  background: var(--portal-surface-raised) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html[data-theme-mode="dark"] .dashboard-category-link:hover,
html[data-theme-mode="dark"] .customer-overview-grid a:hover,
html[data-theme-mode="dark"] .inventar-launch-card:hover {
  background: color-mix(in srgb, var(--portal-brand-primary) 10%, var(--portal-surface-raised)) !important;
  border-color: var(--portal-brand-primary) !important;
}
html[data-theme-mode="dark"] .dashboard-category-copy > strong,
html[data-theme-mode="dark"] .search-summary strong,
html[data-theme-mode="dark"] .search-empty-guide strong {
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] .dashboard-category-copy > span,
html[data-theme-mode="dark"] .search-summary span,
html[data-theme-mode="dark"] .search-summary p,
html[data-theme-mode="dark"] .search-empty-guide {
  color: var(--portal-text-muted) !important;
}
html[data-theme-mode="dark"] .activity-item .activity-open-link {
  background: var(--portal-surface-raised) !important;
  color: var(--portal-brand-accent) !important;
  border-color: var(--portal-border-strong) !important;
}
html[data-theme-mode="dark"] .activity-item .activity-open-link:hover,
html[data-theme-mode="dark"] .activity-item .activity-open-link:focus-visible {
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
  border-color: var(--portal-brand-primary) !important;
}

/* Dashboard action buttons: restore the agreed rectangular standard instead of
   the historical 54x30 micro-buttons. */
.dashboard-side-column .dashboard-activity-all-button,
.dashboard-side-column .activity-item .activity-open-link,
.dashboard-side .dashboard-activity-all-button,
.dashboard-side .activity-item .activity-open-link {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 11px !important;
  margin: 0 !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
.dashboard-side-column .activity-item,
.dashboard-side .activity-item {
  grid-template-columns: 8px minmax(0, 1fr) 88px !important;
}

/* Logo chooser: explicit browser interaction target in addition to drag/drop. */
.organisation-logo-dropzone {
  cursor: pointer !important;
}
.organisation-logo-dropzone .logo-choose-button {
  margin-top: 8px;
  min-width: 148px !important;
}
.organisation-logo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.organisation-logo-actions .primary-button,
.organisation-logo-actions .secondary-button {
  min-width: 148px !important;
}

/* Branding is an actual live portal preview, not an isolated decorative card. */
.branding-live-notice {
  margin: 0 0 10px;
  color: var(--portal-text-muted);
  font-size: 11px;
}
.branding-save-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.branding-save-row .primary-button { min-width: 160px !important; }

/* Report drill-down affordance. */
a.report-kpi,
a.report-row-link {
  color: inherit !important;
  text-decoration: none !important;
}
a.report-kpi {
  display: block;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease, background .15s ease;
}
a.report-kpi:hover,
a.report-kpi:focus-visible {
  border-color: var(--portal-brand-primary) !important;
  background: color-mix(in srgb, var(--portal-brand-soft) 35%, var(--portal-surface)) !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--portal-brand-primary) 10%, transparent);
  transform: translateY(-1px);
  outline: none;
}
.report-row-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--portal-brand-primary) !important;
}
.report-row-link::after { content: "→"; font-size: .9em; }
.report-detail-panel { margin-top: 16px; }
.report-detail-heading { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.report-detail-heading .secondary-button { min-width: 120px !important; }

@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] .portal-form.structured-form > fieldset,
  html[data-theme-mode="system"] .structured-form fieldset,
  html[data-theme-mode="system"] .category-card,
  html[data-theme-mode="system"] .dashboard-category-link {
    background: var(--portal-surface) !important;
    color: var(--portal-text) !important;
    border-color: var(--portal-border) !important;
  }
}

@media (max-width: 760px) {
  .global-search { width: 100% !important; grid-template-columns: 18px minmax(0,1fr) 38px !important; }
  .global-search-submit.search-submit { min-width: 38px !important; width: 38px !important; padding:0 !important; }
  .global-search-submit span, .global-search-submit kbd { display:none; }
  .global-search-submit::before { content:"→"; }
}

/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R8 – CENTRAL DESIGN SYSTEM                 */
/* ========================================================================== */

/* Map the organisation's persisted light/dark palette to the historical
   portal tokens. All feature CSS should consume these active tokens. */
:root,
html[data-theme-mode="light"] {
  --portal-brand-primary: var(--ns-light-primary) !important;
  --portal-brand-accent: var(--ns-light-accent) !important;
  --portal-link: var(--ns-light-link) !important;
  --portal-brand-sidebar: var(--ns-light-nav-bg) !important;
  --portal-sidebar: var(--ns-light-nav-bg) !important;
  --portal-sidebar-text: var(--ns-light-nav-text) !important;
  --portal-sidebar-muted: color-mix(in srgb, var(--ns-light-nav-text) 72%, transparent) !important;
  --portal-nav-active-bg: var(--ns-light-nav-active-bg) !important;
  --portal-nav-active-text: var(--ns-light-nav-active-text) !important;
  --portal-button-primary-bg: var(--ns-light-button-primary-bg) !important;
  --portal-button-primary-text: var(--ns-light-button-primary-text) !important;
  --portal-button-primary-hover: var(--ns-light-button-primary-hover) !important;
  --portal-button-secondary-bg: var(--ns-light-button-secondary-bg) !important;
  --portal-button-secondary-text: var(--ns-light-button-secondary-text) !important;
  --portal-button-secondary-border: var(--ns-light-button-secondary-border) !important;
  --portal-heading: var(--ns-light-heading) !important;
  --portal-text: var(--ns-light-text) !important;
  --portal-text-muted: var(--ns-light-text-secondary) !important;
  --portal-bg: var(--ns-light-surface-page) !important;
  --portal-surface: var(--ns-light-surface-card) !important;
  --portal-surface-raised: var(--ns-light-surface-raised) !important;
  --portal-border: var(--ns-light-border) !important;
  --portal-border-strong: color-mix(in srgb, var(--ns-light-border) 72%, var(--ns-light-text) 28%) !important;
  --portal-focus: var(--ns-light-focus) !important;
  --portal-brand-hover: var(--ns-light-button-primary-hover) !important;
  --portal-brand-active: color-mix(in srgb, var(--ns-light-button-primary-hover) 82%, #000 18%) !important;
  --portal-brand-on-primary: var(--ns-light-button-primary-text) !important;
  --portal-brand-soft: color-mix(in srgb, var(--ns-light-primary) 10%, var(--ns-light-surface-card)) !important;
  --portal-brand-accent-soft: color-mix(in srgb, var(--ns-light-accent) 12%, var(--ns-light-surface-card)) !important;
  --portal-surface-muted: color-mix(in srgb, var(--ns-light-surface-page) 58%, var(--ns-light-surface-card)) !important;
  color-scheme: light;
}

html[data-theme-mode="dark"] {
  --portal-brand-primary: var(--ns-dark-primary) !important;
  --portal-brand-accent: var(--ns-dark-accent) !important;
  --portal-link: var(--ns-dark-link) !important;
  --portal-brand-sidebar: var(--ns-dark-nav-bg) !important;
  --portal-sidebar: var(--ns-dark-nav-bg) !important;
  --portal-sidebar-text: var(--ns-dark-nav-text) !important;
  --portal-sidebar-muted: color-mix(in srgb, var(--ns-dark-nav-text) 72%, transparent) !important;
  --portal-nav-active-bg: var(--ns-dark-nav-active-bg) !important;
  --portal-nav-active-text: var(--ns-dark-nav-active-text) !important;
  --portal-button-primary-bg: var(--ns-dark-button-primary-bg) !important;
  --portal-button-primary-text: var(--ns-dark-button-primary-text) !important;
  --portal-button-primary-hover: var(--ns-dark-button-primary-hover) !important;
  --portal-button-secondary-bg: var(--ns-dark-button-secondary-bg) !important;
  --portal-button-secondary-text: var(--ns-dark-button-secondary-text) !important;
  --portal-button-secondary-border: var(--ns-dark-button-secondary-border) !important;
  --portal-heading: var(--ns-dark-heading) !important;
  --portal-text: var(--ns-dark-text) !important;
  --portal-text-muted: var(--ns-dark-text-secondary) !important;
  --portal-bg: var(--ns-dark-surface-page) !important;
  --portal-surface: var(--ns-dark-surface-card) !important;
  --portal-surface-raised: var(--ns-dark-surface-raised) !important;
  --portal-border: var(--ns-dark-border) !important;
  --portal-border-strong: color-mix(in srgb, var(--ns-dark-border) 68%, var(--ns-dark-text) 32%) !important;
  --portal-focus: var(--ns-dark-focus) !important;
  --portal-brand-hover: var(--ns-dark-button-primary-hover) !important;
  --portal-brand-active: color-mix(in srgb, var(--ns-dark-button-primary-hover) 80%, #fff 20%) !important;
  --portal-brand-on-primary: var(--ns-dark-button-primary-text) !important;
  --portal-brand-soft: color-mix(in srgb, var(--ns-dark-primary) 15%, var(--ns-dark-surface-card)) !important;
  --portal-brand-accent-soft: color-mix(in srgb, var(--ns-dark-accent) 15%, var(--ns-dark-surface-card)) !important;
  --portal-surface-muted: color-mix(in srgb, var(--ns-dark-surface-page) 50%, var(--ns-dark-surface-card)) !important;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] {
    --portal-brand-primary: var(--ns-dark-primary) !important;
    --portal-brand-accent: var(--ns-dark-accent) !important;
    --portal-link: var(--ns-dark-link) !important;
    --portal-brand-sidebar: var(--ns-dark-nav-bg) !important;
    --portal-sidebar: var(--ns-dark-nav-bg) !important;
    --portal-sidebar-text: var(--ns-dark-nav-text) !important;
    --portal-sidebar-muted: color-mix(in srgb, var(--ns-dark-nav-text) 72%, transparent) !important;
    --portal-nav-active-bg: var(--ns-dark-nav-active-bg) !important;
    --portal-nav-active-text: var(--ns-dark-nav-active-text) !important;
    --portal-button-primary-bg: var(--ns-dark-button-primary-bg) !important;
    --portal-button-primary-text: var(--ns-dark-button-primary-text) !important;
    --portal-button-primary-hover: var(--ns-dark-button-primary-hover) !important;
    --portal-button-secondary-bg: var(--ns-dark-button-secondary-bg) !important;
    --portal-button-secondary-text: var(--ns-dark-button-secondary-text) !important;
    --portal-button-secondary-border: var(--ns-dark-button-secondary-border) !important;
    --portal-heading: var(--ns-dark-heading) !important;
    --portal-text: var(--ns-dark-text) !important;
    --portal-text-muted: var(--ns-dark-text-secondary) !important;
    --portal-bg: var(--ns-dark-surface-page) !important;
    --portal-surface: var(--ns-dark-surface-card) !important;
    --portal-surface-raised: var(--ns-dark-surface-raised) !important;
    --portal-border: var(--ns-dark-border) !important;
    --portal-border-strong: color-mix(in srgb, var(--ns-dark-border) 68%, var(--ns-dark-text) 32%) !important;
    --portal-focus: var(--ns-dark-focus) !important;
    --portal-brand-hover: var(--ns-dark-button-primary-hover) !important;
    --portal-brand-active: color-mix(in srgb, var(--ns-dark-button-primary-hover) 80%, #fff 20%) !important;
    --portal-brand-on-primary: var(--ns-dark-button-primary-text) !important;
    --portal-brand-soft: color-mix(in srgb, var(--ns-dark-primary) 15%, var(--ns-dark-surface-card)) !important;
    --portal-brand-accent-soft: color-mix(in srgb, var(--ns-dark-accent) 15%, var(--ns-dark-surface-card)) !important;
    --portal-surface-muted: color-mix(in srgb, var(--ns-dark-surface-page) 50%, var(--ns-dark-surface-card)) !important;
    color-scheme: dark;
  }
}

/* Central typography and surfaces: overrides historical hardcoded light colors. */
html body,
html .main-column,
html .content,
html .portal-page,
html .page-shell { background: var(--portal-bg) !important; color: var(--portal-text) !important; }
html h1, html h2, html h3, html h4, html h5, html h6,
html legend, html .page-heading h1, html .panel h2, html .panel h3,
html .builder-title-row strong, html .builder-section-heading h2 { color: var(--portal-heading) !important; }
html p, html td, html .builder-content, html .builder-content p,
html .builder-section-heading p, html .builder-meta, html .builder-section-meta { color: var(--portal-text) !important; }
html small, html .helptext, html .fieldset-help, html .muted,
html .page-heading p, html .user-data span { color: var(--portal-text-muted) !important; }
html a:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) { color: var(--portal-link) !important; }

html .topbar, html .panel, html .portal-card, html .dashboard-card, html .kpi-card,
html fieldset, html .user-menu-dropdown, html .audit-note,
html .compact-list > a, html .compact-list > div,
html .builder-item, html .builder-section, html .section-point-list,
html .builder-list, html .builder-summary, html .editor-panel,
html .properties-panel, html .property-panel, html .template-editor-panel {
  background: var(--portal-surface) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html .builder-section-header, html .builder-section-footer, html .section-empty,
html .portal-subnav, html .customer-tabs, html .worktime-row,
html .field-type-badge, html .weekday-card, html .calendar-toggle-card {
  background: var(--portal-surface-muted) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html .portal-form.structured-form > fieldset,
html .portal-form.structured-form > fieldset > legend,
html .portal-form.structured-form .advanced-vault-details,
html .portal-form.structured-form .credential-scope-card {
  background: var(--portal-surface) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html .portal-form.structured-form .form-field > label,
html .portal-form.structured-form .portal-field > label,
html .portal-form.structured-form .field-label { color: var(--portal-heading) !important; }
html .portal-form.structured-form small,
html .portal-form.structured-form .helptext,
html .portal-form.structured-form .fieldset-help { color: var(--portal-text-muted) !important; }

/* Native form controls including the opened-select fallback where supported. */
html input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html select, html textarea, html .portal-input {
  background: var(--portal-surface-raised) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html select option, html select optgroup {
  background: var(--portal-surface-raised) !important;
  color: var(--portal-text) !important;
}
html input::placeholder, html textarea::placeholder { color: var(--portal-text-muted) !important; opacity: .9; }

/* Buttons are true design tokens, not aliases of the primary brand color. */
html .primary-button, html button.primary-button, html a.primary-button,
html .search-submit, html .global-search-submit {
  background: var(--portal-button-primary-bg) !important;
  color: var(--portal-button-primary-text) !important;
  border-color: var(--portal-button-primary-bg) !important;
}
html .primary-button:hover, html button.primary-button:hover, html a.primary-button:hover,
html .search-submit:hover { background: var(--portal-button-primary-hover) !important; border-color: var(--portal-button-primary-hover) !important; }
html .secondary-button, html a.secondary-button, html button.secondary-button {
  background: var(--portal-button-secondary-bg) !important;
  color: var(--portal-button-secondary-text) !important;
  border-color: var(--portal-button-secondary-border) !important;
}
html .secondary-button:hover { background: color-mix(in srgb, var(--portal-brand-accent) 10%, var(--portal-button-secondary-bg)) !important; border-color: var(--portal-brand-accent) !important; }

/* Navigation has independent background and text tokens. */
html .sidebar { background: var(--portal-sidebar) !important; color: var(--portal-sidebar-text) !important; }
html .nav-item { color: var(--portal-sidebar-text) !important; opacity: .86; }
html .nav-item:hover { background: color-mix(in srgb, var(--portal-nav-active-bg) 22%, transparent) !important; color: var(--portal-nav-active-text) !important; opacity: 1; }
html .nav-item.is-active, html .navigation .nav-item[aria-current="page"] { background: var(--portal-nav-active-bg) !important; color: var(--portal-nav-active-text) !important; opacity: 1; }

/* Brand logo variants: desktop site chooses the correct organisation logo. */
.brand-logo-image--dark { display: none !important; }
html[data-theme-mode="dark"] .brand-logo-image--light { display: none !important; }
html[data-theme-mode="dark"] .brand-logo-image--dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] .brand-logo-image--light { display: none !important; }
  html[data-theme-mode="system"] .brand-logo-image--dark { display: block !important; }
}

/* R8 branding editor */
.organisation-branding-editor--r8 { grid-template-columns: minmax(340px,.75fr) minmax(640px,1.55fr); }
.logo-variant-card { display:grid; gap:10px; margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--portal-border); }
.logo-variant-card:last-of-type { border-bottom:0; }
.logo-variant-head { display:flex; flex-direction:column; gap:2px; }
.logo-variant-head small { overflow-wrap:anywhere; }
.optional-badge { padding:2px 6px; border-radius:999px; background:var(--portal-brand-soft); color:var(--portal-brand-primary); font-size:10px; }
.organisation-logo-preview--split {
  position:relative; overflow:hidden; background:linear-gradient(90deg,#fff 0 50%,#0B1220 50% 100%) !important;
}
.organisation-logo-preview--split::after { content:"Hell / Dunkel"; position:absolute; right:8px; bottom:6px; padding:2px 6px; border-radius:999px; background:rgba(127,127,127,.18); color:#7B8798; font-size:9px; }
.organisation-logo-preview--dark { background:#0B1220 !important; }
.organisation-logo-preview img { max-width:88%; max-height:96px; filter:none !important; }
.organisation-logo-fallback--dark, .organisation-logo-preview--dark .organisation-logo-fallback { color:#fff !important; }
.logo-remove-row { display:flex; gap:8px; align-items:center; color:var(--portal-text); }
.branding-block-save { justify-self:start; }

.branding-mode-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; padding:8px; border:1px solid var(--portal-border); border-radius:10px; background:var(--portal-surface-muted); }
.branding-mode-toolbar .is-active { background:var(--portal-brand-primary) !important; color:var(--portal-brand-on-primary) !important; border-color:var(--portal-brand-primary) !important; }
.branding-palette-panel { padding:14px; border:1px solid var(--portal-border); border-radius:12px; background:var(--portal-surface); }
.branding-palette-panel h4 { margin:0 0 12px; }
.branding-token-grid { display:grid; grid-template-columns:repeat(4,minmax(145px,1fr)); gap:10px; }
.branding-token-grid + .branding-token-grid { margin-top:12px; padding-top:12px; border-top:1px solid var(--portal-border); }
.branding-token-grid label { display:grid; grid-template-columns:minmax(0,1fr) 44px; grid-template-areas:"name color" "hex color" "contrast contrast"; gap:3px 8px; align-items:center; min-width:0; padding:9px; border:1px solid var(--portal-border); border-radius:9px; background:var(--portal-surface-muted); color:var(--portal-text); font-size:11px; font-weight:700; }
.branding-token-grid label > input[type="color"] { grid-area:color; width:44px; height:38px; padding:2px; border:1px solid var(--portal-border); border-radius:7px; background:var(--portal-surface-raised); }
.branding-token-grid label > code { grid-area:hex; color:var(--portal-text-muted); font-size:10px; }
.contrast-badge { grid-area:contrast; display:inline-flex; width:max-content; margin-top:3px; padding:2px 6px; border-radius:999px; font-size:9px; background:var(--portal-surface-raised); color:var(--portal-text-muted); }
.contrast-badge[data-level="good"] { color:var(--portal-success); }
.contrast-badge[data-level="warn"] { color:var(--portal-warning); }
.contrast-badge[data-level="bad"] { color:var(--portal-danger); font-weight:800; }

.branding-live-preview--r8 { display:block; min-height:0; padding:0; background:var(--pv-page,#F5F8FC) !important; border-color:var(--pv-border,#D7E1EE) !important; }
.branding-preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; color:var(--pv-heading,#101828); background:var(--pv-card,#fff); border-bottom:1px solid var(--pv-border,#D7E1EE); }
.branding-preview-toolbar span { display:flex; gap:4px; }
.branding-preview-toolbar button { min-height:28px; padding:0 9px; border:1px solid var(--pv-border,#D7E1EE); border-radius:6px; background:var(--pv-raised,#fff); color:var(--pv-text,#172033); }
.branding-preview-toolbar button.is-active { background:var(--pv-primary,#1769D2); color:var(--pv-primary-text,#fff); }
.branding-preview-shell { display:grid; grid-template-columns:130px 1fr; min-height:185px; }
.branding-preview-shell aside { display:flex; flex-direction:column; gap:8px; padding:14px; background:var(--pv-nav,#0B1F38); color:var(--pv-nav-text,#fff); }
.branding-preview-shell aside span { padding:7px 8px; border-radius:6px; }
.branding-preview-shell aside .active { background:var(--pv-nav-active,#1769D2); color:var(--pv-nav-active-text,#fff); }
.branding-preview-shell main { padding:16px; color:var(--pv-text,#172033); background:var(--pv-page,#F5F8FC); }
.branding-preview-shell h4 { margin:0 0 7px; color:var(--pv-heading,#101828) !important; }
.branding-preview-shell p { color:var(--pv-text,#172033) !important; }
.branding-preview-shell a { color:var(--pv-link,#1769D2) !important; }
.preview-actions { display:flex; gap:8px; margin:12px 0; }
.preview-actions button { min-height:34px; padding:0 12px; border-radius:7px; font-weight:700; }
.preview-primary { background:var(--pv-primary,#1769D2) !important; color:var(--pv-primary-text,#fff) !important; border:1px solid var(--pv-primary,#1769D2) !important; }
.preview-secondary { background:var(--pv-secondary,#fff) !important; color:var(--pv-secondary-text,#1769D2) !important; border:1px solid var(--pv-secondary-border,#B9CBE3) !important; }
.preview-card { padding:12px; border:1px solid var(--pv-border,#D7E1EE); border-radius:8px; background:var(--pv-card,#fff); color:var(--pv-text,#172033); }
.branding-profile-manager--r8 { grid-template-columns:1fr 1fr; }
.branding-profile-transfer { grid-column:1/-1; display:flex; gap:8px; flex-wrap:wrap; }

/* Builder/editor hardening: central variables override the legacy white editor. */
html .builder-item, html .builder-section, html .section-point-list,
html .builder-section-header, html .builder-section-footer, html .section-empty,
html .section-builder, html .builder-list, html .builder-summary,
html [class*="builder-panel"], html [class*="editor-panel"], html [class*="properties-panel"],
html [class*="property-panel"] { color:var(--portal-text) !important; border-color:var(--portal-border) !important; }
html .builder-item, html .builder-section, html .section-point-list,
html [class*="builder-panel"], html [class*="editor-panel"], html [class*="properties-panel"], html [class*="property-panel"] { background:var(--portal-surface) !important; }
html .builder-section-header, html .builder-section-footer, html .section-empty { background:var(--portal-surface-muted) !important; }
html .builder-section-number, html .field-type-badge { background:var(--portal-brand-soft) !important; color:var(--portal-brand-primary) !important; }
html .section-add-element { color:var(--portal-link) !important; }

/* Dark mode must not leave white editor/form/card islands. */
html[data-theme-mode="dark"] .checklist-item,
html[data-theme-mode="dark"] .checklist-section,
html[data-theme-mode="dark"] .builder-item,
html[data-theme-mode="dark"] .builder-section,
html[data-theme-mode="dark"] .section-point-list,
html[data-theme-mode="dark"] .builder-section-header,
html[data-theme-mode="dark"] .builder-section-footer,
html[data-theme-mode="dark"] .section-empty,
html[data-theme-mode="dark"] [class*="editor-panel"],
html[data-theme-mode="dark"] [class*="properties-panel"],
html[data-theme-mode="dark"] [class*="property-panel"] {
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
}
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] .checklist-item,
  html[data-theme-mode="system"] .builder-item,
  html[data-theme-mode="system"] .builder-section,
  html[data-theme-mode="system"] .section-point-list,
  html[data-theme-mode="system"] .builder-section-header,
  html[data-theme-mode="system"] [class*="editor-panel"],
  html[data-theme-mode="system"] [class*="properties-panel"] {
    background:var(--portal-surface) !important; color:var(--portal-text) !important; border-color:var(--portal-border) !important;
  }
}

@media (max-width: 1250px) {
  .organisation-branding-editor--r8 { grid-template-columns:1fr; }
  .branding-token-grid { grid-template-columns:repeat(2,minmax(145px,1fr)); }
}
@media (max-width: 720px) {
  .branding-token-grid { grid-template-columns:1fr; }
  .branding-preview-shell { grid-template-columns:90px 1fr; }
  .branding-profile-manager--r8 { grid-template-columns:1fr; }
}

/* Remaining recurring accent components inherit the company palette. */
.kpi-icon, .inventar-launch-icon, .search-hero-icon, .result-count,
.builder-section-number, .field-type-badge, .portal-dropzone-icon,
.dashboard-icon, .category-icon {
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
}
.progress-bar > span, .status-progress-fill, .report-meter > span {
  background: var(--portal-brand-primary) !important;
}

/* Personal monochrome/high-contrast display modes remain user-specific and
   deliberately override organisation branding without changing the DB. */
html[data-color-mode="monochrom"] {
  --portal-brand-primary:#475569 !important;
  --portal-brand-accent:#94A3B8 !important;
  --portal-link:#475569 !important;
  --portal-button-primary-bg:#475569 !important;
  --portal-button-primary-text:#FFFFFF !important;
  --portal-button-primary-hover:#334155 !important;
  --portal-nav-active-bg:#475569 !important;
  --portal-nav-active-text:#FFFFFF !important;
}
html[data-theme-mode="dark"][data-color-mode="monochrom"] {
  --portal-brand-primary:#CBD5E1 !important;
  --portal-brand-accent:#94A3B8 !important;
  --portal-link:#E2E8F0 !important;
  --portal-button-primary-bg:#CBD5E1 !important;
  --portal-button-primary-text:#0F172A !important;
  --portal-button-primary-hover:#E2E8F0 !important;
  --portal-nav-active-bg:#64748B !important;
  --portal-nav-active-text:#FFFFFF !important;
}
html[data-color-mode="kontrast"] {
  --portal-brand-primary:#003A8C !important;
  --portal-brand-accent:#005FCC !important;
  --portal-link:#003A8C !important;
  --portal-button-primary-bg:#003A8C !important;
  --portal-button-primary-text:#FFFFFF !important;
  --portal-button-primary-hover:#002A66 !important;
  --portal-nav-active-bg:#FFD400 !important;
  --portal-nav-active-text:#000000 !important;
}
html[data-theme-mode="dark"][data-color-mode="kontrast"] {
  --portal-bg:#000000 !important;
  --portal-surface:#090909 !important;
  --portal-surface-raised:#111111 !important;
  --portal-text:#FFFFFF !important;
  --portal-heading:#FFFFFF !important;
  --portal-text-muted:#D7D7D7 !important;
  --portal-border:#FFFFFF !important;
  --portal-brand-primary:#FFD400 !important;
  --portal-brand-accent:#FFD400 !important;
  --portal-link:#8CC8FF !important;
  --portal-button-primary-bg:#FFD400 !important;
  --portal-button-primary-text:#000000 !important;
  --portal-button-primary-hover:#FFE45B !important;
  --portal-nav-active-bg:#FFD400 !important;
  --portal-nav-active-text:#000000 !important;
}

/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R11 – isolated branding + radio settings  */
/* ========================================================================== */
.organisation-master-panel,
.organisation-branding-panel {
  margin-bottom: 18px;
}
.branding-form-error,
.portal-message--error {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid var(--state-danger, #B42318);
  border-radius: 8px;
  background: color-mix(in srgb, var(--state-danger, #B42318) 8%, var(--portal-surface));
  color: var(--portal-text);
}

.settings-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 7px;
}
.settings-choice-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-choice-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--portal-border);
  border-radius: 9px;
  background: var(--portal-surface-raised);
  color: var(--portal-text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.settings-choice-card:hover {
  border-color: var(--portal-brand-primary);
  background: color-mix(in srgb, var(--portal-brand-primary) 5%, var(--portal-surface-raised));
}
.settings-choice-card.is-selected {
  border-color: var(--portal-brand-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--portal-brand-primary) 18%, transparent);
  background: color-mix(in srgb, var(--portal-brand-primary) 8%, var(--portal-surface-raised));
}
.settings-choice-card input[type="radio"] {
  flex: 0 0 auto;
  margin: 3px 0 0;
  accent-color: var(--portal-brand-primary);
}
.settings-choice-card span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.settings-choice-card strong { color: var(--portal-text) !important; }
.settings-choice-card small { color: var(--portal-text-muted) !important; }
html[data-theme-mode="dark"] .settings-choice-card,
html[data-theme-mode="system"] .settings-choice-card {
  color: var(--portal-text);
}

/* Persönliche Darstellung nutzt R11 bewusst keine nativen Select-Popups mehr.
   Dadurch kann Windows/Firefox im Dark Mode keine unlesbare native Optionsliste
   mit identischer Vorder-/Hintergrundfarbe erzeugen. */
[data-personal-settings-form] select[name="modus"],
[data-personal-settings-form] select[name="farbdarstellung"],
[data-personal-settings-form] select[name="dichte"] {
  display: none !important;
}

@media (max-width: 850px) {
  .settings-choice-grid,
  .settings-choice-grid--2,
  .settings-choice-grid--3 { grid-template-columns: 1fr; }
}

/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R14 – FULL BRAND PROPAGATION               */
/* ========================================================================== */
/*
 * Historical portal CSS still contains the original --blue token and a small
 * number of literal blue component rules. R14 bridges those legacy accents to
 * the active organisation palette so a selected company profile is applied to
 * the complete portal rather than only navigation and primary buttons.
 */
:root,
html[data-theme-mode="light"],
html[data-theme-mode="dark"] {
  --blue: var(--portal-brand-primary) !important;
  --blue-soft: var(--portal-brand-soft) !important;
  --portal-info: var(--portal-brand-primary) !important;
}
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] {
    --blue: var(--portal-brand-primary) !important;
    --blue-soft: var(--portal-brand-soft) !important;
    --portal-info: var(--portal-brand-primary) !important;
  }
}

/* Browser controls and recurring interaction accents. */
html input[type="checkbox"],
html input[type="radio"] { accent-color: var(--portal-brand-primary) !important; }
html .table-sort:hover,
html .table-sort.is-active,
html .table-filter-link:hover,
html .customer-contact-cell a:hover,
html .customer-name-link:hover,
html .category-template-link,
html .customer-overview-grid-large > a em,
html .section-add-element,
html .runtime-credential-meta a,
html .credential-relation-grid > .credential-relation-tile small,
html .checklist-template-picker-toggle:hover,
html .checklist-template-picker-toggle:focus-visible {
  color: var(--portal-link) !important;
}

/* Dashboard progress is branding, not a fixed Netstyle-blue semantic state. */
html .progress-value,
html .activity-dot,
html .progress-bar > span,
html .status-progress-fill,
html .report-meter > span { background: var(--portal-brand-primary) !important; }
html .progress-track { background: var(--portal-border) !important; }
html .donut {
  background: conic-gradient(
    var(--portal-brand-primary) calc(var(--progress) * 1%),
    var(--portal-border) 0
  ) !important;
}
html .donut-inner { background: var(--portal-surface) !important; color: var(--portal-text) !important; }

/* "In Bearbeitung" follows the company accent. Warning/success/error retain
   their semantic colours so status meaning is not lost. */
html .status--in_bearbeitung {
  background: var(--portal-brand-accent-soft) !important;
  color: var(--portal-brand-accent) !important;
}

/* Neutral counters and category markers shown in the screenshots. */
html .customer-count-badge,
html .category-template-count,
html .result-count,
html .credential-count-badge,
html .portal-system-error-code,
html .search-hero-icon,
html .inventar-launch-icon,
html .portal-dropzone-icon,
html .builder-section-number,
html .field-type-badge,
html .dashboard-icon,
html .category-icon {
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
}

/* Active tabs/navigation must always use the configured active text colour.
   This also fixes the blank active "Organisation & Stammdaten" tab visible
   with Emerald Green. */
html .portal-subnav a.is-active,
html .customer-tabs > a.is-active,
html .portal-section-tabs a.is-active,
html .section-tabs.inventar-tabs a.is-active,
html .portal-section-tabs.inventar-tabs a.is-active {
  background: var(--portal-nav-active-bg) !important;
  border-color: var(--portal-nav-active-bg) !important;
  color: var(--portal-nav-active-text) !important;
}
html .portal-subnav a.is-active:hover,
html .customer-tabs > a.is-active:hover,
html .portal-section-tabs a.is-active:hover {
  background: var(--portal-button-primary-hover) !important;
  color: var(--portal-nav-active-text) !important;
}

/* Legacy blue hover/focus borders. */
html .customer-overview-grid-large a:hover,
html .inventar-launch-card:hover,
html .kpi-card-link:hover,
html .credential-scope-card:has(input:checked),
html .checklist-template-picker.is-open .checklist-template-picker-input,
html .checklist-template-picker.is-open .checklist-template-picker-toggle {
  border-color: var(--portal-brand-primary) !important;
}
html .dashboard-category-link:focus-visible,
html .audit-kpi-card.kpi-card-link:focus-visible,
html .inventar-launch-card:focus-visible {
  outline-color: var(--portal-focus) !important;
}
html .credential-scope-card:has(input:checked),
html .customer-autocomplete-option:hover,
html .customer-autocomplete-option.is-active {
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
}
html .credential-relation-grid > .credential-relation-tile.is-linked:hover,
html .credential-relation-grid > .credential-relation-tile.is-linked:focus-visible,
html .activity-item .activity-open-link:hover,
html .activity-item .activity-open-link:focus-visible {
  border-color: color-mix(in srgb, var(--portal-brand-primary) 52%, var(--portal-border)) !important;
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
}
html .checklist-item[id^="punkt-"]:target {
  border-color: var(--portal-brand-primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-brand-primary) 16%, transparent) !important;
  background: color-mix(in srgb, var(--portal-brand-soft) 55%, var(--portal-surface)) !important;
}

/* Informational feedback is company-coloured; warning/success/error remain semantic. */
html .portal-message.info {
  border-left-color: var(--portal-brand-primary) !important;
  background: var(--portal-brand-soft) !important;
}
html .portal-message.info .portal-message-icon {
  background: var(--portal-brand-soft) !important;
  color: var(--portal-brand-primary) !important;
}

/* Dedicated Design & Branding page. */
html .organisation-branding-panel { margin-top: 0; }



/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R15 – UI HARDENING / SPACING CONTRACT      */
/* ========================================================================== */
:root {
  --portal-space-1: 4px;
  --portal-space-2: 8px;
  --portal-space-3: 12px;
  --portal-space-4: 16px;
  --portal-space-5: 20px;
  --portal-space-6: 24px;
  --portal-box-gap: 16px;
  --portal-section-gap: 16px;
  --portal-edge-gutter: 16px;
  --portal-action-height: 36px;
  --portal-action-min-width: 88px;
  --portal-header-action-min-width: 112px;
}

/* One consistent vertical rhythm between independent portal boxes/panels.
   Grid-internal cards keep using their own gap values and are not affected. */
html .content > .panel + .panel,
html .content > .portal-card + .portal-card,
html .content > .panel + .portal-card,
html .content > .portal-card + .panel,
html .content > .report-kpi-grid,
html .report-kpi-grid + .report-section-grid,
html .report-section-grid + .report-section-grid,
html .report-section-grid + .panel,
html .panel + .report-section-grid,
html .audit-kpi-grid + .panel,
html .panel + .audit-kpi-grid {
  margin-top: var(--portal-section-gap) !important;
}

/* Known preview/card groups must not touch their surrounding panel heading/border. */
html .report-kpi-grid,
html .report-section-grid,
html .pruefplan-preview-grid,
html .schedule-preview-grid,
html .preview-grid,
html .preview-card-grid,
html .termin-grid,
html .appointment-grid {
  row-gap: var(--portal-box-gap);
  column-gap: var(--portal-box-gap);
}
html .panel > .pruefplan-preview-grid,
html .panel > .schedule-preview-grid,
html .panel > .preview-grid,
html .panel > .preview-card-grid,
html .panel > .termin-grid,
html .panel > .appointment-grid {
  margin-top: var(--portal-section-gap) !important;
}

/* Button contract: one height across normal portal actions. */
html .primary-button,
html .secondary-button,
html button.primary-button,
html button.secondary-button,
html a.primary-button,
html a.secondary-button,
html .search-submit {
  min-height: var(--portal-action-height) !important;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Header actions use the larger agreed standard. */
html .page-heading .primary-button,
html .page-heading .secondary-button,
html .page-heading a.primary-button,
html .page-heading a.secondary-button,
html .dashboard-heading-actions .primary-button,
html .dashboard-heading-actions .secondary-button,
html .page-actions .primary-button,
html .page-actions .secondary-button {
  min-width: var(--portal-header-action-min-width) !important;
  min-height: var(--portal-action-height) !important;
}

/* TABLE EDGE CONTRACT
   No action may touch or be clipped by the right panel/table edge.
   Applies even to legacy tables whose specific class names differ. */
html .panel table th:first-child,
html .panel table td:first-child,
html .portal-card table th:first-child,
html .portal-card table td:first-child {
  padding-left: var(--portal-edge-gutter) !important;
}
html .panel table th:last-child,
html .panel table td:last-child,
html .portal-card table th:last-child,
html .portal-card table td:last-child {
  padding-right: var(--portal-edge-gutter) !important;
}

/* Action cells: stable width, right alignment and the same button dimensions. */
html table th:last-child {
  white-space: nowrap;
}
html table td:last-child {
  box-sizing: border-box;
}
html table td:last-child > .primary-button,
html table td:last-child > .secondary-button,
html table td:last-child > a.primary-button,
html table td:last-child > a.secondary-button,
html table td:last-child > button,
html table td:last-child > a[role="button"] {
  min-width: var(--portal-action-min-width) !important;
  min-height: var(--portal-action-height) !important;
  margin-right: 0 !important;
  box-sizing: border-box;
}

/* Explicit activity/list pages: right-side gutter must remain visible even
   when description columns consume all remaining width. */
html .activity-table th:last-child,
html .activity-table td:last-child,
html .audit-table th:last-child,
html .audit-table td:last-child,
html .workorder-table th:last-child,
html .workorder-table td:last-child,
html .customer-table th:last-child,
html .customer-table td:last-child,
html .portal-table th:last-child,
html .portal-table td:last-child,
html .list-table th:last-child,
html .list-table td:last-child {
  min-width: calc(var(--portal-action-min-width) + var(--portal-edge-gutter) * 2);
  padding-left: var(--portal-space-3) !important;
  padding-right: var(--portal-edge-gutter) !important;
}

/* Sticky/fixed action bars use one baseline and one gap. */
html .sticky-actions,
html .form-sticky-actions,
html .runtime-actions,
html .checklist-actions,
html .vorgang-actions,
html .form-actions {
  gap: var(--portal-space-3);
  align-items: center;
}
html .sticky-actions .primary-button,
html .sticky-actions .secondary-button,
html .form-sticky-actions .primary-button,
html .form-sticky-actions .secondary-button,
html .runtime-actions .primary-button,
html .runtime-actions .secondary-button,
html .checklist-actions .primary-button,
html .checklist-actions .secondary-button,
html .vorgang-actions .primary-button,
html .vorgang-actions .secondary-button {
  min-height: var(--portal-action-height) !important;
  min-width: var(--portal-action-min-width) !important;
}

/* Reusable box internals: preserve breathing room at the top/bottom of sections. */
html .panel > :first-child,
html .portal-card > :first-child {
  margin-top: 0;
}
html .panel > :last-child,
html .portal-card > :last-child {
  margin-bottom: 0;
}

/* Reports: filter area and KPI boxes must never visually collide. */
html .report-filter {
  margin-bottom: var(--portal-section-gap);
}
html .report-kpi-grid {
  margin-top: var(--portal-section-gap) !important;
}

/* Compact density reduces, but never removes, the safety gutter. */
html[data-density="kompakt"] {
  --portal-box-gap: 12px;
  --portal-section-gap: 12px;
  --portal-edge-gutter: 12px;
}


/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R16 – FULL UI AUDIT / GLOBAL CONTRACT      */
/* ========================================================================== */

/* Universal page-flow spacing. */
html .content > section + section,
html .content > section + nav,
html .content > nav + section,
html .content > nav + div,
html .content > div + section,
html .content > .page-heading + .panel,
html .content > .page-heading + .portal-card,
html .content > .page-heading + form,
html .content > .page-heading + .report-filter,
html .content > .page-heading + .report-kpi-grid {
  margin-top: var(--portal-section-gap) !important;
}

/* Stable page-heading/action alignment. */
html .page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--portal-space-4);
}
html .page-heading-actions,
html .page-actions,
html [class*="heading-actions"],
html [class*="header-actions"] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--portal-space-2);
}
html .page-heading-actions > :is(a,button),
html .page-actions > :is(a,button),
html [class*="heading-actions"] > :is(a,button),
html [class*="header-actions"] > :is(a,button) {
  min-width: var(--portal-header-action-min-width) !important;
  min-height: var(--portal-action-height) !important;
}

/* Major panel/card families never touch each other. */
html .panel + [class*="-panel"],
html [class*="-panel"] + .panel,
html [class*="-panel"] + [class*="-panel"],
html .portal-card + [class*="-card"],
html [class*="-card"] + .portal-card,
html .dashboard-card + .dashboard-card,
html .kpi-card + .kpi-card {
  margin-top: var(--portal-section-gap);
}

/* Heading-to-content spacing inside boxes. */
html .panel > header + *,
html .panel > .panel-heading + *,
html .panel > .section-heading + *,
html .portal-card > header + *,
html [class*="-panel"] > [class*="-heading"] + *,
html [class*="-section"] > [class*="-heading"] + * {
  margin-top: var(--portal-space-3);
}

/* Global table edge contract. */
html table {
  width: 100%;
}
html table th,
html table td {
  box-sizing: border-box;
  vertical-align: middle;
}
html table th:first-child,
html table td:first-child {
  padding-left: var(--portal-edge-gutter) !important;
}
html table th:last-child,
html table td:last-child {
  padding-right: var(--portal-edge-gutter) !important;
  min-width: calc(var(--portal-action-min-width) + var(--portal-edge-gutter) * 2);
}
html table td:last-child > :is(a,button) {
  min-width: var(--portal-action-min-width) !important;
  min-height: var(--portal-action-height) !important;
  box-sizing: border-box;
}

/* All action groups use a common baseline. */
html [class*="toolbar"] [class*="action"],
html [class*="actions"],
html .form-actions,
html .sticky-actions,
html .runtime-actions,
html .checklist-actions,
html .vorgang-actions {
  align-items: center;
  gap: var(--portal-space-2);
}
html [class*="actions"] > :is(a,button),
html [class*="toolbar"] > :is(a,button) {
  min-height: var(--portal-action-height);
}

/* Runtime/checklist field rows align label, input and completion controls. */
html .runtime-row,
html .runtime-field-row,
html .runtime-point-row,
html .checklist-row,
html .checklist-field-row,
html .checklist-point-row,
html .checklist-item,
html [class*="runtime-row"],
html [class*="checklist-point-row"] {
  align-items: center !important;
  column-gap: var(--portal-space-4) !important;
}
html .runtime-row > :last-child,
html .runtime-field-row > :last-child,
html .runtime-point-row > :last-child,
html .checklist-field-row > :last-child,
html .checklist-point-row > :last-child {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--portal-space-2);
  white-space: nowrap;
}
html .runtime-row label,
html .runtime-field-row label,
html .runtime-point-row label,
html .checklist-row label,
html .checklist-field-row label,
html .checklist-point-row label {
  margin-bottom: 0;
}

/* Required badges do not disturb row height. */
html .required-badge,
html .pflicht-badge,
html .badge-required,
html .badge--required,
html [class*="required-badge"],
html [class*="pflicht-badge"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  line-height: 1;
  vertical-align: middle;
  margin-inline-start: var(--portal-space-2);
}

/* Dark-mode runtime/checklist text legibility. */
html[data-theme-mode="dark"] .runtime-row,
html[data-theme-mode="dark"] .runtime-field-row,
html[data-theme-mode="dark"] .runtime-point-row,
html[data-theme-mode="dark"] .checklist-row,
html[data-theme-mode="dark"] .checklist-field-row,
html[data-theme-mode="dark"] .checklist-point-row,
html[data-theme-mode="dark"] .checklist-item,
html[data-theme-mode="dark"] [class*="runtime"] label,
html[data-theme-mode="dark"] [class*="runtime"] strong,
html[data-theme-mode="dark"] [class*="runtime"] [class*="title"],
html[data-theme-mode="dark"] [class*="checklist"] [class*="title"],
html[data-theme-mode="dark"] [class*="checklist"] [class*="label"] {
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-theme-mode="dark"] textarea,
html[data-theme-mode="dark"] select {
  background: var(--portal-surface-raised) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html[data-theme-mode="dark"] input::placeholder,
html[data-theme-mode="dark"] textarea::placeholder {
  color: var(--portal-text-muted) !important;
  opacity: 1;
}

/* Dark-mode preview/appointment cards must not stay white. */
html[data-theme-mode="dark"] .pruefplan-preview-card,
html[data-theme-mode="dark"] .schedule-preview-card,
html[data-theme-mode="dark"] .preview-date-card,
html[data-theme-mode="dark"] .appointment-card,
html[data-theme-mode="dark"] .termin-card,
html[data-theme-mode="dark"] [class*="preview-card"]:not(.branding-preview-card),
html[data-theme-mode="dark"] [class*="schedule-card"],
html[data-theme-mode="dark"] [class*="appointment-card"],
html[data-theme-mode="dark"] [class*="termin-card"] {
  background: var(--portal-surface-raised) !important;
  border-color: var(--portal-border) !important;
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] [class*="preview-card"] *,
html[data-theme-mode="dark"] [class*="schedule-card"] *,
html[data-theme-mode="dark"] [class*="appointment-card"] *,
html[data-theme-mode="dark"] [class*="termin-card"] * {
  color: inherit;
}
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] .pruefplan-preview-card,
  html[data-theme-mode="system"] .schedule-preview-card,
  html[data-theme-mode="system"] .preview-date-card,
  html[data-theme-mode="system"] .appointment-card,
  html[data-theme-mode="system"] .termin-card,
  html[data-theme-mode="system"] [class*="preview-card"]:not(.branding-preview-card),
  html[data-theme-mode="system"] [class*="schedule-card"],
  html[data-theme-mode="system"] [class*="appointment-card"],
  html[data-theme-mode="system"] [class*="termin-card"] {
    background: var(--portal-surface-raised) !important;
    border-color: var(--portal-border) !important;
    color: var(--portal-text) !important;
  }
}

/* Reports: filter/KPI/section boxes must be visibly separated. */
html .report-filter + .report-kpi-grid,
html .report-filter + [class*="kpi-grid"],
html [class*="filter-panel"] + [class*="kpi-grid"],
html [class*="filter-panel"] + .panel {
  margin-top: var(--portal-section-gap) !important;
}
html .report-kpi-grid + .report-section-grid,
html .report-section-grid + .report-section-grid {
  margin-top: var(--portal-section-gap) !important;
}

/* Preview sections: heading/border and preview cards must not touch. */
html [class*="preview-section"] > [class*="grid"],
html [class*="preview-panel"] > [class*="grid"],
html .panel > [class*="preview-grid"],
html .panel > [class*="termin-grid"],
html .panel > [class*="appointment-grid"] {
  margin-top: var(--portal-section-gap) !important;
  gap: var(--portal-box-gap) !important;
}

/* Responsive action safety. */
@media (max-width: 980px) {
  html .page-heading {
    flex-direction: column;
  }
  html .page-heading-actions,
  html .page-actions,
  html [class*="heading-actions"],
  html [class*="header-actions"] {
    width: 100%;
    justify-content: flex-start;
  }
}


/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R17 – REAL BROWSER LAYOUT CORRECTIONS      */
/* ========================================================================== */

/* --------------------------------------------------------------------------
   1. GRID CARD CONTRACT
   R16 incorrectly applied vertical sibling margins to cards that are already
   children of CSS grids. This shifted KPI cards 2..n down while card 1 stayed
   at the top. Grid/flex containers own their spacing via gap – children do not.
   -------------------------------------------------------------------------- */
html .kpi-grid > .kpi-card,
html .report-kpi-grid > *,
html .report-section-grid > *,
html .detail-summary > .summary-card,
html .category-grid > *,
html .customer-kpis > *,
html .customer-overview-grid > *,
html .customer-overview-grid-large > *,
html .search-result-grid--cards > *,
html .dashboard-main > *,
html .dashboard-side > *,
html .dashboard-side-column > * {
  margin-top: 0 !important;
}

/* The dashboard KPI row must be one horizontal baseline. */
html .kpi-grid {
  align-items: stretch !important;
}
html .kpi-grid > .kpi-card {
  height: 100% !important;
  align-self: stretch !important;
}

/* --------------------------------------------------------------------------
   2. DASHBOARD ACTIVITY ACTION
   The Öffnen link is nested inside the activity content wrapper. R16 reserved
   an unused third column on the outer item and therefore left the button below
   the text. The outer item has two columns; the inner content owns text+action.
   -------------------------------------------------------------------------- */
html .dashboard-side .activity-item,
html .dashboard-side-column .activity-item {
  grid-template-columns: 8px minmax(0, 1fr) !important;
  column-gap: 10px !important;
  align-items: start !important;
}

html .dashboard-side .activity-item > div:not(.activity-dot),
html .dashboard-side-column .activity-item > div:not(.activity-dot) {
  grid-column: 2 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 88px !important;
  column-gap: 10px !important;
  align-items: start !important;
  min-width: 0 !important;
  width: 100% !important;
}

html .dashboard-side .activity-item > div:not(.activity-dot) > :not(.activity-open-link),
html .dashboard-side-column .activity-item > div:not(.activity-dot) > :not(.activity-open-link) {
  grid-column: 1 !important;
  min-width: 0 !important;
}

html .dashboard-side .activity-item .activity-open-link,
html .dashboard-side-column .activity-item .activity-open-link {
  grid-column: 2 !important;
  grid-row: 1 / span 20 !important;
  justify-self: end !important;
  align-self: center !important;
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
}

/* Header action and row action use exactly the same geometry. */
html .dashboard-activity-all-button,
html .dashboard-side .dashboard-activity-all-button,
html .dashboard-side-column .dashboard-activity-all-button {
  width: 88px !important;
  min-width: 88px !important;
  max-width: 88px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 11px !important;
  box-sizing: border-box !important;
}

/* --------------------------------------------------------------------------
   3. CHECKLIST LABEL / REQUIRED BADGE COLUMN
   Required badges are no longer placed immediately after variable-length
   labels. They occupy a fixed position at the right edge of the label column.
   -------------------------------------------------------------------------- */
html .checklist-item {
  grid-template-columns: minmax(390px, 470px) minmax(0, 1fr) !important;
  column-gap: 24px !important;
}

html .checklist-label {
  position: relative !important;
  min-width: 0 !important;
}

html .checklist-label > strong,
html .checklist-label strong {
  display: block !important;
  padding-right: 82px !important;
  box-sizing: border-box !important;
}

html .checklist-label .required-mark {
  position: absolute !important;
  top: 5px !important;
  right: 0 !important;
  margin: 0 !important;
  min-width: 58px !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

/* Keep helper text full-width beneath the fixed badge line. */
html .checklist-label > p {
  padding-right: 0 !important;
}

/* Completion column must keep one vertical baseline for all normal field rows. */
html .checklist-control > .completed-control {
  min-width: 150px !important;
  align-self: start !important;
}

/* --------------------------------------------------------------------------
   4. DO NOT REINTRODUCE CARD MARGINS INSIDE GRID CONTAINERS
   This is intentionally placed at the very end to beat the R16 generic rules.
   -------------------------------------------------------------------------- */
html :is(
  .kpi-grid,
  .report-kpi-grid,
  .report-section-grid,
  .detail-summary,
  .category-grid,
  .customer-kpis,
  .customer-overview-grid,
  .customer-overview-grid-large,
  .search-result-grid--cards
) > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Mobile: return runtime rows to the established single-column behavior. */
@media (max-width: 760px) {
  html .checklist-item {
    grid-template-columns: 1fr !important;
  }
  html .checklist-label strong {
    padding-right: 0 !important;
  }
  html .checklist-label .required-mark {
    position: static !important;
    display: inline-flex !important;
    margin: 6px 0 0 !important;
  }

  html .dashboard-side .activity-item > div:not(.activity-dot),
  html .dashboard-side-column .activity-item > div:not(.activity-dot) {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 8px !important;
  }
  html .dashboard-side .activity-item .activity-open-link,
  html .dashboard-side-column .activity-item .activity-open-link {
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-self: end !important;
  }
}


/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL R3.3.29 R18 – SPECIAL ROW / ACTIVITY POLISH        */
/* ========================================================================== */

/* Dashboard activity buttons:
   "Alle" etwas breiter als bisher, "Öffnen" exakt dieselbe Geometrie.
   R17 mit 88px war sichtbar zu groß. */
html .dashboard-side .dashboard-activity-all-button,
html .dashboard-side-column .dashboard-activity-all-button,
html .dashboard-side .activity-item .activity-open-link,
html .dashboard-side-column .activity-item .activity-open-link {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

/* Inner activity layout must reserve exactly the shared 64px action column. */
html .dashboard-side .activity-item > div:not(.activity-dot),
html .dashboard-side-column .activity-item > div:not(.activity-dot) {
  grid-template-columns: minmax(0, 1fr) 64px !important;
}

/* --------------------------------------------------------------------------
   Special checklist rows:
   R17's generic checklist grid must NEVER override these full-width types.
   -------------------------------------------------------------------------- */
html .checklist-item.checklist-item--anleitung,
html .checklist-items > .checklist-item.checklist-item--anleitung,
html .checklist-item.checklist-item--zugangsdaten,
html .checklist-items > .checklist-item.checklist-item--zugangsdaten {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  column-gap: 0 !important;
  row-gap: 0 !important;
  align-items: stretch !important;
}

/* Anleitung besitzt eine eigene Karte; die normale linke Feldspalte entfällt. */
html .checklist-item.checklist-item--anleitung > .checklist-label,
html .checklist-items > .checklist-item.checklist-item--anleitung > .checklist-label {
  display: none !important;
}

html .checklist-item.checklist-item--anleitung > .checklist-control,
html .checklist-items > .checklist-item.checklist-item--anleitung > .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;
}

/* Knowledge card uses the available desktop width instead of visually
   stacking everything into the upper-left corner. */
html .checklist-item--anleitung .runtime-knowledge-card {
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: 44px minmax(0, 1fr) !important;
}

html .checklist-item--anleitung .runtime-knowledge-card-body {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  column-gap: 28px !important;
  row-gap: 4px !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  align-items: start !important;
}

html .checklist-item--anleitung .runtime-knowledge-card-meta,
html .checklist-item--anleitung .runtime-knowledge-card h3,
html .checklist-item--anleitung .runtime-knowledge-source-title,
html .checklist-item--anleitung .runtime-knowledge-help,
html .checklist-item--anleitung .runtime-knowledge-summary {
  grid-column: 1 !important;
  max-width: none !important;
}

html .checklist-item--anleitung .runtime-knowledge-actions {
  grid-column: 2 !important;
  grid-row: 1 / span 6 !important;
  align-self: center !important;
  justify-self: end !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

/* Zugangsdaten are also a full-width runtime component. */
html .checklist-item.checklist-item--zugangsdaten > .checklist-label,
html .checklist-items > .checklist-item.checklist-item--zugangsdaten > .checklist-label {
  display: none !important;
}

html .checklist-item.checklist-item--zugangsdaten > .checklist-control,
html .checklist-items > .checklist-item.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;
}

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

/* Full-width empty credential state: do not look like a tiny left-side field. */
html .checklist-item--zugangsdaten .runtime-credential-card--r2 {
  padding: 14px 16px !important;
  border: 1px solid var(--portal-border) !important;
  border-radius: 10px !important;
  background: var(--portal-surface-raised) !important;
}

/* Responsive: stack knowledge action beneath content. */
@media (max-width: 900px) {
  html .checklist-item--anleitung .runtime-knowledge-card-body {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html .checklist-item--anleitung .runtime-knowledge-actions {
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-self: start !important;
    margin-top: 8px !important;
  }
}

/* NETSTYLE Technikportal R20 UI acceptance HF1
 * Deliberately loaded AFTER portal_theme_r3329.css.
 * Scope: maintenance, customer cockpit, absence, per-employee worktime, user form.
 * Reuses corporate theme tokens; no unrelated portal layout changed.
 */

/* CRITICAL: The generic `html a:not(...) {color:... !important}` theme rule
 * overrode the white foreground of the active customer tab, hiding its title.
 * Both light and dark mode must use the configured on-primary foreground. */
html .customer-tabs.customer-tabs-main > a.is-active,
html .customer-tabs.customer-tabs-main > a.is-active:visited,
html .customer-tabs.customer-tabs-main > a.is-active:hover,
html .customer-tabs.customer-tabs-main > a.is-active:focus-visible {
  color: #fff !important;
  background: var(--portal-brand-primary, #1769d2) !important;
  border-color: var(--portal-brand-primary, #1769d2) !important;
  opacity: 1 !important;
  text-decoration: none !important;
}
html .customer-tabs.customer-tabs-main > a.is-active > span {
  color: #fff !important;
  background: rgb(255 255 255 / 19%) !important;
}
/* HF1 FIX1: Theme's six :not() pseudo-classes give its global link rule
 * specificity (0,6,2), which previously beat the customer active-tab rule
 * (0,3,2) even though this stylesheet is loaded later. Mirror the exclusions
 * and restrict the override to active customer tabs, across all link states.
 * White-on-blue is an explicit Netstyle design contract. */
html .customer-tabs.customer-tabs-main > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) {
  color: #fff !important;
}
/* The same design contract applies to the existing blue active portal tabs.
 * Only active tab anchors are affected; ordinary links retain the theme. */
html .portal-subnav > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html .portal-section-tabs > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html .section-tabs.inventar-tabs > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html .portal-section-tabs.inventar-tabs > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) {
  color: #fff !important;
}

html .customer-tabs.customer-tabs-main > a:not(.is-active) {
  color: var(--portal-brand-primary, #1769d2) !important;
}
html .customer-tabs.customer-tabs-main > a:focus-visible {
  outline: 3px solid var(--portal-focus, #4f8fdb);
  outline-offset: 2px;
}
html .customer-tabs.customer-tabs-main {
  gap: 7px !important;
  padding: 6px !important;
  margin: 0 0 18px !important;
}
html .customer-tabs.customer-tabs-main > a {
  min-height: 38px;
  box-sizing: border-box;
  padding: 9px 12px !important;
  text-align: center;
}

/* Customer cockpit: a real status panel instead of an unpadded 17px strip. */
html .ns-r20-customer-owner {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 15px 18px !important;
  margin: 0 0 18px !important;
  min-height: 72px;
  box-sizing: border-box;
}
.ns-r20-customer-owner__copy { display:grid; gap:6px; min-width:0; }
.ns-r20-overline {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--portal-text-muted, #667085);
}
.ns-r20-customer-owner__value { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; }
.ns-r20-customer-owner__value strong { font-weight:750; color:var(--portal-text, #172033); }
.ns-r20-customer-owner__value span { color:var(--portal-text, #172033); }
html .ns-r20-owner-action { flex:0 0 auto; margin:0 !important; }
html .customer-overview-panels { align-items:start !important; gap:16px !important; }
html .customer-overview-panels > .panel { height:auto !important; min-height:0 !important; }
html .customer-overview-panels .panel-header { margin-bottom:10px !important; }
html .customer-overview-panels .customer-masterdata-grid > div { padding:12px 15px !important; }
html .customer-overview-panels .customer-masterdata-grid > div strong,
html .customer-overview-panels .customer-masterdata-grid > div a { overflow-wrap:anywhere; line-height:1.45; }
html .customer-overview-panels .compact-list { display:grid !important; gap:9px !important; }
html .customer-overview-panels .compact-list > a {
  min-width:0;
  padding:12px 13px !important;
  border:1px solid var(--portal-border, #d7e1ee) !important;
  border-radius:10px !important;
  text-decoration:none;
}
html .customer-overview-panels .customer-note { margin-top:14px !important; padding:13px 15px !important; }
html .customer-overview-panels .customer-note p { margin:6px 0 0 !important; }

/* All new form panels inherit the same netstyle edge, label and input spacing. */
.ns-r20-form-panel,
.ns-r20-worktime-panel,
.ns-r20-list-panel,
.ns-r20-employee-selector { min-width:0; }
html .ns-r20-absence-page > .panel,
html .ns-r20-worktime-page > .panel { margin-bottom:18px !important; padding:18px 20px !important; }
html .ns-r20-form-panel > .panel-header,
html .ns-r20-worktime-panel > .panel-header,
html .ns-r20-list-panel > .panel-header,
html .ns-r20-plan-responsibility > .panel-header { margin:0 0 18px !important; padding:0 0 13px !important; border-bottom:1px solid var(--portal-border, #d7e1ee); }
.ns-r20-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:17px 20px; margin:0; }
.ns-r20-form-grid > .portal-field { display:flex; flex-direction:column; align-items:stretch; gap:7px; min-width:0; margin:0 !important; }
html .ns-r20-form-grid > .portal-field > label,
html .ns-r20-filter-form > .portal-field > label {
  display:block !important;
  margin:0 !important;
  font-weight:700;
  line-height:1.35 !important;
  color:var(--portal-text, #172033);
}
html .ns-r20-form-grid .portal-input,
html .ns-r20-form-grid input:not([type="checkbox"]):not([type="radio"]),
html .ns-r20-form-grid select,
html .ns-r20-filter-form .portal-input {
  width:100% !important;
  min-width:0 !important;
  height:40px !important;
  min-height:40px !important;
  max-height:none !important;
  padding:8px 12px !important;
  border-radius:8px !important;
  box-sizing:border-box !important;
  font:inherit;
}
.ns-r20-form-actions { display:flex; align-items:center; justify-content:flex-start; flex-wrap:wrap; gap:10px; margin:22px 0 0 !important; }
html .ns-r20-form-actions > .primary-button,
html .ns-r20-form-actions > .secondary-button { margin:0 !important; width:auto !important; min-height:40px !important; }
.ns-r20-form-help { margin:0 0 18px !important; line-height:1.5; color:var(--portal-text-muted, #667085); }
.ns-r20-form-grid .errorlist { margin:2px 0 0 !important; padding:0; list-style:none; color:#b42318; font-size:12px; }

/* Personal worktime / employee filter: one row, buttons never glued to field. */
.ns-r20-filter-form { display:grid; grid-template-columns:minmax(200px,1fr) auto; align-items:end; gap:12px 16px; }
.ns-r20-filter-form > .portal-field { display:grid; min-width:0; gap:7px; margin:0 !important; }
html .ns-r20-filter-form > button { min-height:40px !important; margin:0 !important; }
.ns-r20-worktime-standard { display:grid; gap:5px; padding:13px 15px; margin-bottom:18px; background:var(--portal-surface-muted,#f5f8fc); border:1px solid var(--portal-border,#d7e1ee); border-radius:10px; }
.ns-r20-worktime-standard > p { margin:4px 0 0 !important; }
.ns-r20-checkline { display:inline-flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:9px; cursor:pointer; font-weight:650; }
.ns-r20-checkline input[type="checkbox"] { width:18px !important; min-width:18px !important; height:18px !important; margin:0 !important; accent-color:var(--portal-brand-primary,#1769d2); }
html .ns-r20-worktime-table input:not([type="checkbox"]) { display:block; width:100% !important; min-width:0 !important; max-width:100% !important; height:38px !important; border-radius:7px !important; padding:6px 8px !important; box-sizing:border-box; }
html .ns-r20-worktime-table td { padding:10px 12px !important; }
.ns-r20-worktime-table th:first-child { width:28%; }

/* Maintenance plan: optional delegation, not a mandatory create-plan form. */
html .ns-r20-plan-responsibility { margin:0 0 18px !important; padding:18px 20px !important; }
.ns-r20-responsibility-info { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.ns-r20-responsibility-info > div { min-width:0; display:grid; gap:6px; padding:14px 16px; border:1px solid var(--portal-border,#d7e1ee); border-radius:9px; background:var(--portal-surface-muted,#f5f8fc); }
.ns-r20-responsibility-info span { font-size:11px; text-transform:uppercase; letter-spacing:.04em; color:var(--portal-text-muted,#667085); }
.ns-r20-responsibility-info strong { overflow-wrap:anywhere; }
.ns-r20-warning { margin:0 0 12px !important; color:#b42318 !important; }
.ns-r20-delegate-details,
.ns-r20-advanced-details { min-width:0; border:1px solid var(--portal-border,#d7e1ee); border-radius:10px; background:var(--portal-surface,#fff); }
.ns-r20-delegate-details > summary,
.ns-r20-advanced-details > summary { list-style:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; cursor:pointer; color:var(--portal-brand-primary,#1769d2); font-weight:750; }
.ns-r20-delegate-details > summary::after,
.ns-r20-advanced-details > summary::after { content:"+"; font-size:19px; font-weight:600; }
.ns-r20-delegate-details[open] > summary::after,
.ns-r20-advanced-details[open] > summary::after { content:"−"; }
.ns-r20-delegate-details > summary::-webkit-details-marker,
.ns-r20-advanced-details > summary::-webkit-details-marker { display:none; }
.ns-r20-delegate-details > summary:focus-visible,
.ns-r20-advanced-details > summary:focus-visible { outline:3px solid var(--portal-focus,#4f8fdb); outline-offset:2px; }
.ns-r20-delegate-content { padding:18px 16px 20px; border-top:1px solid var(--portal-border,#d7e1ee); }
.ns-r20-advanced-details { margin:18px 0 0; background:var(--portal-surface-muted,#f5f8fc); }
.ns-r20-advanced-details[open] { padding-bottom:12px; }
.ns-r20-advanced-details .ns-r20-checkline,
.ns-r20-advanced-details .ns-r20-form-help { margin:8px 15px !important; }
.ns-r20-delegation-history { margin-top:20px; }
.ns-r20-delegation-history > h3 { margin:0 0 12px !important; }
.ns-r20-delegation-history .table-wrapper { margin:0 !important; }
.ns-r20-plan-responsibility .table-wrapper form { margin:0 !important; }

/* Panel rhythm: no more adjoining preview and history sections. */
html .pruefplan-detail-stack { display:grid !important; gap:18px !important; margin:0 0 18px !important; }
html .pruefplan-detail-stack > .panel { margin:0 !important; }
html .pruefplan-detail-stack + #pruefplan-historie { margin-top:18px !important; }
html .pruefplan-kpi-grid { margin:0 0 18px !important; }
html .pruefplan-preview-panel-full { margin-bottom:0 !important; }

/* Red means delete, including dynamic table actions. */
html .ns-r20-delete,
html .ns-r20-delete:hover { color:#b42318 !important; border-color:#e9a6a0 !important; }
html .ns-r20-delete:hover { background:#fff1ef !important; }

/* User-profile actions belong to header, not separate blank toolbar. */
html .ns-r20-user-heading { align-items:center !important; margin-bottom:18px !important; }
html .ns-r20-user-actions { flex:0 1 auto; gap:10px !important; margin-left:auto !important; }

@media (max-width: 900px) {
  .ns-r20-form-grid, .ns-r20-responsibility-info { grid-template-columns:1fr 1fr; }
  .ns-r20-worktime-table { min-width:610px; }
}
@media (max-width: 680px) {
  .ns-r20-form-grid, .ns-r20-responsibility-info, .ns-r20-filter-form { grid-template-columns:1fr; }
  html .ns-r20-customer-owner { align-items:flex-start; }
  html .ns-r20-absence-page > .panel,
  html .ns-r20-worktime-page > .panel,
  html .ns-r20-plan-responsibility { padding:14px !important; }
  html .customer-tabs.customer-tabs-main > a { flex:0 0 auto; }
}

/* HF1 FIX2: the Wartungsplan delete action had a dedicated class but kept
 * the default blue secondary-button colors. Red is mandatory for deletion.
 * This override is intentionally restricted to the Wartungsplan heading. */
html .page-heading button.secondary-button.pruefplan-danger-button,
html .page-heading button.secondary-button.pruefplan-danger-button:focus-visible {
  color: #fff !important;
  border-color: #bd3f3f !important;
  background: #c84545 !important;
}
html .page-heading button.secondary-button.pruefplan-danger-button:hover:not(:disabled) {
  color: #fff !important;
  border-color: #a43131 !important;
  background: #ae3535 !important;
}
html .page-heading button.secondary-button.pruefplan-danger-button:disabled {
  color: #b56e68 !important;
  border-color: #e3aaa5 !important;
  background: #fff6f5 !important;
  opacity: 0.65;
}

/* HF1 FIX2: portal_design_core.css sets flex-basis:320px on the first
 * page-heading child. When portal_theme_r3329.css switches headings to
 * column direction at <=980px, this unintentionally becomes 320px height.
 * Scope the fix to the customer cockpit, not all portal headings. */
@media (max-width: 980px) {
  html .page-heading.customer-cockpit-heading > :first-child {
    flex: 0 1 auto !important;
    width: 100%;
  }
  html .page-heading.customer-cockpit-heading { gap: 12px !important; }
}

/* R20 USER SCOPE FIX: personal profile layout only, no global theme overrides. */
.ns-r20-personal-profile .ns-r20-personal-profile-row{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}
.ns-r20-personal-profile .ns-r20-personal-profile-row>div:first-child{flex:1 1 260px;min-width:0}
.ns-r20-personal-profile .ns-r20-personal-profile-row h2{margin:0 0 6px}
.ns-r20-personal-profile .ns-r20-personal-profile-row p{margin:0;color:var(--text-muted,#6b7280)}
.ns-r20-personal-profile .ns-r20-personal-profile-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0}
@media(max-width:700px){.ns-r20-personal-profile .ns-r20-personal-profile-row{display:block}.ns-r20-personal-profile .ns-r20-personal-profile-actions{margin-top:16px}}

/* NETSTYLE Technikportal R20 Nachtmodus HF1
 * Loaded after all portal core and R20 scoped stylesheets.
 * Explicit dark + system/dark only. No mutations in light mode.
 * Theme design tokens and WCAG text contrast are central contracts.
 */
/* All dark-mode overrides are duplicated into the OS-dark branch below. */

/* Explicit dark preference. */
html[data-theme-mode="dark"] {
  --ns-night-text: #E8EEF7;
  --ns-night-muted: #B7C8DE;
  --ns-night-label: #B7C8DE;
  --ns-night-surface: #111C2D;
  --ns-night-raised: #15253B;
  --ns-night-inset: #17273E;
  --ns-night-border: #344962;
  --ns-night-link: #8FC1FF;
  --ns-night-on-blue: #FFFFFF;
  --ns-night-btn: #1769D2;
  --ns-night-selected: #16375E;
}
html[data-theme-mode="dark"] { --portal-text-muted: var(--ns-night-muted); --portal-border: var(--ns-night-border); }
html[data-theme-mode="dark"] .pruefplan-definition-list dt,
html[data-theme-mode="dark"] .pruefplan-kpi span,
html[data-theme-mode="dark"] .pruefplan-preview-row > div > span,
html[data-theme-mode="dark"] .pruefplan-preview-row .pruefplan-weekend-shift,
html[data-theme-mode="dark"] .pruefplan-preview-row .school-holiday-note {
 color: var(--ns-night-label) !important;
 opacity: 1 !important;
}
html[data-theme-mode="dark"] .pruefplan-definition-list dd,
html[data-theme-mode="dark"] .pruefplan-kpi strong,
html[data-theme-mode="dark"] .pruefplan-preview-row > div > strong {
 color: var(--ns-night-text) !important;
 opacity: 1 !important;
}
html[data-theme-mode="dark"] .pruefplan-definition-list > div {border-color:var(--ns-night-border)!important;}
html[data-theme-mode="dark"] .pruefplan-definition-list dt,
html[data-theme-mode="dark"] .pruefplan-preview-row > div > span,
html[data-theme-mode="dark"] .pruefplan-kpi span {
  font-size:11.5px!important;
  line-height:1.4!important;
  letter-spacing:.025em!important;
}
html[data-theme-mode="dark"] .pruefplan-definition-list dd,
html[data-theme-mode="dark"] .pruefplan-preview-row > div > strong {
  font-size:13px!important;
  line-height:1.4!important;
}
html[data-theme-mode="dark"] .pruefplan-preview-panel-full .pruefplan-preview-list,
html[data-theme-mode="dark"] .pruefplan-preview-panel .pruefplan-preview-list {
  box-sizing:border-box !important;
  padding:18px 18px 20px !important;
  gap:12px !important;
  margin:0 !important;
}
html[data-theme-mode="dark"] .pruefplan-preview-row {
  background:var(--ns-night-raised) !important;
  border:1px solid var(--ns-night-border) !important;
  color:var(--ns-night-text) !important;
  border-radius:10px !important;
  padding:14px 14px !important;
  row-gap:9px !important;
}
html[data-theme-mode="dark"] .pruefplan-preview-row > div {min-width:0 !important;display:grid;gap:4px;}
html[data-theme-mode="dark"] .pruefplan-preview-row .school-holiday-note,
html[data-theme-mode="dark"] .pruefplan-preview-row .pruefplan-weekend-shift {
  font-size:11px!important;
  line-height:1.45!important;
  margin:6px 0 0!important;
  overflow-wrap:anywhere;
}
html[data-theme-mode="dark"] .pruefplan-preview-panel-full .panel-header {margin-bottom:0!important;}
html[data-theme-mode="dark"] .pruefplan-detail-stack { gap:18px !important; margin-bottom:18px!important; }
html[data-theme-mode="dark"] .pruefplan-detail-stack > .panel,
html[data-theme-mode="dark"] #pruefplan-historie { overflow:hidden; }
html[data-theme-mode="dark"] .pruefplan-detail-stack + #pruefplan-historie { margin-top:20px!important; }
html[data-theme-mode="dark"] #pruefplan-historie > .panel-header {
  padding:18px 20px 16px!important;
  margin:0!important;
  border-bottom:1px solid var(--ns-night-border)!important;
}
html[data-theme-mode="dark"] #pruefplan-historie .table-wrapper {padding-top:12px!important;}
html[data-theme-mode="dark"] #pruefplan-historie .workorder-table {margin:0!important;}
html[data-theme-mode="dark"] .pruefplan-kpi {background:var(--ns-night-surface)!important;color:var(--ns-night-text)!important;}
html[data-theme-mode="dark"] .settings-choice-card {
  background:var(--ns-night-raised)!important;
  border:1px solid var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
  box-shadow:none!important;
}
html[data-theme-mode="dark"] .settings-choice-card strong,
html[data-theme-mode="dark"] .settings-choice-card span {color:var(--ns-night-text)!important;}
html[data-theme-mode="dark"] .settings-choice-card:has(input:checked),
html[data-theme-mode="dark"] .settings-choice-card.is-active,
html[data-theme-mode="dark"] .settings-choice-card.is-selected {
  background:var(--ns-night-selected)!important;
  color:var(--ns-night-text)!important;
  border-color:#8FC1FF!important;
  box-shadow:0 0 0 1px #8FC1FF inset!important;
}
html[data-theme-mode="dark"] .settings-choice-card input[type="radio"] {accent-color:#8FC1FF!important;}
html[data-theme-mode="dark"] .settings-choice-card:focus-within {outline:2px solid #8FC1FF!important;outline-offset:2px!important;}
html[data-theme-mode="dark"] .personal-settings-panel .structured-form fieldset,
html[data-theme-mode="dark"] .personal-settings-panel fieldset,
html[data-theme-mode="dark"] .personal-settings-panel .calendar-toggle-card {
  background:var(--ns-night-surface)!important;
  color:var(--ns-night-text)!important;
  border-color:var(--ns-night-border)!important;
}
html[data-theme-mode="dark"] .personal-settings-panel fieldset legend {color:var(--ns-night-text)!important;}
html[data-theme-mode="dark"] .personal-settings-panel .form-field > small,
html[data-theme-mode="dark"] .personal-settings-panel .calendar-toggle-card small,
html[data-theme-mode="dark"] .ns-r20-personal-profile p {color:var(--ns-night-muted)!important;opacity:1!important;}
html[data-theme-mode="dark"] .portal-section-tabs,
html[data-theme-mode="dark"] .portal-subnav,
html[data-theme-mode="dark"] .customer-tabs,
html[data-theme-mode="dark"] .enterprise-list-toolbar-panel,
html[data-theme-mode="dark"] .worktime-row,
html[data-theme-mode="dark"] .calendar-toggle-card,
html[data-theme-mode="dark"] .credential-scope-card,
html[data-theme-mode="dark"] .advanced-vault-details,
html[data-theme-mode="dark"] .technical-details,
html[data-theme-mode="dark"] .search-summary,
html[data-theme-mode="dark"] .customer-autocomplete-list,
html[data-theme-mode="dark"] .portal-confirm-dialog,
html[data-theme-mode="dark"] .settings-choice-grid > label {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="dark"] .portal-section-tabs a:not(.is-active),
html[data-theme-mode="dark"] .customer-tabs a:not(.is-active),
html[data-theme-mode="dark"] .portal-subnav a:not(.is-active),
html[data-theme-mode="dark"] .workorder-table a:not(.primary-button):not(.secondary-button),
html[data-theme-mode="dark"] .compact-list a:not(.primary-button):not(.secondary-button) {
  color:var(--ns-night-link)!important;
}
html[data-theme-mode="dark"] .portal-section-tabs a.is-active,
html[data-theme-mode="dark"] .portal-subnav a.is-active,
html[data-theme-mode="dark"] .customer-tabs a.is-active {
  background:var(--ns-night-btn)!important;
  color:var(--ns-night-on-blue)!important;
  border-color:var(--ns-night-btn)!important;
}
html[data-theme-mode="dark"] .portal-section-tabs > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html[data-theme-mode="dark"] .portal-subnav > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html[data-theme-mode="dark"] .customer-tabs > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) {
  color:#FFF!important;
}
html[data-theme-mode="dark"] .workorder-table th,
html[data-theme-mode="dark"] .pruefplan-table th,
html[data-theme-mode="dark"] .enterprise-actions-table th {
  background:var(--ns-night-inset)!important;
  color:var(--ns-night-text)!important;
  border-color:var(--ns-night-border)!important;
}
html[data-theme-mode="dark"] .workorder-table td,
html[data-theme-mode="dark"] .pruefplan-table td,
html[data-theme-mode="dark"] .enterprise-actions-table td {
  background:var(--ns-night-surface)!important;
  color:var(--ns-night-text)!important;
  border-color:var(--ns-night-border)!important;
}
html[data-theme-mode="dark"] .workorder-table tbody tr:hover td,
html[data-theme-mode="dark"] .pruefplan-table tbody tr:hover td {
  background:var(--ns-night-raised)!important;
}
html[data-theme-mode="dark"] .workorder-table .table-sort:not(.is-active),
html[data-theme-mode="dark"] .enterprise-actions-table .table-sort:not(.is-active) {
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="dark"] .workorder-table .table-sort.is-active,
html[data-theme-mode="dark"] .enterprise-actions-table .table-sort.is-active {
  color:var(--ns-night-link)!important;
}
html[data-theme-mode="dark"] .pagination-bar,
html[data-theme-mode="dark"] .table-empty-state,
html[data-theme-mode="dark"] .customer-overview-panels .customer-note,
html[data-theme-mode="dark"] .ns-r20-worktime-standard,
html[data-theme-mode="dark"] .ns-r20-responsibility-info > div,
html[data-theme-mode="dark"] .ns-r20-advanced-details {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="dark"] .table-empty-state,
html[data-theme-mode="dark"] .pagination-current,
html[data-theme-mode="dark"] .mini-badge,
html[data-theme-mode="dark"] .ns-r20-overline,
html[data-theme-mode="dark"] .pruefplan-field-hint,
html[data-theme-mode="dark"] .search-summary p,
html[data-theme-mode="dark"] .search-summary span,
html[data-theme-mode="dark"] .dashboard-category-copy small {
  color:var(--ns-night-muted)!important;
}
html[data-theme-mode="dark"] .compact-list > a,
html[data-theme-mode="dark"] .compact-list > div,
html[data-theme-mode="dark"] .customer-overview-panels .compact-list > a,
html[data-theme-mode="dark"] .search-result-card,
html[data-theme-mode="dark"] .search-result-card .panel-header,
html[data-theme-mode="dark"] .dashboard-category-link,
html[data-theme-mode="dark"] .inventar-launch-card,
html[data-theme-mode="dark"] .search-summary {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="dark"] .customer-overview-panels .compact-list a strong,
html[data-theme-mode="dark"] .search-summary strong,
html[data-theme-mode="dark"] .dashboard-category-link strong,
html[data-theme-mode="dark"] .search-result-card strong {color:var(--ns-night-text)!important;}
html[data-theme-mode="dark"] .portal-input,
html[data-theme-mode="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme-mode="dark"] select,
html[data-theme-mode="dark"] textarea {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="dark"] input::placeholder,
html[data-theme-mode="dark"] textarea::placeholder {color:var(--ns-night-muted)!important;opacity:1!important;}
html[data-theme-mode="dark"] .primary-button,
html[data-theme-mode="dark"] button.primary-button,
html[data-theme-mode="dark"] a.primary-button,
html[data-theme-mode="dark"] .search-submit {
  background:var(--ns-night-btn)!important;
  border-color:var(--ns-night-btn)!important;
  color:#fff!important;
}
html[data-theme-mode="dark"] .secondary-button,
html[data-theme-mode="dark"] a.secondary-button,
html[data-theme-mode="dark"] button.secondary-button {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-link)!important;
}
html[data-theme-mode="dark"] .pruefplan-danger-button:not(:disabled),
html[data-theme-mode="dark"] .ns-r20-delete:not(:disabled) {
  background:#b33232!important;
  border-color:#d25f5f!important;
  color:#fff!important;
}
html[data-theme-mode="dark"] .pruefplan-error-panel {background:#38221f!important;border-color:#b45b4a!important;color:#ffe4d8!important;}
html[data-theme-mode="dark"] .pruefplan-error-panel strong,
html[data-theme-mode="dark"] .pruefplan-error-panel p {color:#ffe4d8!important;}
html[data-theme-mode="dark"] .pruefplan-error-panel::before {background:#63372d!important;color:#ffe4d8!important;}
html[data-theme-mode="dark"] .status-badge,
html[data-theme-mode="dark"] .mini-badge {border-color:var(--ns-night-border)!important;}
html[data-theme-mode="dark"] .ns-r20-personal-profile,
html[data-theme-mode="dark"] .personal-settings-panel {color:var(--ns-night-text)!important;}
html[data-theme-mode="dark"] .ns-r20-personal-profile h2,
html[data-theme-mode="dark"] .personal-settings-panel h2 {color:var(--ns-night-text)!important;}
html[data-theme-mode="dark"] .pruefplan-preview-panel-full + #pruefplan-historie {margin-top:18px!important;}
@media (max-width:700px) {
html[data-theme-mode="dark"] .pruefplan-preview-panel-full .pruefplan-preview-list {padding:14px!important;gap:12px!important;}
html[data-theme-mode="dark"] #pruefplan-historie > .panel-header {padding:14px 16px!important;}
html[data-theme-mode="dark"] #pruefplan-historie .table-wrapper {padding-top:10px!important;}
}

/* Follow system preference only when the OS is dark. */
@media(prefers-color-scheme:dark){
html[data-theme-mode="system"] {
  --ns-night-text: #E8EEF7;
  --ns-night-muted: #B7C8DE;
  --ns-night-label: #B7C8DE;
  --ns-night-surface: #111C2D;
  --ns-night-raised: #15253B;
  --ns-night-inset: #17273E;
  --ns-night-border: #344962;
  --ns-night-link: #8FC1FF;
  --ns-night-on-blue: #FFFFFF;
  --ns-night-btn: #1769D2;
  --ns-night-selected: #16375E;
}
html[data-theme-mode="system"] { --portal-text-muted: var(--ns-night-muted); --portal-border: var(--ns-night-border); }
html[data-theme-mode="system"] .pruefplan-definition-list dt,
html[data-theme-mode="system"] .pruefplan-kpi span,
html[data-theme-mode="system"] .pruefplan-preview-row > div > span,
html[data-theme-mode="system"] .pruefplan-preview-row .pruefplan-weekend-shift,
html[data-theme-mode="system"] .pruefplan-preview-row .school-holiday-note {
 color: var(--ns-night-label) !important;
 opacity: 1 !important;
}
html[data-theme-mode="system"] .pruefplan-definition-list dd,
html[data-theme-mode="system"] .pruefplan-kpi strong,
html[data-theme-mode="system"] .pruefplan-preview-row > div > strong {
 color: var(--ns-night-text) !important;
 opacity: 1 !important;
}
html[data-theme-mode="system"] .pruefplan-definition-list > div {border-color:var(--ns-night-border)!important;}
html[data-theme-mode="system"] .pruefplan-definition-list dt,
html[data-theme-mode="system"] .pruefplan-preview-row > div > span,
html[data-theme-mode="system"] .pruefplan-kpi span {
  font-size:11.5px!important;
  line-height:1.4!important;
  letter-spacing:.025em!important;
}
html[data-theme-mode="system"] .pruefplan-definition-list dd,
html[data-theme-mode="system"] .pruefplan-preview-row > div > strong {
  font-size:13px!important;
  line-height:1.4!important;
}
html[data-theme-mode="system"] .pruefplan-preview-panel-full .pruefplan-preview-list,
html[data-theme-mode="system"] .pruefplan-preview-panel .pruefplan-preview-list {
  box-sizing:border-box !important;
  padding:18px 18px 20px !important;
  gap:12px !important;
  margin:0 !important;
}
html[data-theme-mode="system"] .pruefplan-preview-row {
  background:var(--ns-night-raised) !important;
  border:1px solid var(--ns-night-border) !important;
  color:var(--ns-night-text) !important;
  border-radius:10px !important;
  padding:14px 14px !important;
  row-gap:9px !important;
}
html[data-theme-mode="system"] .pruefplan-preview-row > div {min-width:0 !important;display:grid;gap:4px;}
html[data-theme-mode="system"] .pruefplan-preview-row .school-holiday-note,
html[data-theme-mode="system"] .pruefplan-preview-row .pruefplan-weekend-shift {
  font-size:11px!important;
  line-height:1.45!important;
  margin:6px 0 0!important;
  overflow-wrap:anywhere;
}
html[data-theme-mode="system"] .pruefplan-preview-panel-full .panel-header {margin-bottom:0!important;}
html[data-theme-mode="system"] .pruefplan-detail-stack { gap:18px !important; margin-bottom:18px!important; }
html[data-theme-mode="system"] .pruefplan-detail-stack > .panel,
html[data-theme-mode="system"] #pruefplan-historie { overflow:hidden; }
html[data-theme-mode="system"] .pruefplan-detail-stack + #pruefplan-historie { margin-top:20px!important; }
html[data-theme-mode="system"] #pruefplan-historie > .panel-header {
  padding:18px 20px 16px!important;
  margin:0!important;
  border-bottom:1px solid var(--ns-night-border)!important;
}
html[data-theme-mode="system"] #pruefplan-historie .table-wrapper {padding-top:12px!important;}
html[data-theme-mode="system"] #pruefplan-historie .workorder-table {margin:0!important;}
html[data-theme-mode="system"] .pruefplan-kpi {background:var(--ns-night-surface)!important;color:var(--ns-night-text)!important;}
html[data-theme-mode="system"] .settings-choice-card {
  background:var(--ns-night-raised)!important;
  border:1px solid var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
  box-shadow:none!important;
}
html[data-theme-mode="system"] .settings-choice-card strong,
html[data-theme-mode="system"] .settings-choice-card span {color:var(--ns-night-text)!important;}
html[data-theme-mode="system"] .settings-choice-card:has(input:checked),
html[data-theme-mode="system"] .settings-choice-card.is-active,
html[data-theme-mode="system"] .settings-choice-card.is-selected {
  background:var(--ns-night-selected)!important;
  color:var(--ns-night-text)!important;
  border-color:#8FC1FF!important;
  box-shadow:0 0 0 1px #8FC1FF inset!important;
}
html[data-theme-mode="system"] .settings-choice-card input[type="radio"] {accent-color:#8FC1FF!important;}
html[data-theme-mode="system"] .settings-choice-card:focus-within {outline:2px solid #8FC1FF!important;outline-offset:2px!important;}
html[data-theme-mode="system"] .personal-settings-panel .structured-form fieldset,
html[data-theme-mode="system"] .personal-settings-panel fieldset,
html[data-theme-mode="system"] .personal-settings-panel .calendar-toggle-card {
  background:var(--ns-night-surface)!important;
  color:var(--ns-night-text)!important;
  border-color:var(--ns-night-border)!important;
}
html[data-theme-mode="system"] .personal-settings-panel fieldset legend {color:var(--ns-night-text)!important;}
html[data-theme-mode="system"] .personal-settings-panel .form-field > small,
html[data-theme-mode="system"] .personal-settings-panel .calendar-toggle-card small,
html[data-theme-mode="system"] .ns-r20-personal-profile p {color:var(--ns-night-muted)!important;opacity:1!important;}
html[data-theme-mode="system"] .portal-section-tabs,
html[data-theme-mode="system"] .portal-subnav,
html[data-theme-mode="system"] .customer-tabs,
html[data-theme-mode="system"] .enterprise-list-toolbar-panel,
html[data-theme-mode="system"] .worktime-row,
html[data-theme-mode="system"] .calendar-toggle-card,
html[data-theme-mode="system"] .credential-scope-card,
html[data-theme-mode="system"] .advanced-vault-details,
html[data-theme-mode="system"] .technical-details,
html[data-theme-mode="system"] .search-summary,
html[data-theme-mode="system"] .customer-autocomplete-list,
html[data-theme-mode="system"] .portal-confirm-dialog,
html[data-theme-mode="system"] .settings-choice-grid > label {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="system"] .portal-section-tabs a:not(.is-active),
html[data-theme-mode="system"] .customer-tabs a:not(.is-active),
html[data-theme-mode="system"] .portal-subnav a:not(.is-active),
html[data-theme-mode="system"] .workorder-table a:not(.primary-button):not(.secondary-button),
html[data-theme-mode="system"] .compact-list a:not(.primary-button):not(.secondary-button) {
  color:var(--ns-night-link)!important;
}
html[data-theme-mode="system"] .portal-section-tabs a.is-active,
html[data-theme-mode="system"] .portal-subnav a.is-active,
html[data-theme-mode="system"] .customer-tabs a.is-active {
  background:var(--ns-night-btn)!important;
  color:var(--ns-night-on-blue)!important;
  border-color:var(--ns-night-btn)!important;
}
html[data-theme-mode="system"] .portal-section-tabs > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html[data-theme-mode="system"] .portal-subnav > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html[data-theme-mode="system"] .customer-tabs > a.is-active:not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) {
  color:#FFF!important;
}
html[data-theme-mode="system"] .workorder-table th,
html[data-theme-mode="system"] .pruefplan-table th,
html[data-theme-mode="system"] .enterprise-actions-table th {
  background:var(--ns-night-inset)!important;
  color:var(--ns-night-text)!important;
  border-color:var(--ns-night-border)!important;
}
html[data-theme-mode="system"] .workorder-table td,
html[data-theme-mode="system"] .pruefplan-table td,
html[data-theme-mode="system"] .enterprise-actions-table td {
  background:var(--ns-night-surface)!important;
  color:var(--ns-night-text)!important;
  border-color:var(--ns-night-border)!important;
}
html[data-theme-mode="system"] .workorder-table tbody tr:hover td,
html[data-theme-mode="system"] .pruefplan-table tbody tr:hover td {
  background:var(--ns-night-raised)!important;
}
html[data-theme-mode="system"] .workorder-table .table-sort:not(.is-active),
html[data-theme-mode="system"] .enterprise-actions-table .table-sort:not(.is-active) {
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="system"] .workorder-table .table-sort.is-active,
html[data-theme-mode="system"] .enterprise-actions-table .table-sort.is-active {
  color:var(--ns-night-link)!important;
}
html[data-theme-mode="system"] .pagination-bar,
html[data-theme-mode="system"] .table-empty-state,
html[data-theme-mode="system"] .customer-overview-panels .customer-note,
html[data-theme-mode="system"] .ns-r20-worktime-standard,
html[data-theme-mode="system"] .ns-r20-responsibility-info > div,
html[data-theme-mode="system"] .ns-r20-advanced-details {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="system"] .table-empty-state,
html[data-theme-mode="system"] .pagination-current,
html[data-theme-mode="system"] .mini-badge,
html[data-theme-mode="system"] .ns-r20-overline,
html[data-theme-mode="system"] .pruefplan-field-hint,
html[data-theme-mode="system"] .search-summary p,
html[data-theme-mode="system"] .search-summary span,
html[data-theme-mode="system"] .dashboard-category-copy small {
  color:var(--ns-night-muted)!important;
}
html[data-theme-mode="system"] .compact-list > a,
html[data-theme-mode="system"] .compact-list > div,
html[data-theme-mode="system"] .customer-overview-panels .compact-list > a,
html[data-theme-mode="system"] .search-result-card,
html[data-theme-mode="system"] .search-result-card .panel-header,
html[data-theme-mode="system"] .dashboard-category-link,
html[data-theme-mode="system"] .inventar-launch-card,
html[data-theme-mode="system"] .search-summary {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="system"] .customer-overview-panels .compact-list a strong,
html[data-theme-mode="system"] .search-summary strong,
html[data-theme-mode="system"] .dashboard-category-link strong,
html[data-theme-mode="system"] .search-result-card strong {color:var(--ns-night-text)!important;}
html[data-theme-mode="system"] .portal-input,
html[data-theme-mode="system"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme-mode="system"] select,
html[data-theme-mode="system"] textarea {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-text)!important;
}
html[data-theme-mode="system"] input::placeholder,
html[data-theme-mode="system"] textarea::placeholder {color:var(--ns-night-muted)!important;opacity:1!important;}
html[data-theme-mode="system"] .primary-button,
html[data-theme-mode="system"] button.primary-button,
html[data-theme-mode="system"] a.primary-button,
html[data-theme-mode="system"] .search-submit {
  background:var(--ns-night-btn)!important;
  border-color:var(--ns-night-btn)!important;
  color:#fff!important;
}
html[data-theme-mode="system"] .secondary-button,
html[data-theme-mode="system"] a.secondary-button,
html[data-theme-mode="system"] button.secondary-button {
  background:var(--ns-night-raised)!important;
  border-color:var(--ns-night-border)!important;
  color:var(--ns-night-link)!important;
}
html[data-theme-mode="system"] .pruefplan-danger-button:not(:disabled),
html[data-theme-mode="system"] .ns-r20-delete:not(:disabled) {
  background:#b33232!important;
  border-color:#d25f5f!important;
  color:#fff!important;
}
html[data-theme-mode="system"] .pruefplan-error-panel {background:#38221f!important;border-color:#b45b4a!important;color:#ffe4d8!important;}
html[data-theme-mode="system"] .pruefplan-error-panel strong,
html[data-theme-mode="system"] .pruefplan-error-panel p {color:#ffe4d8!important;}
html[data-theme-mode="system"] .pruefplan-error-panel::before {background:#63372d!important;color:#ffe4d8!important;}
html[data-theme-mode="system"] .status-badge,
html[data-theme-mode="system"] .mini-badge {border-color:var(--ns-night-border)!important;}
html[data-theme-mode="system"] .ns-r20-personal-profile,
html[data-theme-mode="system"] .personal-settings-panel {color:var(--ns-night-text)!important;}
html[data-theme-mode="system"] .ns-r20-personal-profile h2,
html[data-theme-mode="system"] .personal-settings-panel h2 {color:var(--ns-night-text)!important;}
html[data-theme-mode="system"] .pruefplan-preview-panel-full + #pruefplan-historie {margin-top:18px!important;}
@media (max-width:700px) {
html[data-theme-mode="system"] .pruefplan-preview-panel-full .pruefplan-preview-list {padding:14px!important;gap:12px!important;}
html[data-theme-mode="system"] #pruefplan-historie > .panel-header {padding:14px 16px!important;}
html[data-theme-mode="system"] #pruefplan-historie .table-wrapper {padding-top:10px!important;}
}
}

/* HF10 portal design extension: uses shared theme tokens, no divergent palette. */
.ns-hf10-recipient-area {margin-top:16px; padding:16px; border:1px solid var(--ns-border, var(--border-color, #52647c)); border-radius:10px;}
.ns-hf10-recipient-area label {display:block;margin-bottom:8px;font-weight:650;}
.ns-hf10-auto-representative {margin:0 0 12px;color:var(--ns-text,inherit);}
.ns-hf10-recipient-actions, .ns-hf10-recipient-chip {display:flex;flex-flow:row nowrap;align-items:center;gap:8px;}
.ns-hf10-recipient-actions {overflow-x:auto;padding-bottom:4px;}
.ns-hf10-recipient-actions select {flex:1 0 230px;min-width:230px;}
.ns-hf10-recipient-actions button, .ns-hf10-recipient-chip button {flex:0 0 auto;white-space:nowrap;}
.ns-hf10-selected {display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;}
.ns-hf10-recipient-chip {max-width:100%;padding:5px 7px;border:1px solid var(--ns-border,#52647c);border-radius:8px;background:var(--ns-surface-raised,transparent);color:var(--ns-text,inherit);}
.ns-hf10-recipient-chip span {max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ns-hf10-js-hidden {display:none !important;}
.ns-hf10-lifecycle-cell {display:block;white-space:nowrap;}
.ns-hf10-lifecycle-cell small {display:block;color:var(--ns-text-secondary,inherit);}
/* Light/dark explicit contrast fix for maintenance-plan status banner. */
.ns-hf10-status-alert {background:#3b2020 !important;color:#fff2eb !important;border:1px solid #c96650 !important;}
.ns-hf10-status-alert * {color:#fff2eb !important;opacity:1 !important;}
/* Customer form: checkbox remains a checkbox, aligned with note textarea. */
.ns-hf10-customer-active {display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:40px;}
.ns-hf10-customer-active input[type="checkbox"] {width:17px;height:17px;flex:0 0 17px;}
/* The dark-mode screenshot showed dark text on a dark warning banner. */
.portal-message.warning {background:#39291c !important;border:1px solid #bf8b45 !important;color:#fff1d2 !important;}
.portal-message.warning .portal-message-copy {color:#fff1d2 !important;opacity:1 !important;}
.portal-message.warning .portal-message-close {color:#fff1d2 !important;}
.portal-message.error {background:#3c2022 !important;border:1px solid #cb645f !important;color:#fff1ed !important;}
.portal-message.error .portal-message-copy {color:#fff1ed !important;opacity:1 !important;}
.portal-message.error .portal-message-close {color:#fff1ed !important;}

/* Netstyle Technikportal R20 HF2: component-scoped contracts.
   Loaded AFTER portal_theme, r20_ui_acceptance and r20_nachtmodus_hf1.
   Desktop layout rules apply to both themes; dark overrides only to dark. */
:root { --ns-hf2-gap: 16px; --ns-hf2-control-h: 40px; }
/* Oversized viewport: all six customer KPI cards belong to one row. */
@media (min-width: 1320px) {
  html .customer-kpis-primary.ns-hf2-customer-kpis {
    display:grid !important; grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:var(--ns-hf2-gap) !important;
  }
  html .customer-overview-grid-large.ns-hf2-customer-shortcuts {
    grid-template-columns:repeat(7,minmax(0,1fr)) !important;
    gap:12px !important; padding:16px !important;
  }
  html .ns-hf2-report-secondary-kpis {
    grid-template-columns:repeat(7,minmax(0,1fr)) !important;
  }
  html .ns-hf2-report-filters .report-filter {
    grid-template-columns:repeat(4,minmax(0,1fr)) max-content max-content !important;
    align-items:end; gap:12px !important;
  }
  html .ns-hf2-report-filters .report-filter > .primary-button,
  html .ns-hf2-report-filters .report-filter > .secondary-button {white-space:nowrap !important;}
}
/* At medium widths use responsive rows rather than forcing horizontal scroll. */
@media (min-width: 800px) and (max-width: 1319px) {
  html .customer-kpis-primary.ns-hf2-customer-kpis {grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
  html .ns-hf2-report-secondary-kpis {grid-template-columns:repeat(4,minmax(0,1fr)) !important;}
  html .ns-hf2-report-filters .report-filter {grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media(max-width:799px) {
  html .customer-kpis-primary.ns-hf2-customer-kpis,
  html .ns-hf2-report-secondary-kpis {grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
  html .ns-hf2-report-filters .report-filter {grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media(max-width:520px) {
  html .customer-kpis-primary.ns-hf2-customer-kpis,
  html .ns-hf2-report-secondary-kpis,
  html .ns-hf2-report-filters .report-filter {grid-template-columns:minmax(0,1fr) !important;}
}
/* Same panel height in a row without compressing content. */
html .customer-overview-panels.ns-hf2-customer-panels,
html .portal-two-column:has(> .asset-relation-panel) {align-items:stretch !important;gap:var(--ns-hf2-gap) !important;}
html .customer-overview-panels.ns-hf2-customer-panels > .panel,
html .portal-two-column:has(> .asset-relation-panel) > .asset-relation-panel {height:100% !important;box-sizing:border-box;min-width:0;}
html .customer-overview-panels.ns-hf2-customer-panels .compact-list {padding:12px !important;display:flex;flex-direction:column;gap:8px;}
html .customer-overview-panels.ns-hf2-customer-panels .compact-list > * {margin:0 !important;}
html .ns-hf2-customer-shortcuts > a {min-width:0;padding:14px 12px !important;border-radius:10px;overflow-wrap:anywhere;}
html .ns-hf2-customer-shortcuts > a > * {margin:0 !important;}
html .ns-hf2-customer-shortcuts > a > *+* {margin-top:6px !important;}
/* Form controls: consistent minimum height and label/control spacing. */
html .structured-form .structured-form-grid > .form-field {min-width:0;display:flex;flex-direction:column;gap:8px;}
html .structured-form .structured-form-grid .portal-input,
html .structured-form .structured-form-grid input:not([type=checkbox]):not([type=radio]),
html .structured-form .structured-form-grid select {box-sizing:border-box;min-height:var(--ns-hf2-control-h);}
html .structured-form .structured-form-grid textarea {min-height:88px;}
html .structured-form .structured-form-grid .portal-check-row {min-height:56px;padding:10px 12px;border:1px solid var(--portal-border);border-radius:10px;}
html .form-panel .form-grid .portal-field {min-width:0;}
html .form-panel .form-grid input:not([type=checkbox]):not([type=radio]),
html .form-panel .form-grid select {min-height:var(--ns-hf2-control-h);box-sizing:border-box;}
html .form-panel .form-grid .completed-control {border:1px solid var(--portal-border);border-radius:10px;padding:10px 12px;min-height:48px;display:inline-flex;gap:10px;align-items:center;}
/* Version actions may NEVER wrap into unreadable buttons. */
html .enterprise-row-actions .secondary-button,
html .workorder-table td .enterprise-row-button,
html .workorder-table td > .secondary-button {white-space:nowrap !important;overflow-wrap:normal !important;min-width:max-content;}
/* Lifecycle version actions: button text never wraps inside narrow table columns. */
html .lifecycle-row-actions {display:flex;align-items:center;gap:8px;flex-wrap:nowrap;}
html .lifecycle-row-actions .lifecycle-row-button {white-space:nowrap !important;overflow-wrap:normal !important;min-width:max-content;flex:0 0 auto;}
/* Repeated non-text icon needs a visible foreground on the dark header. */
html[data-theme-mode="dark"] .topbar .notification {color:#e8eef7 !important;border-color:#3c526d !important;}
@media(prefers-color-scheme:dark) {html[data-theme-mode="system"] .topbar .notification {color:#e8eef7 !important;border-color:#3c526d !important;}}
/* Form UI for plan and category cannot grow the document viewport. */
html .pruefplan-editor-form,
html .pruefplan-editor-grid,
html .pruefplan-form-grid,
html .pruefplan-editor-form .panel,
html .pruefplan-editor-form :is(.form-field,.portal-field),
html .form-panel .form-grid,
html .form-panel .portal-field,
html .category-color-control,
html .category-icon-control {min-width:0 !important;max-width:100%;box-sizing:border-box;}
html .pruefplan-editor-form :is(input,select,textarea),
html .form-panel .form-grid :is(input:not([type=checkbox]),select,textarea) {max-width:100% !important;box-sizing:border-box;}
html .category-icon-control {flex-wrap:wrap;}
/* Buttons, panels, filter cards receive the same 16px vertical safety gutter. */
html .ns-hf2-report-filters .report-filter {min-width:0;margin-bottom:0 !important;}
html .ns-hf2-report-filters {padding:16px !important;}
html .report-kpi-grid.ns-hf2-report-secondary-kpis {margin:18px 0 0 !important;gap:12px !important;}
html .report-kpi-grid.ns-hf2-report-secondary-kpis > * {min-width:0;}
html .panel > .panel-header + .customer-overview-grid,
html .panel > .panel-header + .compact-list {margin-top:0 !important;}
html .panel > .panel-header + .customer-overview-grid {padding:16px !important;}
/* Red delete means delete everywhere, never a default blue action. */
html button.secondary-button[data-portal-delete],
html button.secondary-button.ns-r20-delete {color:#fff !important;background:#bf3e3e !important;border-color:#aa3232 !important;}

/* Explicit dark mode */
html[data-theme-mode="dark"] {
  /* Core night surfaces: target sources of repeated audit warnings, not global body elements. */
  --ns-hf2-night-bg:#111c2d;
  --ns-hf2-night-raised:#17293f;
  --ns-hf2-night-border:#3c526d;
  --ns-hf2-night-fg:#e8eef7;
  --ns-hf2-night-muted:#bed1ea;
}


  /* KPI cards contained light backgrounds and nearly invisible numbers. */
html[data-theme-mode="dark"] .audit-kpi-grid .audit-kpi-card,
html[data-theme-mode="dark"] .report-kpi-grid .report-kpi,
html[data-theme-mode="dark"] .dashboard-kpi-link,
html[data-theme-mode="dark"] .customer-overview-grid-large > a,
html[data-theme-mode="dark"] .settings-choice-grid > label.settings-choice-card,
html[data-theme-mode="dark"] .category-icon-selected,
html[data-theme-mode="dark"] .category-color-control,
html[data-theme-mode="dark"] .asset-relation-panel .compact-list > a {
    background:var(--ns-hf2-night-raised) !important;
    color:var(--ns-hf2-night-fg) !important;
    border-color:var(--ns-hf2-night-border) !important;
    box-shadow:none !important;
  }
html[data-theme-mode="dark"] .audit-kpi-grid .audit-kpi-card > span,
html[data-theme-mode="dark"] .report-kpi-grid .report-kpi > span,
html[data-theme-mode="dark"] .customer-overview-grid-large > a > span,
html[data-theme-mode="dark"] .dashboard-kpi-link small,
html[data-theme-mode="dark"] .asset-detail-grid > div > span,
html[data-theme-mode="dark"] .customer-masterdata-grid > div > span {
    color:var(--ns-hf2-night-muted) !important;
    opacity:1 !important;
  }
html[data-theme-mode="dark"] .audit-kpi-grid .audit-kpi-card > strong,
html[data-theme-mode="dark"] .report-kpi-grid .report-kpi > strong,
html[data-theme-mode="dark"] .customer-overview-grid-large > a > strong,
html[data-theme-mode="dark"] .asset-detail-grid > div > strong,
html[data-theme-mode="dark"] .customer-masterdata-grid > div > strong,
html[data-theme-mode="dark"] .settings-choice-grid > label.settings-choice-card strong,
html[data-theme-mode="dark"] .settings-choice-grid > label.settings-choice-card span {
    color:var(--ns-hf2-night-fg) !important;
    opacity:1 !important;
  }
html[data-theme-mode="dark"] .settings-choice-grid > label.settings-choice-card:has(input:checked),
html[data-theme-mode="dark"] .settings-choice-grid > label.settings-choice-card.is-selected {
    background:#193c62 !important;border-color:#9ac8ff !important;color:#fff !important;
    box-shadow:0 0 0 1px #9ac8ff inset !important;
  }
html[data-theme-mode="dark"] .settings-choice-grid > label.settings-choice-card:has(input:checked) strong,
html[data-theme-mode="dark"] .settings-choice-grid > label.settings-choice-card.is-selected strong {color:#fff !important;}
html[data-theme-mode="dark"] .report-filter :is(label,input,select),
html[data-theme-mode="dark"] .structured-form .form-field label,
html[data-theme-mode="dark"] .form-panel .portal-field label {color:var(--ns-hf2-night-fg) !important;}
html[data-theme-mode="dark"] .structured-form .portal-check-row,
html[data-theme-mode="dark"] .form-panel .completed-control {background:var(--ns-hf2-night-raised) !important;border-color:var(--ns-hf2-night-border) !important;color:var(--ns-hf2-night-fg) !important;}
html[data-theme-mode="dark"] .asset-relation-panel .compact-list .empty-state {color:var(--ns-hf2-night-muted) !important;}
html[data-theme-mode="dark"] .ns-hf2-report-filters, html[data-theme-mode="dark"] .ns-hf2-report-filters .report-filter {background:var(--ns-hf2-night-bg) !important;}

@media (prefers-color-scheme: dark) {
html[data-theme-mode="system"] {
  /* Core night surfaces: target sources of repeated audit warnings, not global body elements. */
  --ns-hf2-night-bg:#111c2d;
  --ns-hf2-night-raised:#17293f;
  --ns-hf2-night-border:#3c526d;
  --ns-hf2-night-fg:#e8eef7;
  --ns-hf2-night-muted:#bed1ea;
}

  /* KPI cards contained light backgrounds and nearly invisible numbers. */
html[data-theme-mode="system"] .audit-kpi-grid .audit-kpi-card,
html[data-theme-mode="system"] .report-kpi-grid .report-kpi,
html[data-theme-mode="system"] .dashboard-kpi-link,
html[data-theme-mode="system"] .customer-overview-grid-large > a,
html[data-theme-mode="system"] .settings-choice-grid > label.settings-choice-card,
html[data-theme-mode="system"] .category-icon-selected,
html[data-theme-mode="system"] .category-color-control,
html[data-theme-mode="system"] .asset-relation-panel .compact-list > a {
    background:var(--ns-hf2-night-raised) !important;
    color:var(--ns-hf2-night-fg) !important;
    border-color:var(--ns-hf2-night-border) !important;
    box-shadow:none !important;
  }
html[data-theme-mode="system"] .audit-kpi-grid .audit-kpi-card > span,
html[data-theme-mode="system"] .report-kpi-grid .report-kpi > span,
html[data-theme-mode="system"] .customer-overview-grid-large > a > span,
html[data-theme-mode="system"] .dashboard-kpi-link small,
html[data-theme-mode="system"] .asset-detail-grid > div > span,
html[data-theme-mode="system"] .customer-masterdata-grid > div > span {
    color:var(--ns-hf2-night-muted) !important;
    opacity:1 !important;
  }
html[data-theme-mode="system"] .audit-kpi-grid .audit-kpi-card > strong,
html[data-theme-mode="system"] .report-kpi-grid .report-kpi > strong,
html[data-theme-mode="system"] .customer-overview-grid-large > a > strong,
html[data-theme-mode="system"] .asset-detail-grid > div > strong,
html[data-theme-mode="system"] .customer-masterdata-grid > div > strong,
html[data-theme-mode="system"] .settings-choice-grid > label.settings-choice-card strong,
html[data-theme-mode="system"] .settings-choice-grid > label.settings-choice-card span {
    color:var(--ns-hf2-night-fg) !important;
    opacity:1 !important;
  }
html[data-theme-mode="system"] .settings-choice-grid > label.settings-choice-card:has(input:checked),
html[data-theme-mode="system"] .settings-choice-grid > label.settings-choice-card.is-selected {
    background:#193c62 !important;border-color:#9ac8ff !important;color:#fff !important;
    box-shadow:0 0 0 1px #9ac8ff inset !important;
  }
html[data-theme-mode="system"] .settings-choice-grid > label.settings-choice-card:has(input:checked) strong,
html[data-theme-mode="system"] .settings-choice-grid > label.settings-choice-card.is-selected strong {color:#fff !important;}
html[data-theme-mode="system"] .report-filter :is(label,input,select),
html[data-theme-mode="system"] .structured-form .form-field label,
html[data-theme-mode="system"] .form-panel .portal-field label {color:var(--ns-hf2-night-fg) !important;}
html[data-theme-mode="system"] .structured-form .portal-check-row,
html[data-theme-mode="system"] .form-panel .completed-control {background:var(--ns-hf2-night-raised) !important;border-color:var(--ns-hf2-night-border) !important;color:var(--ns-hf2-night-fg) !important;}
html[data-theme-mode="system"] .asset-relation-panel .compact-list .empty-state {color:var(--ns-hf2-night-muted) !important;}
html[data-theme-mode="system"] .ns-hf2-report-filters, html[data-theme-mode="system"] .ns-hf2-report-filters .report-filter {background:var(--ns-hf2-night-bg) !important;}

}


/* ============================================================
   R20 DESIGN HF2 FIX1: Screenshot-audit-specific repairs.
   Hidden source form controls only exist after JavaScript has
   built accessible replacement widgets. Keep no-JS fallbacks.
   ============================================================ */
html body select.portal-input.checklist-template-select-source,
html body input.portal-input.category-icon-source {
  display:none !important;
  position:static !important;
  width:0 !important;
  height:0 !important;
  max-width:0 !important;
  padding:0 !important;
  margin:0 !important;
}
/* Do not hide the enhanced user-facing pickers. */
html .checklist-template-picker,
html .category-icon-control {min-width:0;max-width:100%;box-sizing:border-box;}

/* Contrast repairs for the exact component families surfaced by the
   authenticated Chromium audit. Separate branches preserve light mode. */

/* Customer cockpit: previous fixed white cells caused 1.17:1 text contrast. */
html[data-theme-mode="dark"] .customer-masterdata-grid > div,
html[data-theme-mode="dark"] .asset-detail-grid.customer-masterdata-grid > div {
  background:#17293f !important;
  border-color:#3c526d !important;
  color:#e8eef7 !important;
}
html[data-theme-mode="dark"] .customer-masterdata-grid > div > span,
html[data-theme-mode="dark"] .asset-detail-grid.customer-masterdata-grid > div > span {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="dark"] .customer-masterdata-grid > div > strong,
html[data-theme-mode="dark"] .customer-masterdata-grid > div > a,
html[data-theme-mode="dark"] .asset-detail-grid.customer-masterdata-grid > div > strong {
  color:#e8eef7 !important;opacity:1 !important;
}
/* Dashboard: nested KPI labels and counts escaped earlier descendant rules. */
html[data-theme-mode="dark"] .dashboard-kpi-link .kpi-label,
html[data-theme-mode="dark"] .dashboard-kpi-link small,
html[data-theme-mode="dark"] .dashboard-kpi-link .kpi-icon {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="dark"] .dashboard-kpi-link strong,
html[data-theme-mode="dark"] .dashboard-kpi-link .kpi-value,
html[data-theme-mode="dark"] .dashboard-main .empty-state strong,
html[data-theme-mode="dark"] .dashboard-main .panel .empty-state strong {
  color:#e8eef7 !important;opacity:1 !important;
}
/* Audit trail: fixed pale labels on a dark audit change table. */
html[data-theme-mode="dark"] .audit-change-line > strong,
html[data-theme-mode="dark"] .audit-sequence,
html[data-theme-mode="dark"] .audit-context-point {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="dark"] .audit-human-summary,
html[data-theme-mode="dark"] .audit-change-details summary {
  color:#e8eef7 !important;opacity:1 !important;
}
html[data-theme-mode="dark"] .audit-value--before {
  background:#203248 !important;color:#e8eef7 !important;border:1px solid #3c526d !important;
}
html[data-theme-mode="dark"] .audit-value--after {
  background:#e1e9f4 !important;color:#112b4b !important;border:1px solid #87a1c0 !important;
}
/* Form header/summary cards on lifecycle, category and template pages. */
html[data-theme-mode="dark"] .lifecycle-summary-card,
html[data-theme-mode="dark"] .lifecycle-audit-cell,
html[data-theme-mode="dark"] .vorlage-summary-card,
html[data-theme-mode="dark"] .category-icon-selected,
html[data-theme-mode="dark"] .category-picker-option {
  background:#17293f !important;border-color:#3c526d !important;color:#e8eef7 !important;
}
html[data-theme-mode="dark"] .lifecycle-summary-card :is(span,small),
html[data-theme-mode="dark"] .lifecycle-audit-cell :is(span,small),
html[data-theme-mode="dark"] .lifecycle-summary-card > span,
html[data-theme-mode="dark"] .template-summary span {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="dark"] .lifecycle-summary-card strong,
html[data-theme-mode="dark"] .lifecycle-audit-cell strong {
  color:#e8eef7 !important;opacity:1 !important;
}
/* Soft-contrast interactive text and upload hints. */
html[data-theme-mode="dark"] .portal-upload-zone :is(small,span),
html[data-theme-mode="dark"] .upload-dropzone :is(small,span),
html[data-theme-mode="dark"] .portal-file-drop-zone :is(small,span),
html[data-theme-mode="dark"] .asset-relation-panel .empty-state,
html[data-theme-mode="dark"] .portal-empty-state {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="dark"] .category-icon-selected-symbol,
html[data-theme-mode="dark"] .inventar-launch-card .launch-icon,
html[data-theme-mode="dark"] .inventar-launch-card .icon {
  color:#e8eef7 !important;
}

@media (prefers-color-scheme:dark) {

/* Customer cockpit: previous fixed white cells caused 1.17:1 text contrast. */
html[data-theme-mode="system"] .customer-masterdata-grid > div,
html[data-theme-mode="system"] .asset-detail-grid.customer-masterdata-grid > div {
  background:#17293f !important;
  border-color:#3c526d !important;
  color:#e8eef7 !important;
}
html[data-theme-mode="system"] .customer-masterdata-grid > div > span,
html[data-theme-mode="system"] .asset-detail-grid.customer-masterdata-grid > div > span {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="system"] .customer-masterdata-grid > div > strong,
html[data-theme-mode="system"] .customer-masterdata-grid > div > a,
html[data-theme-mode="system"] .asset-detail-grid.customer-masterdata-grid > div > strong {
  color:#e8eef7 !important;opacity:1 !important;
}
/* Dashboard: nested KPI labels and counts escaped earlier descendant rules. */
html[data-theme-mode="system"] .dashboard-kpi-link .kpi-label,
html[data-theme-mode="system"] .dashboard-kpi-link small,
html[data-theme-mode="system"] .dashboard-kpi-link .kpi-icon {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="system"] .dashboard-kpi-link strong,
html[data-theme-mode="system"] .dashboard-kpi-link .kpi-value,
html[data-theme-mode="system"] .dashboard-main .empty-state strong,
html[data-theme-mode="system"] .dashboard-main .panel .empty-state strong {
  color:#e8eef7 !important;opacity:1 !important;
}
/* Audit trail: fixed pale labels on a dark audit change table. */
html[data-theme-mode="system"] .audit-change-line > strong,
html[data-theme-mode="system"] .audit-sequence,
html[data-theme-mode="system"] .audit-context-point {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="system"] .audit-human-summary,
html[data-theme-mode="system"] .audit-change-details summary {
  color:#e8eef7 !important;opacity:1 !important;
}
html[data-theme-mode="system"] .audit-value--before {
  background:#203248 !important;color:#e8eef7 !important;border:1px solid #3c526d !important;
}
html[data-theme-mode="system"] .audit-value--after {
  background:#e1e9f4 !important;color:#112b4b !important;border:1px solid #87a1c0 !important;
}
/* Form header/summary cards on lifecycle, category and template pages. */
html[data-theme-mode="system"] .lifecycle-summary-card,
html[data-theme-mode="system"] .lifecycle-audit-cell,
html[data-theme-mode="system"] .vorlage-summary-card,
html[data-theme-mode="system"] .category-icon-selected,
html[data-theme-mode="system"] .category-picker-option {
  background:#17293f !important;border-color:#3c526d !important;color:#e8eef7 !important;
}
html[data-theme-mode="system"] .lifecycle-summary-card :is(span,small),
html[data-theme-mode="system"] .lifecycle-audit-cell :is(span,small),
html[data-theme-mode="system"] .lifecycle-summary-card > span,
html[data-theme-mode="system"] .template-summary span {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="system"] .lifecycle-summary-card strong,
html[data-theme-mode="system"] .lifecycle-audit-cell strong {
  color:#e8eef7 !important;opacity:1 !important;
}
/* Soft-contrast interactive text and upload hints. */
html[data-theme-mode="system"] .portal-upload-zone :is(small,span),
html[data-theme-mode="system"] .upload-dropzone :is(small,span),
html[data-theme-mode="system"] .portal-file-drop-zone :is(small,span),
html[data-theme-mode="system"] .asset-relation-panel .empty-state,
html[data-theme-mode="system"] .portal-empty-state {
  color:#bed1ea !important;opacity:1 !important;
}
html[data-theme-mode="system"] .category-icon-selected-symbol,
html[data-theme-mode="system"] .inventar-launch-card .launch-icon,
html[data-theme-mode="system"] .inventar-launch-card .icon {
  color:#e8eef7 !important;
}

}


html[data-theme-mode="dark"] .dashboard-main .empty-state > strong,
html[data-theme-mode="dark"] .donut-inner > span,
html[data-theme-mode="dark"] .dashboard-category-link small {
  color:#c9dbef !important;opacity:1 !important;
}

@media (prefers-color-scheme:dark) {

html[data-theme-mode="system"] .dashboard-main .empty-state > strong,
html[data-theme-mode="system"] .donut-inner > span,
html[data-theme-mode="system"] .dashboard-category-link small {
  color:#c9dbef !important;opacity:1 !important;
}

}

/* ================================================================
   NETSTYLE HF2 ALL-IN-ONE: outstanding screenshot defects.
   Light and dark share the same geometry; do not alter view logic.
   ================================================================ */
:root { --ns-hf2-field-gap: 12px; --ns-hf2-card-gap: 16px; }
/* Contact: identical field/control heights, no checkbox offset or squeezed textarea. */
html .ns-hf2-contact-form .structured-form-grid {
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:16px 18px !important;
  align-items:start !important;
}
html .ns-hf2-contact-form .structured-form-grid > .form-field {
  min-width:0;display:flex;flex-direction:column;gap:8px !important;margin:0 !important;
}
html .ns-hf2-contact-form .structured-form-grid > .form-field > :is(input:not([type="checkbox"]),select) {
  min-height:40px !important;height:40px !important;width:100%;box-sizing:border-box;
}
html .ns-hf2-contact-form .structured-form-grid > .checkbox-field:not(.form-field-full) {
  padding-top:21px !important;
}
html .ns-hf2-contact-form .portal-check-row {
  box-sizing:border-box;min-height:40px !important;padding:8px 12px !important;
  margin:0 !important;display:flex;align-items:center;gap:10px !important;
  border:1px solid var(--portal-border);border-radius:9px;
}
html .ns-hf2-contact-form .form-field-full {grid-column:1/-1 !important;}
html .ns-hf2-contact-form textarea {width:100% !important;min-height:88px !important;box-sizing:border-box;}
html .ns-hf2-contact-form .form-actions {
  display:flex;justify-content:flex-end;align-items:center;gap:12px !important;
  margin-top:16px !important;padding-top:16px !important;
}
/* Asset pages: peer panels share their row height, independent of content length. */
html .portal-two-column.ns-hf2-asset-relations {
  display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  align-items:stretch !important;gap:16px !important;margin:16px 0 !important;
}
html .ns-hf2-asset-relations > .panel.asset-relation-panel {
  height:auto !important;min-height:160px !important;min-width:0 !important;
  margin:0 !important;
  display:flex !important;flex-direction:column !important;align-self:stretch !important;
  box-sizing:border-box;
}
html .ns-hf2-asset-relations > .panel.asset-relation-panel > .panel-header {
  min-height:72px !important;padding:14px 16px !important;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  box-sizing:border-box;
}
html .ns-hf2-asset-relations > .panel.asset-relation-panel > .compact-list {
  flex:1 1 auto;min-height:0 !important;display:flex;flex-direction:column;
}
html .ns-hf2-asset-relations .asset-credential-row {padding:12px 16px !important;min-height:52px !important;box-sizing:border-box;}
html .ns-hf2-asset-relations .enterprise-row-actions {display:flex;align-items:center;gap:8px;flex-wrap:nowrap;}
html .ns-hf2-asset-relations .secondary-button {white-space:nowrap;}
/* All templates: action labels remain on one line. The table itself may scroll on tiny screens. */
html .ns-hf2-version-actions .lifecycle-actions-column {min-width:196px !important;white-space:nowrap !important;}
html .ns-hf2-version-actions .lifecycle-row-actions {
  display:inline-flex !important;align-items:center !important;justify-content:flex-end;
  flex-wrap:nowrap !important;gap:8px !important;min-width:max-content;
}
html .ns-hf2-version-actions .lifecycle-row-button {
  display:inline-flex !important;align-items:center;justify-content:center;
  white-space:nowrap !important;word-break:keep-all !important;overflow-wrap:normal !important;
  min-width:90px !important;height:36px;box-sizing:border-box;padding:8px 12px !important;
}
/* Cockpit: unify card alignment, borders and reliable gutters. */
html .customer-kpis-primary.ns-hf2-customer-kpis > .audit-kpi-card {
  height:100% !important;min-width:0 !important;box-sizing:border-box;
  padding:16px !important;display:flex;flex-direction:column;justify-content:center;
}
html .customer-overview-panels.ns-hf2-customer-panels {display:grid !important;align-items:stretch !important;gap:16px !important;}
html .customer-overview-panels.ns-hf2-customer-panels > .panel {
  min-height:0 !important;height:auto !important;align-self:stretch !important;
  display:flex;flex-direction:column;box-sizing:border-box;
}
html .customer-overview-panels.ns-hf2-customer-panels .customer-masterdata-grid {flex:1;}
html .customer-overview-panels.ns-hf2-customer-panels .compact-list {
  flex:1;gap:8px !important;padding:12px 14px !important;min-height:0 !important;
}
html .customer-overview-panels.ns-hf2-customer-panels .compact-list > :is(a,div,p) {
  min-height:50px;box-sizing:border-box;margin:0 !important;
  padding:10px 12px !important;border-radius:9px;
}
html .ns-hf2-customer-shortcuts {box-sizing:border-box;padding:16px !important;gap:10px !important;}
html .ns-hf2-customer-shortcuts > a {
  height:100% !important;box-sizing:border-box;min-height:94px;
  display:flex;flex-direction:column;justify-content:flex-start;
  gap:8px !important;padding:14px !important;
}
html .ns-hf2-customer-shortcuts > a > * {margin:0 !important;}
/* Report dashboard: four filters and both buttons are peers on desktop. */
html .ns-hf2-report-filters {margin-bottom:16px !important;}
html .ns-hf2-report-filters .report-filter {
  display:grid !important;align-items:end !important;gap:12px !important;
}
html .ns-hf2-report-filters .report-filter > :is(button,a) {
  height:40px !important;min-height:40px;min-width:110px;
  padding:8px 12px !important;display:inline-flex;align-items:center;justify-content:center;
  white-space:nowrap !important;box-sizing:border-box;
}
html .report-kpi-grid.ns-hf2-report-secondary-kpis > .report-kpi {
  min-width:0;box-sizing:border-box;min-height:74px;padding:12px 14px !important;
}
/* Repeated panel and form spacing without changing theme colours. */
html .ns-hf2-contact-form .form-field label,
html .ns-hf2-report-filters .report-filter label {margin-bottom:0 !important;}
@media (min-width:1320px) {
 html .customer-kpis-primary.ns-hf2-customer-kpis {grid-template-columns:repeat(6,minmax(0,1fr)) !important;}
 html .ns-hf2-report-secondary-kpis {grid-template-columns:repeat(7,minmax(0,1fr)) !important;}
 html .ns-hf2-report-filters .report-filter {grid-template-columns:repeat(4,minmax(0,1fr)) max-content max-content !important;}
 html .customer-overview-panels.ns-hf2-customer-panels {grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media (max-width:1319px) and (min-width:800px) {
 html .customer-overview-panels.ns-hf2-customer-panels {grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}
@media (max-width:900px) {
 html .portal-two-column.ns-hf2-asset-relations {grid-template-columns:minmax(0,1fr) !important;}
 html .ns-hf2-contact-form .structured-form-grid {gap:14px !important;}
}
@media (max-width:700px) {
 html .ns-hf2-contact-form .structured-form-grid {grid-template-columns:minmax(0,1fr) !important;}
 html .ns-hf2-contact-form .structured-form-grid > .checkbox-field:not(.form-field-full) {padding-top:0 !important;}
 html .customer-overview-panels.ns-hf2-customer-panels {grid-template-columns:minmax(0,1fr) !important;}
 html .ns-hf2-version-actions .lifecycle-actions-column {min-width:170px !important;}
}
/* Full night mode: harmonise direct asset rows, contact fields and selected controls. */
html[data-theme-mode="dark"] .ns-hf2-asset-relations > .panel,
html[data-theme-mode="dark"] .ns-hf2-asset-relations > .panel > .compact-list,
html[data-theme-mode="dark"] .ns-hf2-asset-relations .asset-credential-row,
html[data-theme-mode="dark"] .ns-hf2-contact-form .portal-check-row {
  background:#17293f !important;color:#e8eef7 !important;border-color:#3c526d !important;
}
html[data-theme-mode="dark"] .ns-hf2-asset-relations :is(.asset-credential-row span,.compact-list .empty-state),
html[data-theme-mode="dark"] .ns-hf2-contact-form .portal-check-row small {color:#bed1ea !important;opacity:1 !important;}
@media(prefers-color-scheme:dark){
 html[data-theme-mode="system"] .ns-hf2-asset-relations > .panel,
 html[data-theme-mode="system"] .ns-hf2-asset-relations > .panel > .compact-list,
 html[data-theme-mode="system"] .ns-hf2-asset-relations .asset-credential-row,
 html[data-theme-mode="system"] .ns-hf2-contact-form .portal-check-row {
   background:#17293f !important;color:#e8eef7 !important;border-color:#3c526d !important;
 }
 html[data-theme-mode="system"] .ns-hf2-asset-relations :is(.asset-credential-row span,.compact-list .empty-state),
 html[data-theme-mode="system"] .ns-hf2-contact-form .portal-check-row small {color:#bed1ea !important;opacity:1 !important;}
}

/* NETSTYLE R20 system UI HF4 R1 – central theme-token based component repair.
   Loaded after all legacy CSS. Do not change a customer's active brand palette. */

/* Inventory: permission-adaptive one-row KPI layout on ordinary desktop screens. */
@media (min-width: 1200px) {
  html .audit-kpi-grid.inventar-kpis.ns-hf4-inventory-kpis {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    gap: 12px !important;
  }
}
html .audit-kpi-grid.inventar-kpis.ns-hf4-inventory-kpis > * {
  min-width: 0;
  margin: 0 !important;
  box-sizing: border-box;
}

/* Firefox / Windows OS select-popup fallback. The accompanying JS provides
   a controlled in-document popup when the native OS menu ignores :hover. */
html[data-theme-mode="dark"] select,
html[data-theme-mode="dark"] select option,
html[data-theme-mode="dark"] select optgroup {
  color-scheme: dark !important;
  background-color: var(--portal-surface-raised) !important;
  color: var(--portal-text) !important;
}
html[data-theme-mode="dark"] select option:hover,
html[data-theme-mode="dark"] select option:focus,
html[data-theme-mode="dark"] select option:checked {
  background-color: #245a94 !important;
  color: #ffffff !important;
}
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"] select,
  html[data-theme-mode="system"] select option,
  html[data-theme-mode="system"] select optgroup {
    color-scheme: dark !important;
    background-color: var(--portal-surface-raised) !important;
    color: var(--portal-text) !important;
  }
  html[data-theme-mode="system"] select option:hover,
  html[data-theme-mode="system"] select option:focus,
  html[data-theme-mode="system"] select option:checked {
    background-color: #245a94 !important;
    color: #ffffff !important;
  }
}

/* An accessible rendered listbox for native single-choice selects in dark mode.
   The actual <select> remains in the form for validation, POST and change events. */
html .ns-hf4-select-popover {
  position: fixed !important;
  z-index: 2147483000 !important;
  display: block !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 4px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  border: 1px solid var(--portal-border-strong, #3b4f6a) !important;
  border-radius: 8px !important;
  background: var(--portal-surface-raised, #152238) !important;
  color: var(--portal-text, #e8eef7) !important;
  box-shadow: 0 18px 38px rgba(0,0,0,.35) !important;
  color-scheme: dark;
}
html .ns-hf4-select-option {
  display: block !important;
  width: 100% !important;
  min-height: 34px;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  text-align: left !important;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 0 !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: var(--portal-text, #e8eef7) !important;
  font: inherit !important;
  cursor: pointer;
}
html .ns-hf4-select-option:hover,
html .ns-hf4-select-option:focus-visible,
html .ns-hf4-select-option.is-active,
html .ns-hf4-select-option[aria-selected="true"].is-active {
  background: #245a94 !important;
  color: #fff !important;
  outline: 0 !important;
}
html .ns-hf4-select-option[aria-selected="true"]:not(.is-active) {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 24%, var(--portal-surface-raised, #152238)) !important;
  color: var(--portal-text, #e8eef7) !important;
}
html .ns-hf4-select-option:disabled { opacity: .55; cursor: not-allowed; }
html .ns-hf4-select-group {padding: 8px 10px 4px !important; color: var(--portal-text-muted, #a9b8cc) !important; font-size: 12px !important; font-weight: 700 !important;}

/* Shared HTML-generated option lists and autocomplete: no hard-coded white
   content background or dark foreground inside a dark-theme portal. */
html.ns-hf4-dark .checklist-template-picker-list,
html.ns-hf4-dark .checklist-template-picker-empty,
html.ns-hf4-dark .customer-autocomplete-list,
html.ns-hf4-dark .customer-combobox-list {
  background: var(--portal-surface-raised) !important;
  border-color: var(--portal-border-strong) !important;
  color: var(--portal-text) !important;
  box-shadow: 0 16px 30px rgba(0,0,0,.32) !important;
}
html.ns-hf4-dark .checklist-template-picker-option,
html.ns-hf4-dark .customer-autocomplete-option,
html.ns-hf4-dark .customer-combobox-option {
  background: var(--portal-surface-raised) !important;
  border-color: var(--portal-border) !important;
  color: var(--portal-text) !important;
}
html.ns-hf4-dark .checklist-template-picker-option-label,
html.ns-hf4-dark .customer-autocomplete-option span,
html.ns-hf4-dark .customer-combobox-option span { color: inherit !important; }
html.ns-hf4-dark .checklist-template-picker-option:hover,
html.ns-hf4-dark .checklist-template-picker-option:focus-visible,
html.ns-hf4-dark .checklist-template-picker-option.is-active,
html.ns-hf4-dark .customer-autocomplete-option:hover,
html.ns-hf4-dark .customer-autocomplete-option:focus-visible,
html.ns-hf4-dark .customer-autocomplete-option.is-active,
html.ns-hf4-dark .customer-combobox-option:hover,
html.ns-hf4-dark .customer-combobox-option:focus-visible,
html.ns-hf4-dark .customer-combobox-option.is-active {
  background: #245a94 !important;
  color: #fff !important;
}
html.ns-hf4-dark .checklist-template-picker-toggle {
  background: var(--portal-surface-raised) !important;
  color: var(--portal-text) !important;
  border-color: var(--portal-border) !important;
}
html.ns-hf4-dark .checklist-template-picker-toggle:hover,
html.ns-hf4-dark .checklist-template-picker-toggle:focus-visible {
  background: #245a94 !important;
  color: #fff !important;
}
html.ns-hf4-dark .checklist-template-picker-empty,
html.ns-hf4-dark .customer-autocomplete-empty,
html.ns-hf4-dark .customer-combobox-empty {color: var(--portal-text-muted) !important;}

/* File-upload components across inventory, builder, knowledgebase and profile. */
html.ns-hf4-dark .portal-dropzone,
html.ns-hf4-dark .portal-dropzone.portal-dropzone--builder,
html.ns-hf4-dark .organisation-logo-dropzone.portal-dropzone--builder,
html.ns-hf4-dark .knowledge-dropzone,
html.ns-hf4-dark .profile-upload-dropzone {
  background: var(--portal-surface-raised) !important;
  border-color: var(--portal-border-strong) !important;
  color: var(--portal-text) !important;
}
html.ns-hf4-dark :is(.portal-dropzone,.knowledge-dropzone,.profile-upload-dropzone):is(:hover,:focus-within,.is-dragover) {
  background: color-mix(in srgb, var(--portal-brand-primary) 18%, var(--portal-surface-raised)) !important;
  border-color: var(--portal-focus) !important;
}
html.ns-hf4-dark :is(.portal-dropzone,.knowledge-dropzone,.profile-upload-dropzone) :is(.portal-dropzone-title,.portal-dropzone-copy,.portal-dropzone-icon,.knowledge-dropzone-copy,.knowledge-dropzone-icon,.profile-upload-dropzone-text,.profile-upload-dropzone-text strong,.profile-upload-dropzone-text span,.profile-upload-dropzone-text small) {
  color: var(--portal-text) !important;
  opacity: 1 !important;
}
html.ns-hf4-dark .portal-dropzone-file,
html.ns-hf4-dark .portal-dropzone-file.portal-dropzone-file--builder,
html.ns-hf4-dark .profile-upload-selected,
html.ns-hf4-dark .knowledge-upload-selected {
  color: var(--portal-text) !important;
  background: var(--portal-surface-raised) !important;
  border-color: var(--portal-border) !important;
}
html.ns-hf4-dark :is(.portal-dropzone-file,.profile-upload-selected,.knowledge-upload-selected) * { color: inherit !important; }

/* Contrast fallback for dark-mode upload labels, even when scripts are blocked. */
html[data-theme-mode="dark"] .portal-dropzone-title,
html[data-theme-mode="dark"] .portal-dropzone-copy {color: var(--portal-text) !important;}
@media(prefers-color-scheme:dark) {
  html[data-theme-mode="system"] .portal-dropzone-title,
  html[data-theme-mode="system"] .portal-dropzone-copy {color: var(--portal-text) !important;}
}

/* NETSTYLE Technikportal HF5: centrally applied dark-mode component accessibility.
   Cumulative with accepted HF2 + HF4; all colors inherit the NETSTYLE theme tokens.
   No form fields, client permissions, application routes or submissions are modified. */

/* Active dark mode. The HF4 JS also supplies the class when the theme follows OS dark.
   Native OS popup styling is handled separately by HF4. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark) {
  --hf5-surface: var(--portal-surface-raised, #152238);
  --hf5-surface-low: var(--portal-surface-muted, #0e192a);
  --hf5-text: var(--portal-text, #e8eef7);
  --hf5-muted: var(--portal-text-muted, #b5c6dc);
  --hf5-line: var(--portal-border-strong, #3b4f6a);
  --hf5-accent: var(--portal-focus, #74a7e4);
}

/* 1. All interactive checkboxes and their wrappers: no white-on-dark mismatch.
   Keep the real input for focus, assistive technology, binding and POST data. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-checkbox,.point-toggle-card,.calendar-toggle-card,.weekday-card,
    .credential-scope-card,.toolbar-checkbox,.checkbox-field > label,
    .settings-choice-card,.ns-r20-checkline) {
  background: var(--hf5-surface) !important;
  border-color: var(--hf5-line) !important;
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-checkbox,.point-toggle-card,.calendar-toggle-card,.weekday-card,
    .credential-scope-card,.settings-choice-card):is(:hover,:focus-within) {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 17%, var(--hf5-surface)) !important;
  border-color: var(--hf5-accent) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-checkbox,.point-toggle-card,.calendar-toggle-card,.weekday-card,
    .credential-scope-card,.settings-choice-card) :is(strong,span,small,em) {
  color: var(--hf5-text) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-checkbox,.point-toggle-card,.calendar-toggle-card,.weekday-card,
    .credential-scope-card,.checkbox-field,.settings-choice-card)
input[type="checkbox"] {
  accent-color: var(--portal-brand-primary, #4287dc);
  color-scheme: dark;
}

/* 2. Runtime summary metrics and sticky footer: inherit portal dark surfaces. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.detail-summary .summary-card,.runtime-readonly-notice) {
  background: var(--hf5-surface) !important;
  border-color: var(--hf5-line) !important;
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
.detail-summary .summary-card :is(strong,.summary-card-topline strong) {
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
.detail-summary .summary-card :is(span,.summary-card-topline span) {
  color: var(--hf5-muted) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.sticky-actions,.sticky-form-actions,.point-detail-actions) {
  background: var(--portal-surface-muted, #0e192a) !important;
  border-color: var(--portal-border, #2a3a51) !important;
  color: var(--hf5-text) !important;
  box-shadow: none !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
.sticky-actions :is(button,a),
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
.point-detail-actions :is(button,a) {flex-shrink:0;white-space:nowrap;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.sticky-actions,.sticky-form-actions,.point-detail-actions) .secondary-button {
  background: var(--hf5-surface) !important;
  border-color: var(--hf5-line) !important;
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.sticky-actions,.sticky-form-actions,.point-detail-actions) .secondary-button:is(:hover,:focus-visible) {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 20%, var(--hf5-surface)) !important;
  color: var(--hf5-text) !important;
}

/* 3. Runtime file / image upload zones: do not mask the real file input. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-upload-zone,.runtime-upload-zone--file,.runtime-upload-zone--image,
    .portal-dropzone,.knowledge-dropzone,.profile-upload-dropzone) {
  background: var(--hf5-surface) !important;
  border-color: var(--hf5-line) !important;
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-upload-zone,.portal-dropzone,.knowledge-dropzone,.profile-upload-dropzone):is(:hover,:focus-within,.is-dragover) {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 17%, var(--hf5-surface)) !important;
  border-color: var(--hf5-accent) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-upload-zone,.portal-dropzone,.knowledge-dropzone,.profile-upload-dropzone)
:is(.runtime-upload-content,.runtime-upload-content strong,.runtime-upload-content small,.runtime-upload-action,
    .runtime-upload-icon,.portal-dropzone-title,.portal-dropzone-copy,.portal-dropzone-icon,
    .knowledge-dropzone-copy,.knowledge-dropzone-copy strong,.knowledge-dropzone-copy span,.knowledge-dropzone-copy small,
    .knowledge-dropzone-icon,.profile-upload-dropzone-text,.profile-upload-dropzone-text strong,
    .profile-upload-dropzone-text span,.profile-upload-dropzone-text small) {
  color: var(--hf5-text) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-upload-selected,.runtime-upload-status,.portal-dropzone-file,.knowledge-upload-selected) {
  color: var(--hf5-text) !important;
  background: var(--hf5-surface-low) !important;
  border-color: var(--hf5-line) !important;
}

/* 4. Credential reference panels: avoid dark type on dark surface AND
   white statistics cards on dark pages. The status LED retains semantic color. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.credential-status-facts > div,.credential-context-grid > div,
    .credential-technical-grid > div,.credential-relation-grid > *,
    .credential-grant-kpis > *, .credential-access-row,
    .credential-status-row,.credential-secret-row,.credential-cockpit-secret .credential-secret-row) {
  background: var(--hf5-surface) !important;
  border-color: var(--hf5-line) !important;
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.credential-status-facts,.credential-context-grid,.credential-technical-grid,
    .credential-relation-grid,.credential-grant-kpis,.credential-status-list)
:is(strong,span,small,a) {
  color: var(--hf5-text) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.credential-access-label,.credential-status-row > span:nth-child(2)) {
  color: var(--hf5-muted) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.credential-relation-grid,.credential-grant-kpis) > :is(a,button):is(:hover,:focus-visible) {
  border-color: var(--hf5-accent) !important;
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 18%, var(--hf5-surface)) !important;
}

/* 5. Visual builder palette and point-form controls. A white tile with a
   near-white label is not an accessible dark-mode palette. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.palette-item,.editor-back,.editor-template-icon,.builder-item-icon,
    .builder-kebab,.builder-section-menu button) {
  background: var(--hf5-surface) !important;
  color: var(--hf5-text) !important;
  border-color: var(--hf5-line) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
.palette-item:is(:hover,:focus-visible) {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 19%, var(--hf5-surface)) !important;
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.palette-item,.point-toggle-card) :is(.palette-label,strong,span) {
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.point-form-section-heading h2,.point-form-section-heading p,
    .point-form-field > label,.point-form-field > small,.point-advanced > summary) {
  color: var(--hf5-text) !important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
.point-advanced > summary {
  background: var(--hf5-surface-low) !important;
  border-color: var(--hf5-line) !important;
}

/* 6. Customer edit form. A checkbox in the last two-column row must
   occupy the same row-height as the adjacent long-text field. */
@media (min-width: 760px) {
  .form-panel .form-grid:has(.portal-field[data-field-name="aktiv"])
  > .portal-field[data-field-name="aktiv"] {
    align-self: stretch;
    height: 100%;
    min-height: 0;
  }
  .form-panel .form-grid:has(.portal-field[data-field-name="aktiv"])
  > .portal-field[data-field-name="aktiv"] > .completed-control {
    display: flex;
    align-items: center;
    min-height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 14px;
  }
}

/* 7. Never stack side-by-side action sets as individual full-width buttons.
   Narrow widths may scroll the action ROW rather than wrap its buttons. */
.enterprise-list-heading-actions,.form-actions,.sticky-actions,.point-detail-actions {
  flex-wrap: nowrap !important;
  white-space: nowrap;
}
.enterprise-list-heading-actions {max-width:100%;overflow-x:auto;}
.form-actions,.sticky-actions,.point-detail-actions {max-width:100%;overflow-x:auto;}
:is(.enterprise-list-heading-actions,.form-actions,.sticky-actions,.point-detail-actions) > :is(a,button,form) {
  flex: 0 0 auto;
}

/* 8. System dark / JS-off progressive fallback for essential critical areas. */
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"]:not(.ns-hf4-dark) :is(.runtime-checkbox,.summary-card,.point-toggle-card,.sticky-actions,.runtime-upload-zone,.calendar-toggle-card) {
    background:var(--portal-surface-raised,#152238) !important;
    border-color:var(--portal-border-strong,#3b4f6a) !important;
    color:var(--portal-text,#e8eef7) !important;
  }
  html[data-theme-mode="system"]:not(.ns-hf4-dark) :is(.runtime-checkbox,.summary-card,.point-toggle-card,.runtime-upload-zone) :is(strong,small,span) {
    color:var(--portal-text,#e8eef7) !important;
  }
}

/* NETSTYLE Technikportal HF6: all checklist/form field types dark-mode accessibility.
   Additive to the LIVE HF5 theme. No application data flow, validation or JavaScript
   changed; keep the original enterprise theme tokens as the sole color authority. */

:is(html[data-theme-mode="dark"], html.ns-hf4-dark) {
  --hf6-ink: var(--portal-text, #e8eef7);
  --hf6-muted: var(--portal-text-muted, #bbcbe0);
  --hf6-panel: var(--portal-surface-raised, #152238);
  --hf6-deep: var(--portal-surface-muted, #101d30);
  --hf6-line: var(--portal-border-strong, #405775);
  --hf6-accent: var(--portal-focus, #74a7e4);
  --hf6-hover: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 26%, var(--hf6-panel));
}

/* 1. Typen: text, langtext, zahl, datum, zeitpunkt, auswahl, mehrfachauswahl,
   URL, E-Mail und Ja/Nein; focus, readonly, disabled, placeholder included. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.checklist-control,.point-form,.knowledge-editor,.portal-form,.form-panel)
:is(input.portal-input:not([type="file"]):not([type="checkbox"]),textarea.portal-input,select.portal-input) {
  background-color: var(--hf6-panel) !important;
  border-color: var(--hf6-line) !important;
  color: var(--hf6-ink) !important;
  color-scheme: dark;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.checklist-control,.point-form,.knowledge-editor,.portal-form,.form-panel)
:is(input.portal-input, textarea.portal-input)::placeholder {
  color: var(--hf6-muted) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.checklist-control,.point-form,.knowledge-editor,.portal-form,.form-panel)
:is(input.portal-input,textarea.portal-input,select.portal-input):focus-visible {
  outline: 2px solid var(--hf6-accent) !important;
  outline-offset: 1px;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control :is(input.portal-input,textarea.portal-input,select.portal-input):disabled,
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control :is(input.portal-input,textarea.portal-input,select.portal-input)[readonly] {
  color: var(--hf6-muted) !important;
  -webkit-text-fill-color: var(--hf6-muted) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control input[type="date"]::-webkit-calendar-picker-indicator,
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: .85;
}

/* Units are part of the number control, not separate bright boxes. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark) .checklist-control .runtime-number-unit {
  background: var(--hf6-panel) !important;
  border-color: var(--hf6-line) !important;
  color: var(--hf6-ink) !important;
}
/* Multi-choice item cards and their selected/hover/focus states. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark) .runtime-multiselect-option {
  background: var(--hf6-panel) !important;
  border-color: var(--hf6-line) !important;
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark) .runtime-multiselect-option :is(span,strong,small) {
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark) .runtime-multiselect-option:is(:hover,:focus-within),
:is(html[data-theme-mode="dark"], html.ns-hf4-dark) .runtime-multiselect-option:has(input:checked) {
  background: var(--hf6-hover) !important;
  border-color: var(--hf6-accent) !important;
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control select.portal-input[multiple] {
  background: var(--hf6-panel) !important;
  color: var(--hf6-ink) !important;
}

/* 2. Checkbox and completion: the text must remain readable on hover,
   when checked and on read-only completed checklists. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .completed-control,
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .completed-control-text {
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .completed-control:is(:hover,:focus-within) .completed-control-text,
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .completed-control input:checked ~ .completed-control-text {
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .completed-control--readonly .completed-control-text {
  color: var(--hf6-muted) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .runtime-checkbox :is(span,strong,small) {
  color: var(--hf6-ink) !important;
}

/* 3. Non-input checklist field types: information, knowledge reference,
   header, divider and warning. No white card with white text. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-item--anleitung .runtime-knowledge-card {
  background: var(--hf6-panel) !important;
  border-color: var(--hf6-line) !important;
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-item--anleitung .runtime-knowledge-card
:is(h3,.runtime-knowledge-card-meta,.runtime-knowledge-source-title,.runtime-knowledge-help,.runtime-knowledge-summary) {
  color: var(--hf6-ink) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-item--anleitung .runtime-knowledge-card-icon {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 28%, var(--hf6-panel)) !important;
  color: var(--hf6-ink) !important;
  border: 1px solid var(--hf6-line);
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .info-box {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 19%, var(--hf6-panel)) !important;
  border: 1px solid var(--hf6-line);
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .checklist-layout-heading :is(h3,p) {color: var(--hf6-ink) !important;}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .checklist-layout-divider {
  border-color: var(--hf6-line) !important;
  background: var(--hf6-line) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .checklist-layout-warning {
  background: #332915 !important;
  border-color: #89692f !important;
  color: #ffe4ae !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .checklist-layout-warning :is(strong,p) {
  color: #ffe4ae !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control .checklist-layout-warning-icon {
  background: #69491b !important;
  color: #fff0cc !important;
}

/* 4. File/image uploads and visible preview actions. Do NOT touch file inputs
   and never hide functional controls behind a pseudo-element. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.runtime-upload-zone,.knowledge-dropzone,.portal-dropzone,.profile-upload-dropzone)
:is(.runtime-upload-icon,.knowledge-dropzone-icon,.portal-dropzone-icon) {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 34%, var(--hf6-panel)) !important;
  color: var(--hf6-ink) !important;
  border-color: var(--hf6-line) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.knowledge-dropzone,.runtime-upload-zone,.portal-dropzone)
:is(.knowledge-dropzone-copy,.runtime-upload-content,.portal-dropzone-copy,
    .knowledge-dropzone-copy strong,.knowledge-dropzone-copy span,.knowledge-dropzone-copy small,
    .runtime-upload-content strong,.runtime-upload-content small,.runtime-upload-action) {
  color: var(--hf6-ink) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.runtime-attachment-card,.runtime-image-card,.knowledge-existing-image,.knowledge-document-row)
:is(a,span,strong,small) {
  color: var(--hf6-ink) !important;
}
/* The light-theme native file picker text remains handled by its existing CSS. */

/* 5. Checklist builder: palette icons, selected blocks, inspector help boxes. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.palette-item :is(.palette-icon,.palette-icon.palette-blue,.palette-icon.palette-green,
                  .palette-icon.palette-red,.palette-icon.palette-orange,.palette-icon.palette-muted) {
  background: color-mix(in srgb, var(--portal-brand-primary, #4287dc) 27%, var(--hf6-panel)) !important;
  color: var(--hf6-ink) !important;
  border-color: var(--hf6-line) !important;
  opacity: 1 !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.builder-item-icon,.editor-template-icon,.inspector-info-box,.point-structure-info) {
  background: var(--hf6-panel) !important;
  border-color: var(--hf6-line) !important;
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.inspector-info-box,.point-structure-info) :is(strong,span,small,p) {
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.builder-item:is([data-type="ueberschrift"],[data-type="warnung"],[data-type="trennlinie"]) {
  background: var(--hf6-panel) !important;
  border-color: var(--hf6-line) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.builder-item :is(.builder-item-icon,.builder-title-row strong,.builder-item-icon span) {
  color: var(--hf6-ink) !important;
}

/* 6. Credential and secret-denied cards: do not show barely-visible text on
   bright fallback surfaces. No secret reveal, auth or permission changes. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.credential-secret-panel,.runtime-credential-secret-denied,.runtime-credential-secret-missing) {
  background: var(--hf6-panel) !important;
  color: var(--hf6-ink) !important;
  border-color: var(--hf6-line) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
:is(.credential-secret-panel,.runtime-credential-secret-denied,.runtime-credential-secret-missing)
:is(strong,span,p,small) {color: var(--hf6-ink) !important;opacity:1 !important;}

/* 7. Progressive fallback for system-dark mode before theme JS initializes.
   Do not apply to an explicit light theme. */
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"]:not(.ns-hf4-dark)
  :is(.runtime-multiselect-option,.runtime-number-unit,.runtime-knowledge-card,.runtime-upload-zone,
      .knowledge-dropzone,.palette-item .palette-icon,.info-box,.checklist-layout-warning) {
    background: var(--portal-surface-raised, #152238) !important;
    border-color: var(--portal-border-strong, #405775) !important;
    color: var(--portal-text, #e8eef7) !important;
  }
}

/* 8. Legacy .completed-control owns a light background even when its text is
   themed correctly. Force the surface as well, including mouseover/readonly. */
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control > .completed-control {
  background: var(--hf6-panel) !important;
  border-color: var(--hf6-line) !important;
  color: var(--hf6-ink) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control > .completed-control:is(:hover,:focus-within) {
  background: var(--hf6-hover) !important;
  border-color: var(--hf6-accent) !important;
}
:is(html[data-theme-mode="dark"], html.ns-hf4-dark)
.checklist-control > .completed-control--readonly {
  background: var(--hf6-deep) !important;
  border-color: var(--hf6-line) !important;
}

/* NETSTYLE Technikportal R20 HF7: component-specific dark-mode corrections.
   Color authority is the central NETSTYLE portal tokens inherited from HF6.
   Cosmetic only; never alter input, form, password, file or link semantics. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) {
  --hf7-bg: var(--portal-surface-raised,#152238);
  --hf7-panel: var(--portal-surface-muted,#111e31);
  --hf7-border: var(--portal-border-strong,#405775);
  --hf7-text: var(--portal-text,#e8eef7);
  --hf7-muted: var(--portal-text-muted,#bbcbe0);
  --hf7-link: #a8d0ff;
  --hf7-hover-bg: #244e78;
}
/* 1. Runtime credential cards and all their text, not just the error panel. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-credential-card--r2,.runtime-credential-entry,.runtime-credential-secret-denied,.runtime-credential-secret-missing) {
 background:var(--hf7-bg)!important;border-color:var(--hf7-border)!important;color:var(--hf7-text)!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.runtime-credential-card-title,.runtime-credential-card-title strong,.runtime-credential-identity>strong,
.runtime-credential-meta,.runtime-credential-meta>span,.runtime-credential-secret-denied strong,
.runtime-credential-secret-missing strong,.runtime-secret-warning) {
 color:var(--hf7-text)!important;opacity:1!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .runtime-credential-meta a {color:var(--hf7-link)!important;text-decoration:underline;text-underline-offset:2px;}
/* 2. Uploaded attachment: legacy background #f8fafc with HF6's light text. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .runtime-attachment-card {
 background:var(--hf7-bg)!important;border-color:var(--hf7-border)!important;color:var(--hf7-text)!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
.runtime-attachment-card :is(.runtime-attachment-icon,.runtime-attachment-info,.runtime-attachment-info strong,.runtime-attachment-info span) {
 color:var(--hf7-text)!important;opacity:1!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .runtime-attachment-card .runtime-attachment-actions a {color:var(--hf7-link)!important;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .runtime-attachment-card .runtime-attachment-actions .runtime-attachment-delete {color:#ffbaba!important;background:transparent!important;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .runtime-attachment-card :is(a,button):focus-visible {outline:2px solid var(--hf7-link)!important;outline-offset:2px;}
/* 3. Checklist-builder knowledge-picker: every level owns light-mode CSS. */
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.knowledge-picker-dialog,.knowledge-picker-header,.knowledge-picker-toolbar,.knowledge-picker-results) {
 background:var(--hf7-panel)!important;color:var(--hf7-text)!important;border-color:var(--hf7-border)!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.knowledge-picker-header h2,.knowledge-picker-header p,.knowledge-picker-item-main>strong,.knowledge-picker-item-main p,
 .knowledge-picker-item-meta,.knowledge-picker-item-meta *,.knowledge-picker-empty,.knowledge-picker-empty strong,.knowledge-picker-empty p) {
 color:var(--hf7-text)!important;opacity:1!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-item {
 background:var(--hf7-bg)!important;border-color:var(--hf7-border)!important;color:var(--hf7-text)!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-item:is(:hover,:focus-visible) {
 background:var(--hf7-hover-bg)!important;border-color:var(--hf7-link)!important;color:#fff!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
:is(.knowledge-picker-search input,#knowledge-picker-category) {
 background:var(--hf7-bg)!important;color:var(--hf7-text)!important;
 border-color:var(--hf7-border)!important;color-scheme:dark;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-search input::placeholder {color:var(--hf7-muted)!important;opacity:1!important;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-search>span {color:var(--hf7-muted)!important;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-select {background:#245486!important;color:#fff!important;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-close {background:var(--hf7-bg)!important;color:var(--hf7-text)!important;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-close:is(:hover,:focus-visible) {background:var(--hf7-hover-bg)!important;color:#fff!important;}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark) .knowledge-picker-item:focus-visible {outline:2px solid var(--hf7-link);outline-offset:2px;}
/* 4. Statuses in the two Vorgang lists have equal width and centered content.
   Not applied to other status-badges, their meaning and visual hierarchy differ. */
.workorder-list-table .status-filter-link {
 display:inline-flex;align-items:center;justify-content:center;width:126px;min-width:126px;max-width:126px;
 box-sizing:border-box;vertical-align:middle;text-decoration:none;
}
.workorder-list-table .status-filter-link .status-badge {
 display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
 width:100%;min-width:0;min-height:26px;padding:4px 6px;text-align:center;white-space:nowrap;
}
/* System theme while dark follows OS, before the JS theme class arrives. */
@media (prefers-color-scheme:dark) {
 html[data-theme-mode="system"]:not(.ns-hf4-dark) :is(.knowledge-picker-dialog,.knowledge-picker-header,.knowledge-picker-toolbar,.knowledge-picker-results,.knowledge-picker-item,.runtime-credential-entry,.runtime-attachment-card) {
  background:var(--portal-surface-raised,#152238)!important;color:var(--portal-text,#e8eef7)!important;
  border-color:var(--portal-border-strong,#405775)!important;
 }
}

/* HF8: common upload semantics, light/dark pending preview parity. */
.runtime-upload-validation-error:not([hidden]) {
  margin:8px 0; padding:9px 12px; border-radius:8px;
  background:#fff0ed; color:#9a251c; border:1px solid #edb7ac;
  font-weight:600; line-height:1.45;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
  .runtime-upload-validation-error:not([hidden]) {
  background:#3c252a; color:#ffcfca; border-color:#a35f62;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
  :is(.runtime-upload-pending-card,.runtime-upload-pending-card--image) {
  background:var(--portal-surface-raised,#17283f)!important;
  color:var(--portal-text,#e8eef7)!important;
  border-color:var(--portal-border-strong,#425b7c)!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
  .runtime-upload-pending-card :is(.runtime-upload-pending-info,.runtime-upload-pending-info strong,.runtime-upload-pending-info span) {
  color:var(--portal-text,#e8eef7)!important; opacity:1!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
  .runtime-upload-pending-card .runtime-upload-pending-actions a {
  color:#b2d4ff!important; text-decoration:underline;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
  .runtime-upload-pending-card .runtime-upload-clear {
  color:#ffb9b9!important;background:transparent!important;
}
:is(html[data-theme-mode="dark"],html.ns-hf4-dark)
  .runtime-upload-pending-card :is(a,button):focus-visible {
  outline:2px solid #b2d4ff;outline-offset:2px;
}
@media (prefers-color-scheme:dark) {
  html[data-theme-mode="system"]:not(.ns-hf4-dark) .runtime-upload-pending-card {
    background:var(--portal-surface-raised,#17283f)!important;
    color:var(--portal-text,#e8eef7)!important;
    border-color:var(--portal-border-strong,#425b7c)!important;
  }
}

/* HF10: scoped corrections. Do not override the shared theme tokens. */
.hf10-inline-actions {display:flex!important;flex-flow:row nowrap!important;gap:8px;align-items:center;white-space:nowrap;min-width:max-content}
.hf10-inline-actions form {display:inline-flex;margin:0;align-items:center}
.hf10-inline-actions button,.hf10-inline-actions a{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;min-height:34px;line-height:1.2}
.hf10-danger-button{border:1px solid #c52a29;border-radius:7px;padding:8px 13px;background:#bd2727;color:#fff;cursor:pointer;font-weight:700}
.hf10-danger-button:hover{background:#9f1b1b;color:#fff}
.hf10-kunde-notiz textarea {min-height:100px;max-width:100%;resize:vertical}
.hf10-kunde-aktiv {align-self:stretch;display:flex;flex-direction:column;justify-content:flex-end;gap:6px}
.hf10-customer-active-toggle {display:flex!important;flex-direction:row!important;align-items:center!important;gap:10px!important;margin:0!important;min-height:42px!important;cursor:pointer}
.hf10-customer-active-toggle input[type=checkbox]{appearance:none!important;display:inline-block!important;position:relative;width:42px!important;min-width:42px!important;height:24px!important;min-height:24px!important;border:1px solid var(--ns-light-border,#bbc8d8)!important;border-radius:99px!important;background:#7e8da0!important;cursor:pointer;vertical-align:middle}
.hf10-customer-active-toggle input[type=checkbox]:checked{background:var(--ns-light-primary,#1769d2)!important;border-color:var(--ns-light-primary,#1769d2)!important}
.hf10-customer-active-toggle input[type=checkbox]:before{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .12s ease}
.hf10-customer-active-toggle input[type=checkbox]:checked:before{transform:translateX(18px)}
.hf10-customer-active-toggle input[type=checkbox]:focus-visible{outline:3px solid #81ace7!important;outline-offset:2px}
.hf10-vorgang-row{cursor:pointer}
.hf10-vorgang-row:hover{background:rgba(60,128,220,.09)!important}
.hf10-vorgang-row:focus-visible{outline:2px solid var(--ns-light-focus,#4f8fdb);outline-offset:-2px}
/* Error text must contrast with dark and light backgrounds. */
.pruefplan-error-panel{display:block!important;background:#fff4ec!important;border:1px solid #bc4a24!important;color:#5d261b!important;padding:14px 16px!important}
.pruefplan-error-panel p,.pruefplan-error-panel strong{color:#5d261b!important;opacity:1!important}
html[data-theme-mode=dark] .pruefplan-error-panel,html.ns-hf4-dark .pruefplan-error-panel{background:#3a201e!important;border-color:#eb977b!important;color:#fff1e9!important}
html[data-theme-mode=dark] .pruefplan-error-panel :is(p,strong),html.ns-hf4-dark .pruefplan-error-panel :is(p,strong){color:#fff1e9!important}
/* Preserve full actions in the table, without wrapping/stacks or cut-off. */
.activity-table-fixed{table-layout:fixed!important;min-width:1100px!important;width:100%}
.activity-table-fixed .activity-col-time{width:120px!important}
.activity-table-fixed .activity-col-workorder{width:130px!important}
.activity-table-fixed .activity-col-checklist{width:190px!important}
.activity-table-fixed .activity-col-type{width:150px!important}
.activity-table-fixed .activity-col-user{width:140px!important}
.activity-table-fixed .activity-col-description{width:auto!important}
.activity-table-fixed .activity-col-action{width:125px!important}
.activity-table-fixed td:last-child,.activity-table-fixed th:last-child{min-width:125px!important;padding-left:12px!important;padding-right:16px!important;white-space:nowrap!important;overflow:visible!important}
.activity-table-fixed td:last-child>a{white-space:nowrap;min-width:85px;display:inline-flex;align-items:center;justify-content:center}
.activity-table-fixed td:nth-child(6){min-width:200px;overflow-wrap:anywhere}
.activity-table-fixed{border-collapse:separate;border-spacing:0}
.activity-table-fixed+.pagination-bar{min-width:0}
/* Dropdown on long forms must not be clipped by nearby cards/panels. */
.pruefplan-editor-main>.panel:has(.checklist-template-picker.is-open){position:relative;z-index:20;overflow:visible!important}
.pruefplan-editor-main .checklist-template-picker-list{max-height:min(300px,45vh);z-index:200!important}
.pruefplan-editor-main .checklist-template-picker-option{min-height:34px;white-space:normal;overflow-wrap:anywhere}
.hf10-picker-help{display:block;margin-top:4px;font-size:.75rem;color:var(--ns-light-text-secondary,#667085)}
/* Screenshot 14:09: text inside dark warning banner must remain readable. */
.portal-message.warning,.portal-message.warning *{color:#fff2d5!important;opacity:1!important}
.portal-message.warning{background:#39291c!important;border-color:#bf8b45!important}
.portal-message.error,.portal-message.error *{color:#fff0ec!important;opacity:1!important}
.portal-message.error{background:#3c2022!important;border-color:#cb645f!important}

/* CHAT=NETSTYLE_TECHNIKPORTAL_HAUPTCHAT_R20_HF10 | RELEASE=R20_HF10_R8 */
.ns-mail-panel{padding:18px 20px!important;box-sizing:border-box;min-width:0}
.ns-mail-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:16px}
.ns-mail-heading h2{margin:0 0 4px!important;font-size:1.13rem;line-height:1.35;color:var(--portal-text,#173150)}
.ns-mail-heading p{margin:0!important;font-size:.84rem;line-height:1.5;color:var(--portal-text-muted,#667085)}
.ns-mail-admin-label{white-space:nowrap;border:1px solid var(--portal-border,#dce5ef);border-radius:7px;padding:6px 10px;font-size:.75rem;font-weight:700;color:var(--portal-text-muted,#667085)}
.ns-mail-settings-form{margin:0!important}
.ns-mail-policy{display:grid;grid-template-columns:minmax(220px,1fr) minmax(275px,1fr);gap:14px;padding:14px;background:var(--portal-surface-muted,#f5f8fc);border:1px solid var(--portal-border,#dce5ef);border-radius:9px;margin-bottom:12px}
.ns-mail-policy>p{grid-column:1/-1;margin:0!important;color:var(--portal-text-muted,#667085);font-size:.78rem;line-height:1.45}
.ns-mail-providers{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;align-items:stretch}
.ns-mail-provider{min-width:0;border:1px solid var(--portal-border,#dce5ef);background:var(--portal-surface,#fff);border-radius:9px;overflow:hidden}
.ns-mail-provider[open]{box-shadow:0 3px 12px rgba(20,45,80,.05);border-color:var(--portal-focus,#4f8fdb)}
.ns-mail-provider>summary{display:flex;align-items:center;gap:11px;cursor:pointer;list-style:none;padding:12px;min-height:64px;color:var(--portal-text,#172033);user-select:none}
.ns-mail-provider>summary::-webkit-details-marker{display:none}
.ns-mail-provider>summary:focus-visible{outline:2px solid var(--portal-focus,#4f8fdb);outline-offset:-3px}
.ns-mail-provider-number{display:inline-flex;width:32px;height:32px;flex:0 0 32px;justify-content:center;align-items:center;border-radius:8px;background:var(--portal-surface-muted,#edf4fc);color:var(--portal-brand-primary,#1769d2);font-weight:800;font-size:.79rem}
.ns-mail-provider-name{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:.85rem;font-weight:800}
.ns-mail-provider-name small{font-size:.73rem;color:var(--portal-text-muted,#667085);font-weight:500}
.ns-mail-expand{font-size:.71rem;color:var(--portal-brand-primary,#1769d2);white-space:nowrap}
.ns-mail-provider-body{padding:12px;border-top:1px solid var(--portal-border,#dce5ef)}
.ns-mail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.ns-mail-field{display:flex;flex-direction:column;min-width:0;gap:5px}
.ns-mail-field label{font-size:.78rem!important;font-weight:700!important;color:var(--portal-text,#172033)!important;margin:0!important}
.ns-mail-field input,.ns-mail-field select{width:100%;min-width:0;box-sizing:border-box;min-height:34px!important;margin:0!important}
.ns-mail-field small{line-height:1.4;color:var(--portal-text-muted,#667085);font-size:.72rem}
.ns-mail-field .errorlist{padding-left:18px;color:#b42318;font-size:.75rem}
.ns-mail-check{display:flex;gap:8px;align-items:center;min-height:32px;margin-bottom:11px;font-weight:700;font-size:.78rem;color:var(--portal-text,#172033);cursor:pointer}
.ns-mail-check input{width:16px;height:16px;flex:0 0 16px;accent-color:var(--portal-brand-primary,#1769d2)}
.ns-mail-help{font-size:.75rem;line-height:1.45;color:var(--portal-text-muted,#667085);margin:12px 0 0}
.ns-mail-toolbar{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:end;gap:10px;overflow-x:auto;padding:14px 0 0;margin-top:14px;border-top:1px solid var(--portal-border,#dce5ef)}
.ns-mail-toolbar>button,.ns-mail-test-form>button{flex:0 0 auto;white-space:nowrap;min-height:34px!important}
.ns-mail-test-form{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:9px;min-width:max-content;margin:0!important;margin-left:0!important}
.ns-mail-test-form label{white-space:nowrap;font-size:.76rem;font-weight:700;color:var(--portal-text,#172033)}
.ns-mail-test-form select{width:155px;min-height:34px!important}
.ns-mail-test-form input{width:260px;min-height:34px!important}
.ns-mail-test-result{font-size:.78rem;margin:12px 0 0!important;color:var(--portal-text-muted,#667085)}
@media(max-width:1250px){.ns-mail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px){.ns-mail-panel{padding:14px!important}.ns-mail-heading{flex-direction:column;gap:8px}.ns-mail-policy,.ns-mail-grid{grid-template-columns:1fr}.ns-mail-policy>p{grid-column:auto}.ns-mail-toolbar{justify-content:flex-start}.ns-mail-provider>summary{cursor:pointer}.ns-mail-provider:not([open])>.ns-mail-provider-body{display:none}}
@media(min-width:768px){.ns-mail-provider>.ns-mail-provider-body{display:block!important}.ns-mail-provider>summary{cursor:default}.ns-mail-expand{display:none}}

/* HF10 R8 UI-FIX1 – separate page, visible desktop forms, future connector catalog */
.ns-mail-panel{max-width:none}
.ns-mail-provider-body{padding:18px!important}
.ns-mail-grid>.ns-mail-field{min-width:0}
.ns-mail-field input,.ns-mail-field select{font-size:.875rem;line-height:1.4;min-height:40px!important}
.ns-mail-toolbar{align-items:center;justify-content:flex-start;gap:12px;flex-wrap:nowrap}
.ns-mail-test-form{justify-content:flex-start;gap:10px}
.ns-mail-test-form input{width:300px}
.ns-mail-provider-name{font-size:.94rem}
.ns-connectors-panel{margin-top:18px;padding:18px 20px!important}
.ns-connectors-heading h2{margin:0 0 6px;font-size:1.08rem}
.ns-connectors-heading p,.ns-connectors-empty{font-size:.87rem;color:var(--portal-text-muted,#667085);line-height:1.55}
.ns-connectors-empty{margin:12px 0 0}
.ns-connector-catalog{display:grid;gap:10px;margin-top:14px}
.ns-connector-entry{display:flex;gap:12px;align-items:center;justify-content:space-between;border:1px solid var(--portal-border,#dce5ef);border-radius:9px;padding:12px}
.ns-connector-entry-text{display:flex;flex-direction:column;gap:3px}
.ns-connector-entry-text span{font-size:.82rem;color:var(--portal-text-muted,#667085)}
.ns-connector-entry a{flex:0 0 auto;text-decoration:none}
@media(max-width:767px){.ns-mail-provider-body{padding:14px!important}.ns-connector-entry{flex-wrap:wrap}.ns-mail-toolbar{width:100%;overflow-x:auto}}

/* ============================================================
   CHAT: NETSTYLE_TECHNIKPORTAL_HAUPTCHAT_R20_HF10
   RELEASE: R20_HF10_R8_UI_FIX2 | NUR EMAIL-KONNEKTOREN
   ZWECK: regulärer Portal-Seitenkopf; kein dupliziertes Subnav;
          mobile Aktionsleiste horizontal, sichtbar und per Tastatur erreichbar.
   ============================================================ */
#organisation-email-versand.ns-mail-panel{
  width:100%;max-width:100%;min-width:0;min-height:0;
  margin:0;overflow:visible;box-sizing:border-box;
}
#organisation-email-versand .ns-mail-heading{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:14px;margin:0 0 16px;
}
#organisation-email-versand .ns-mail-heading h1{
  margin:2px 0 5px!important;font-size:clamp(1.2rem,1.5vw,1.55rem)!important;
  line-height:1.25;color:var(--portal-text,var(--ns-light-heading,#101828));
}
#organisation-email-versand .ns-mail-heading .ns-mail-section-label{
  margin:0 0 3px!important;font-size:.7rem;font-weight:750;letter-spacing:.045em;
  color:var(--portal-brand-primary,var(--ns-light-primary,#1769d2));
}
#organisation-email-versand .ns-mail-heading>div{min-width:0;flex:1 1 auto}
#organisation-email-versand .ns-mail-heading>div>p:last-child{
  margin:0!important;font-size:.85rem;line-height:1.5;
}
#organisation-email-versand .ns-mail-admin-label{flex:0 0 auto}
#organisation-email-versand .ns-mail-toolbar{
  display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
  justify-content:flex-start;align-items:center;min-width:0;max-width:100%;
  overflow-x:auto!important;overflow-y:hidden;overscroll-behavior-inline:contain;
  scrollbar-width:auto;scrollbar-color:var(--portal-brand-primary,#1769d2) var(--portal-border,#d7e1ee);
  padding:14px 2px 12px;scroll-padding-inline:10px;
}
#organisation-email-versand .ns-mail-toolbar:focus-visible{
  outline:2px solid var(--portal-focus,#4f8fdb);outline-offset:-2px;
}
#organisation-email-versand .ns-mail-toolbar::-webkit-scrollbar{height:9px}
#organisation-email-versand .ns-mail-toolbar::-webkit-scrollbar-thumb{
  background:var(--portal-brand-primary,#1769d2);border-radius:8px;
}
#organisation-email-versand .ns-mail-toolbar::-webkit-scrollbar-track{
  background:var(--portal-border,#d7e1ee);border-radius:8px;
}
#organisation-email-versand .ns-mail-test-form{
  flex:0 0 auto;display:flex!important;flex-flow:row nowrap!important;align-items:center;
  min-width:max-content;gap:10px;
}
#organisation-email-versand .ns-mail-toolbar button,
#organisation-email-versand .ns-mail-toolbar select,
#organisation-email-versand .ns-mail-toolbar input{
  flex-shrink:0;max-width:none;white-space:nowrap;
}
#organisation-email-versand .ns-mail-scroll-instruction{display:none;margin:12px 0 2px!important;
  color:var(--portal-text-muted,#667085);font-size:.76rem;line-height:1.4}
@media(max-width:767px){
  #organisation-email-versand.ns-mail-panel{padding:14px!important}
  #organisation-email-versand .ns-mail-heading{gap:8px;flex-direction:column}
  #organisation-email-versand .ns-mail-heading h1{font-size:1.3rem!important}
  #organisation-email-versand .ns-mail-scroll-instruction{display:block}
  #organisation-email-versand .ns-mail-toolbar{width:100%;box-sizing:border-box}
  #organisation-email-versand .ns-mail-test-form input{width:240px}
}

/* ============================================================
   CHAT=NETSTYLE_TECHNIKPORTAL_HAUPTCHAT_R20_HF10
   RELEASE=R20_HF10_R8_UI_FIX3
   ZWECK=Felder und Aktionen separat, Buttons niemals stapeln
   ============================================================ */
#organisation-email-versand .ns-mail-toolbar{
  display:flex!important;flex-direction:column!important;align-items:stretch!important;
  gap:12px!important;overflow:visible!important;width:100%;max-width:100%;
  min-width:0;box-sizing:border-box;padding:14px 0 0;
}
#organisation-email-versand .ns-mail-test-form{
  display:grid!important;grid-template-columns:max-content minmax(130px,220px) max-content minmax(170px,1fr)!important;
  align-items:center;gap:10px;min-width:0!important;width:100%;max-width:100%;box-sizing:border-box;
}
#organisation-email-versand .ns-mail-test-form select,
#organisation-email-versand .ns-mail-test-form input{
  display:block;width:100%!important;max-width:100%!important;min-width:0;box-sizing:border-box;
}
#organisation-email-versand .ns-mail-actions{
  display:flex!important;flex-flow:row nowrap!important;justify-content:flex-start;
  align-items:center;gap:12px;min-width:0;width:100%;box-sizing:border-box;
  overflow-x:auto;overflow-y:hidden;padding:3px 2px 12px;
  scrollbar-width:auto;scrollbar-color:var(--portal-brand-primary,#1769d2) var(--portal-border,#d7e1ee);
  overscroll-behavior-inline:contain;scroll-padding-inline:8px;
}
#organisation-email-versand .ns-mail-actions:focus-visible{outline:2px solid var(--portal-focus,#4f8fdb);outline-offset:-2px}
#organisation-email-versand .ns-mail-actions button{
  display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;
  min-height:40px!important;min-width:max-content;flex:0 0 auto;
}
#organisation-email-versand .ns-mail-actions::-webkit-scrollbar{height:9px}
#organisation-email-versand .ns-mail-actions::-webkit-scrollbar-thumb{background:var(--portal-brand-primary,#1769d2);border-radius:8px}
#organisation-email-versand .ns-mail-actions::-webkit-scrollbar-track{background:var(--portal-border,#d7e1ee);border-radius:8px}
@media(max-width:767px){
  #organisation-email-versand .ns-mail-test-form{
    grid-template-columns:minmax(0,1fr)!important;gap:6px;
  }
  #organisation-email-versand .ns-mail-test-form label:not(:first-child){margin-top:8px!important}
  #organisation-email-versand .ns-mail-actions{max-width:100%;}
  #organisation-email-versand .ns-mail-scroll-instruction{display:block;margin:4px 0 0!important}
}

/* R20 HF10 R10 – SAME central NETSTYLE theme; functions from Schulungen only.
   Status/buttons always horizontal; no secondary palette or hardcoded white. */
#organisation-email-versand .ns-r10-provider-toggle {
  display:inline-flex!important;align-items:center;gap:9px;
  padding:7px 12px!important;border-radius:var(--portal-radius-sm,6px);
  border:2px solid var(--portal-danger,#be3030)!important;
  color:var(--portal-danger,#be3030)!important;
  background:var(--portal-surface-raised)!important;
  cursor:pointer;font-weight:700;
}
#organisation-email-versand .ns-r10-provider-toggle.is-on {
  border-color:var(--portal-brand-primary)!important;
  background:var(--portal-brand-primary)!important;
  color:var(--portal-button-primary-text,#fff)!important;
}
#organisation-email-versand .ns-r10-provider-toggle input[type=checkbox] {accent-color:currentColor}
#organisation-email-versand .ns-r10-provider-status,
#organisation-email-versand .ns-r10-security-actions {
  display:flex!important;flex-flow:row nowrap!important;align-items:center;gap:8px;
  width:100%;max-width:100%;overflow-x:auto;padding:6px 0;
}
#organisation-email-versand .ns-r10-provider-status > *,
#organisation-email-versand .ns-r10-security-actions > * {flex:0 0 auto}
#organisation-email-versand .ns-r10-provider-status .ns-r10-status,
#organisation-email-versand .ns-r10-provider-status .ns-r10-secret-status {
  padding:5px 9px;border:1px solid var(--portal-border);
  border-radius:var(--portal-radius-sm,6px);
  color:var(--portal-text);background:var(--portal-surface-raised);
}
#organisation-email-versand .ns-r10-provider-status small {color:var(--portal-text-muted)!important}
#organisation-email-versand .ns-r10-security-select select {
  position:absolute!important;width:1px!important;height:1px!important;
  clip-path:inset(50%)!important;overflow:hidden!important;
}
#organisation-email-versand .ns-r10-security-actions button {
  border:1px solid var(--portal-brand-primary)!important;
  color:var(--portal-brand-primary)!important;background:transparent!important;
}
#organisation-email-versand .ns-r10-security-actions button.is-on {
  background:var(--portal-brand-primary)!important;
  color:var(--portal-button-primary-text,#fff)!important;
}
html[data-color-mode=kontrast] #organisation-email-versand :is(.ns-r10-provider-toggle,.ns-r10-security-actions button) {
  outline-offset:2px;
}
html[data-color-mode=kontrast] #organisation-email-versand .ns-r10-security-actions button:not(.is-on) {
  color:var(--portal-link)!important;
  background:var(--portal-surface-raised)!important;
  border-color:var(--portal-link)!important;
}

/* In high contrast, red remains the inactive border cue but MUST NOT cause
   unreadable dark-red text on the black background. */
html[data-color-mode=kontrast] #organisation-email-versand .ns-r10-provider-toggle:not(.is-on) {
  color:var(--portal-text)!important;
  border-color:var(--portal-danger)!important;
  background:var(--portal-surface-raised)!important;
}

/* ================================================================
   CHAT=NETSTYLE_TECHNIKPORTAL_HAUPTCHAT_R20_HF10
   RELEASE=R20_HF10_R9_THEME_CONNECTORS
   ZWECK=Zentraler Light/Dark/System/Monochrom/Kontrastvertrag;
         getrennte E-Mail- und Integrationsseiten; nur Modul-Namespace.
   Benutzt ausschließlich aktive --portal-* Tokens des Designmasters.
   ================================================================ */
/* Theme color values must resolve from the SINGLE active portal designmaster.
   Do not re-read --ns-dark-* here: doing that bypasses user color modes
   (notably dark + contrast) and would override the active portal palette. */
html[data-theme-mode="dark"] #organisation-email-versand,
html[data-theme-mode="dark"] #ns-integrations-hub,
html[data-theme="dark"] #organisation-email-versand,
html[data-theme="dark"] #ns-integrations-hub{color-scheme:dark}
@media(prefers-color-scheme:dark){
  html[data-theme-mode="system"] #organisation-email-versand,
  html[data-theme-mode="system"] #ns-integrations-hub{color-scheme:dark}
}

/* Exact module scope, not global shell or non-portal CSS. */
#organisation-email-versand,
#ns-integrations-hub{
  --ns-settings-page: var(--portal-bg);
  --ns-settings-card: var(--portal-surface);
  --ns-settings-field: var(--portal-surface-raised);
  --ns-settings-muted: var(--portal-surface-muted);
  --ns-settings-text: var(--portal-text);
  --ns-settings-secondary: var(--portal-text-muted);
  --ns-settings-border: var(--portal-border);
  --ns-settings-accent: var(--portal-brand-primary);
  --ns-settings-focus: var(--portal-focus);
  background:var(--ns-settings-card)!important;
  color:var(--ns-settings-text)!important;
  border-color:var(--ns-settings-border)!important;
  min-width:0;
}
#organisation-email-versand .ns-mail-policy,
#organisation-email-versand .ns-mail-provider-number,
#ns-integrations-hub .ns-integrations-kpi,
#ns-integrations-hub .ns-integrations-empty{
  background:var(--ns-settings-muted)!important;
  color:var(--ns-settings-text)!important;
  border-color:var(--ns-settings-border)!important;
}
#organisation-email-versand .ns-mail-provider,
#ns-integrations-hub .ns-integrations-entry,
#ns-integrations-hub .ns-integrations-tabs{
  background:var(--ns-settings-card)!important;
  color:var(--ns-settings-text)!important;
  border-color:var(--ns-settings-border)!important;
}
#organisation-email-versand .ns-mail-provider[open]{border-color:var(--ns-settings-focus)!important}
#organisation-email-versand .ns-mail-heading h1,
#organisation-email-versand .ns-mail-provider-name,
#organisation-email-versand .ns-mail-provider>summary,
#organisation-email-versand .ns-mail-check,
#organisation-email-versand .ns-mail-field label,
#ns-integrations-hub h1,
#ns-integrations-hub h2,
#ns-integrations-hub h3,
#ns-integrations-hub strong{
  color:var(--ns-settings-text)!important;
}
#organisation-email-versand .ns-mail-heading p,
#organisation-email-versand .ns-mail-admin-label,
#organisation-email-versand .ns-mail-provider-name small,
#organisation-email-versand .ns-mail-field small,
#organisation-email-versand .ns-mail-help,
#organisation-email-versand .ns-mail-policy>p,
#organisation-email-versand .ns-mail-scroll-instruction,
#organisation-email-versand .ns-mail-test-form label,
#ns-integrations-hub p,
#ns-integrations-hub .ns-integrations-kpi span{
  color:var(--ns-settings-secondary)!important;
}
#organisation-email-versand .ns-mail-admin-label,
#ns-integrations-hub .ns-mail-admin-label{
  border:1px solid var(--ns-settings-border)!important;
  background:var(--ns-settings-card)!important;
  color:var(--ns-settings-secondary)!important;
}
#organisation-email-versand .ns-mail-field input:not([type=checkbox]),
#organisation-email-versand .ns-mail-field select,
#organisation-email-versand .ns-mail-test-form input,
#organisation-email-versand .ns-mail-test-form select,
#ns-integrations-hub input,
#ns-integrations-hub select{
  background:var(--ns-settings-field)!important;
  color:var(--ns-settings-text)!important;
  border:1px solid var(--ns-settings-border)!important;
}
#organisation-email-versand input::placeholder,
#ns-integrations-hub input::placeholder{
  color:var(--ns-settings-secondary)!important;
  opacity:.82;
}
#organisation-email-versand :is(input,select,button,a,summary):focus-visible,
#ns-integrations-hub :is(input,select,button,a,summary):focus-visible{
  outline:2px solid var(--ns-settings-focus)!important;
  outline-offset:2px;
}
#organisation-email-versand .ns-mail-provider-number,
#organisation-email-versand .ns-mail-section-label,
#organisation-email-versand .ns-mail-expand,
#ns-integrations-hub .ns-integrations-eyebrow{
  color:var(--ns-settings-accent)!important;
}
.ns-integrations-panel{padding:18px 20px!important}
.ns-integrations-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}
.ns-integrations-heading h1{font-size:clamp(1.3rem,1.6vw,1.65rem);margin:3px 0 6px!important}
.ns-integrations-heading p{margin:0!important;line-height:1.55}
.ns-integrations-eyebrow{font-size:.72rem;font-weight:750;letter-spacing:.04em}
.ns-integrations-tabs{display:flex;align-items:stretch;flex-flow:row nowrap;gap:8px;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;padding:10px 2px;margin-bottom:18px;border-bottom:1px solid var(--ns-settings-border)}
#ns-integrations-hub .ns-integrations-tab{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;text-decoration:none!important;font-size:.82rem;font-weight:700;min-height:38px;border-radius:8px;border:1px solid var(--ns-settings-border);padding:8px 12px;background:var(--ns-settings-muted)!important;color:var(--ns-settings-text)!important;white-space:nowrap}
#ns-integrations-hub .ns-integrations-tab.is-active,
#ns-integrations-hub .ns-integrations-tab[aria-current=page]{background:var(--portal-button-primary-bg,var(--ns-settings-accent))!important;color:var(--portal-button-primary-text)!important;border-color:var(--ns-settings-accent)!important}
#ns-integrations-hub .ns-integrations-tab:hover:not(.is-active){border-color:var(--ns-settings-accent)!important;color:var(--ns-settings-accent)!important}
.ns-integrations-content{padding:2px 0 12px}
.ns-integrations-content h2{font-size:1.1rem;margin:6px 0 8px!important}
.ns-integrations-content h3{font-size:.95rem;margin:18px 0 8px!important}
.ns-integrations-content p{line-height:1.6}
.ns-integrations-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}
.ns-integrations-kpi{border:1px solid var(--ns-settings-border);border-radius:9px;padding:14px;display:flex;flex-direction:column;gap:7px}
.ns-integrations-kpi strong{font-size:1.45rem}
.ns-integrations-kpi span{font-size:.82rem}
.ns-integrations-empty{border:1px solid var(--ns-settings-border);border-radius:9px;padding:15px;margin-top:14px}
.ns-integrations-catalog{display:grid;gap:12px}
.ns-integrations-entry{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--ns-settings-border);border-radius:9px;padding:12px}
.ns-integrations-entry p{margin:4px 0 0}
.ns-integrations-entry a{flex:0 0 auto;white-space:nowrap}
@media(max-width:767px){
  .ns-integrations-panel{padding:14px!important}
  .ns-integrations-heading{flex-direction:column}
  .ns-integrations-summary{grid-template-columns:1fr}
  .ns-integrations-tabs{scrollbar-width:auto}
  .ns-integrations-entry{align-items:flex-start;flex-direction:column}
}

/* NETSTYLE TECHNIKPORTAL | CENTRAL THEME SHELL | HF10 R9 FIX3
 * CHAT=NETSTYLE_TECHNIKPORTAL_HAUPTCHAT_R20_HF10
 * This is the versioned compatibility layer of the systemwide design master.
 * It does not introduce a module-specific color palette. R21 is not accessed.
 */

/* ========================================================================== */
/* NETSTYLE TECHNIKPORTAL | R20 HF10 R9 GLOBAL THEME SHELL FIX1               */
/* CHAT=NETSTYLE_TECHNIKPORTAL_HAUPTCHAT_R20_HF10 | R21 NOT MODIFIED           */
/* Personal monochrome and contrast must include THE WHOLE portal shell.        */
/* These are central portal tokens, never module-specific CSS or DB branding.   */
/* ========================================================================== */
html[data-color-mode="monochrom"] {
  --portal-brand-sidebar: #303030 !important;
  --portal-sidebar: #303030 !important;
  --portal-sidebar-text: #FFFFFF !important;
  --portal-sidebar-muted: #DFDFDF !important;
}
html[data-theme-mode="dark"][data-color-mode="monochrom"] {
  --portal-brand-sidebar: #151515 !important;
  --portal-sidebar: #151515 !important;
  --portal-sidebar-text: #FFFFFF !important;
  --portal-sidebar-muted: #DADADA !important;
}
html[data-color-mode="kontrast"] {
  --portal-brand-sidebar: #000000 !important;
  --portal-sidebar: #000000 !important;
  --portal-sidebar-text: #FFFFFF !important;
  --portal-sidebar-muted: #FFFFFF !important;
}
/* In SYSTEM mode the OS dark preference must resolve to the same special-mode
   palette as explicit Dark; the historical rule only targeted explicit Dark. */
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"][data-color-mode="monochrom"] {
    --portal-brand-sidebar: #151515 !important;
    --portal-sidebar: #151515 !important;
    --portal-sidebar-text: #FFFFFF !important;
    --portal-sidebar-muted: #DADADA !important;
    --portal-brand-primary: #CBD5E1 !important;
    --portal-brand-accent: #94A3B8 !important;
    --portal-link: #E2E8F0 !important;
    --portal-button-primary-bg: #CBD5E1 !important;
    --portal-button-primary-text: #0F172A !important;
    --portal-button-primary-hover: #E2E8F0 !important;
    --portal-nav-active-bg: #64748B !important;
    --portal-nav-active-text: #FFFFFF !important;
  }
  html[data-theme-mode="system"][data-color-mode="kontrast"] {
    --portal-brand-sidebar: #000000 !important;
    --portal-sidebar: #000000 !important;
    --portal-sidebar-text: #FFFFFF !important;
    --portal-sidebar-muted: #FFFFFF !important;
    --portal-bg: #000000 !important;
    --portal-surface: #090909 !important;
    --portal-surface-raised: #111111 !important;
    --portal-text: #FFFFFF !important;
    --portal-heading: #FFFFFF !important;
    --portal-text-muted: #D7D7D7 !important;
    --portal-border: #FFFFFF !important;
    --portal-brand-primary: #FFD400 !important;
    --portal-brand-accent: #FFD400 !important;
    --portal-link: #8CC8FF !important;
    --portal-button-primary-bg: #FFD400 !important;
    --portal-button-primary-text: #000000 !important;
    --portal-button-primary-hover: #FFE45B !important;
    --portal-nav-active-bg: #FFD400 !important;
    --portal-nav-active-text: #000000 !important;
  }
}

/* HF10 R9 SHELL FIX3: contrast is a portal-wide control contract.
   The global search submit had a separate higher-priority blue button rule,
   while the contrast navigation already uses the central yellow/black tokens.
   Override ONLY explicit Dark+Contrast and OS-Dark System+Contrast. Do not
   change company palettes, light-contrast, SMTP components or connector cards. */
html[data-theme-mode="dark"][data-color-mode="kontrast"]
  .global-search-submit.search-submit {
  background: var(--portal-nav-active-bg, #FFD400) !important;
  border-color: var(--portal-nav-active-bg, #FFD400) !important;
  color: var(--portal-nav-active-text, #000000) !important;
}
@media (prefers-color-scheme: dark) {
  html[data-theme-mode="system"][data-color-mode="kontrast"]
    .global-search-submit.search-submit {
    background: var(--portal-nav-active-bg, #FFD400) !important;
    border-color: var(--portal-nav-active-bg, #FFD400) !important;
    color: var(--portal-nav-active-text, #000000) !important;
  }
}

/* ========================================================================
   R20 HF10 R10 – SYSTEMWIDE HIGH CONTRAST READABILITY
   CHAT=NETSTYLE_TECHNIKPORTAL_HAUPTCHAT_R20_HF10 | R21=NOT_MODIFIED
   Text and surface colors derive from the ACTIVE central portal theme tokens.
   Applies to customer, inventory, documentation and other portal module tables.
   Avoid blanket '* {color:...}' that destroys semantic buttons and status badges.
   ======================================================================== */
html[data-color-mode="kontrast"] :is(
  .workorder-table, .enterprise-actions-table, .table-wrapper,
  .compact-list, .compact-list > a, .customer-overview-grid a,
  .customer-tabs a, .customer-tabs-main a,
  .panel, .portal-panel, .data-table, .asset-detail-grid,
  .customer-overview-grid-large a, .inventar-launch-card,
  .runtime-credential-card, .report-table
) {
  border-color:var(--portal-border) !important;
}
html[data-color-mode="kontrast"] :is(
  .workorder-table td, .workorder-table th, .workorder-table td strong,
  .workorder-table td small, .enterprise-actions-table td,
  .data-table td, .data-table th, .customer-overview-grid a,
  .compact-list > a, .compact-list > a strong,
  .compact-list > a span, .inventar-launch-card p,
  .customer-overview-grid-large a span, .asset-detail-grid > div span,
  .runtime-credential-row span, .asset-credential-row span,
  .empty-state, .eyebrow, .customer-name-link,
  .report-table td, .report-table th
) {
  color:var(--portal-text) !important;
}
html[data-color-mode="kontrast"] :is(
  .workorder-table td a, .enterprise-actions-table td a,
  .customer-name-link, .compact-list > a:hover,
  .customer-overview-grid a:hover
):not(.primary-button):not(.secondary-button):not(.danger-button) {
  color:var(--portal-link) !important;
  text-decoration:underline;
  text-underline-offset:2px;
}
html[data-color-mode="kontrast"] :is(
  .workorder-table td small, .compact-list > a span,
  .inventar-launch-card p, .asset-detail-grid > div span,
  .customer-overview-grid-large a span, .empty-state
) {
  color:var(--portal-text-muted) !important;
}
/* Rows are normally hard-coded dark blue in older portal components. Make
   their backgrounds use central tokens too, without recoloring status badges. */
html[data-color-mode="kontrast"] :is(
  .workorder-table tbody tr, .enterprise-actions-table tbody tr,
  .compact-list > a, .customer-overview-grid a,
  .customer-tabs a:not(.is-active), .inventar-launch-card
) {
  background:var(--portal-surface-raised) !important;
  border-color:var(--portal-border) !important;
}
/* Contrast text input, placeholder and focus visibility – form-wide contract. */
html[data-color-mode="kontrast"] :is(
  .portal-input, .portal-form input:not([type="checkbox"]):not([type="radio"]),
  .portal-form select, .portal-form textarea, .global-search-input
) {
  background:var(--portal-surface-raised) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
}
html[data-color-mode="kontrast"] :is(input,textarea)::placeholder {
  color:var(--portal-text-muted) !important;
  opacity:1;
}
html[data-color-mode="kontrast"] :is(a,button,input,select,textarea,summary):focus-visible {
  outline:3px solid var(--portal-focus, var(--portal-brand-primary)) !important;
  outline-offset:2px;
}
/* Nightmode contrast: override more specific dark-blue legacy href selectors.
   Includes both explicit dark and OS-dark system themes. */
html[data-theme-mode="dark"][data-color-mode="kontrast"] :is(
  .workorder-table tbody tr td a, .workorder-table tbody tr td strong,
  .compact-list > a span, .compact-list > a strong,
  .customer-name-link, .enterprise-actions-table tbody tr td
) { color:var(--portal-text) !important; }
@media(prefers-color-scheme:dark) {
  html[data-theme-mode="system"][data-color-mode="kontrast"] :is(
    .workorder-table tbody tr td a, .workorder-table tbody tr td strong,
    .compact-list > a span, .compact-list > a strong,
    .customer-name-link, .enterprise-actions-table tbody tr td
  ) { color:var(--portal-text) !important; }
}
/* Mailpit is a separate sandbox section, never a production routing card. */
#organisation-email-versand .ns-mail-test-sandbox {
  margin-top:16px;
  padding:12px;
  border:1px dashed var(--portal-border) !important;
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
}
#organisation-email-versand .ns-mail-test-sandbox h2 {
  font-size:1rem;
  color:var(--portal-heading) !important;
}
#organisation-email-versand .ns-mail-test-sandbox p {
  color:var(--portal-text-muted) !important;
}
#ns-integrations-hub .ns-integrations-table-wrapper {overflow-x:auto}
#ns-integrations-hub .ns-integrations-table {min-width:900px;width:100%}
#ns-integrations-hub .ns-integrations-table td small {display:block;color:var(--portal-text-muted)}
/* WCAG AAA 7:1 small text in high-contrast LIGHT, including OS System/Light.
   Keep these tokens central so the customer and inventory classes above inherit. */
html[data-theme-mode="light"][data-color-mode="kontrast"] {
  --portal-text-muted:#262626 !important;
  --portal-text:#000000 !important;
  --portal-heading:#000000 !important;
  --portal-link:#003A8C !important;
}
@media(prefers-color-scheme:light) {
  html[data-theme-mode="system"][data-color-mode="kontrast"] {
    --portal-text-muted:#262626 !important;
    --portal-text:#000000 !important;
    --portal-heading:#000000 !important;
    --portal-link:#003A8C !important;
  }
}

/* NETSTYLE Technikportal R20 HF10 R10 Design FIX4.
   Uses the ACTIVE global --portal-* theme tokens, never a competing palette. */
.sidebar .navigation .nav-item {
  display:flex;flex-flow:row nowrap;align-items:center;
  gap:12px;min-height:38px;padding:8px 12px;line-height:1.4;box-sizing:border-box;
}
.sidebar .navigation .nav-item > .nav-icon {
  display:inline-flex;flex:0 0 22px;min-width:22px;align-items:center;justify-content:center;line-height:1;
}
.sidebar .navigation .nav-item > span:not(.nav-icon){min-width:0}
.sidebar .navigation .nav-divider{margin-block:8px}
#organisation-email-versand {
  background:var(--portal-surface)!important;color:var(--portal-text)!important;
  border-color:var(--portal-border)!important;
}
#organisation-email-versand :is(.ns-mail-provider,.ns-mail-provider > summary,.ns-mail-provider-body,.ns-mail-test-sandbox) {
  background:var(--portal-surface)!important;color:var(--portal-text)!important;
  border-color:var(--portal-border)!important;
}
#organisation-email-versand .ns-mail-policy {
  background:var(--portal-surface-muted)!important;color:var(--portal-text)!important;
  border-color:var(--portal-border)!important;
}
#organisation-email-versand :is(.ns-mail-heading h1,.ns-mail-heading h2,.ns-mail-provider-name,.ns-mail-test-sandbox h2,.ns-mail-field > label) {
  color:var(--portal-text)!important;
}
#organisation-email-versand :is(.ns-mail-help,.ns-mail-heading p,.ns-mail-provider-name small,.ns-mail-field small,.ns-r10-save-note,.ns-mail-test-sandbox p) {
  color:var(--portal-text-muted)!important;
}
#organisation-email-versand .ns-mail-field :is(input:not([type=checkbox]),select,textarea),
#organisation-email-versand .ns-mail-test-form :is(input,select) {
  background:var(--portal-surface-raised)!important;border:1px solid var(--portal-border)!important;
  color:var(--portal-text)!important;min-height:40px!important;
}
#organisation-email-versand :is(input,textarea)::placeholder {color:var(--portal-text-muted)!important;opacity:1}
#organisation-email-versand .ns-mail-provider-number {
  background:var(--portal-surface-muted)!important;color:var(--portal-link)!important;
  border:1px solid var(--portal-border)!important;
}
#organisation-email-versand .ns-mail-provider[open]{box-shadow:none!important;border-color:var(--portal-border)!important}
#organisation-email-versand .ns-mail-provider > summary{border-bottom:1px solid var(--portal-border)}
#organisation-email-versand .ns-r10-save-note{font-size:.8rem;line-height:1.45;margin:0 0 12px}
/* One horizontal action line for toggle, saved provider state, secret readiness,
   STARTTLS/SSL and connection test. No wrapping into vertical button stacks. */
#organisation-email-versand .ns-r10-provider-actions {
  display:flex!important;flex-flow:row nowrap!important;align-items:center!important;
  justify-content:flex-start;gap:12px;width:100%;min-width:0;max-width:100%;
  margin-bottom:14px;padding:3px 2px 9px;box-sizing:border-box;
  overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;
  scrollbar-width:thin;scrollbar-color:var(--portal-brand-primary) var(--portal-surface-muted);
}
#organisation-email-versand .ns-r10-provider-actions > *{flex:0 0 auto;min-width:0}
#organisation-email-versand .ns-r10-provider-toggle {
  display:inline-flex!important;flex-flow:row nowrap;align-items:center;justify-content:flex-start;
  gap:10px;min-height:44px!important;margin:0!important;padding:6px 12px!important;
  border:2px solid var(--portal-danger)!important;border-radius:7px!important;
  background:var(--portal-surface-raised)!important;color:var(--portal-text)!important;
  cursor:pointer;white-space:nowrap;
}
#organisation-email-versand .ns-r10-provider-toggle.is-on {
  border-color:var(--portal-button-primary-bg)!important;
  background:var(--portal-button-primary-bg)!important;
  color:var(--portal-button-primary-text)!important;
}
#organisation-email-versand .ns-r10-provider-toggle input[type=checkbox] {
  accent-color:currentColor;width:17px;height:17px;flex:0 0 17px;margin:0;
}
#organisation-email-versand .ns-r10-provider-toggle-copy {
  display:flex;flex-flow:column nowrap;align-items:flex-start;gap:2px;
  font-weight:700;font-size:.82rem;line-height:1.25;
}
#organisation-email-versand .ns-r10-provider-toggle-copy small {
  font-size:.72rem;font-weight:500;white-space:nowrap;color:inherit!important;opacity:.95;
}
#organisation-email-versand .ns-r10-provider-status {
  width:auto!important;min-width:max-content;max-width:none!important;
  display:inline-flex!important;flex:0 0 auto;align-items:center!important;
  flex-flow:row nowrap!important;gap:9px!important;padding:0!important;overflow:visible!important;
}
#organisation-email-versand .ns-r10-provider-status > *{flex:0 0 auto;white-space:nowrap}
#organisation-email-versand .ns-r10-provider-status :is(.ns-r10-status,.ns-r10-secret-status) {
  display:inline-flex;align-items:center;min-height:36px;box-sizing:border-box;
  padding:6px 10px;border:1px solid var(--portal-border)!important;border-radius:6px;
  background:var(--portal-surface-muted)!important;color:var(--portal-text)!important;
  font-size:.76rem;font-weight:600;
}
#organisation-email-versand .ns-r10-provider-status .ns-r10-status[data-pending="true"] {
  border-style:dashed!important;border-width:2px!important;border-color:var(--portal-focus)!important;
}
#organisation-email-versand .ns-r10-provider-status > button,
#organisation-email-versand .ns-r10-security-actions > button {
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  min-height:40px!important;white-space:nowrap;border-radius:6px;
  font-size:.8rem;font-weight:700;padding:7px 12px;
}
#organisation-email-versand .ns-r10-provider-status > button {
  color:var(--portal-link)!important;border:1px solid var(--portal-link)!important;
  background:var(--portal-surface-raised)!important;
}
#organisation-email-versand .ns-r10-security-field {
  display:inline-flex;align-items:center;gap:7px;min-width:max-content;
}
#organisation-email-versand .ns-r10-security-field > label {
  font-size:.76rem!important;font-weight:700!important;color:var(--portal-text)!important;
}
#organisation-email-versand .ns-r10-security-select {
  position:absolute!important;width:1px!important;height:1px!important;
  margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;
}
#organisation-email-versand .ns-r10-security-actions {
  display:inline-flex!important;align-items:center!important;gap:7px!important;
  flex-flow:row nowrap!important;padding:0!important;margin:0!important;
  width:auto!important;max-width:none!important;overflow:visible!important;
}
#organisation-email-versand .ns-r10-security-actions > button {
  border:1px solid var(--portal-link)!important;
  background:var(--portal-surface-raised)!important;color:var(--portal-link)!important;
}
#organisation-email-versand .ns-r10-security-actions > button.is-on {
  border-color:var(--portal-button-primary-bg)!important;
  background:var(--portal-button-primary-bg)!important;
  color:var(--portal-button-primary-text)!important;
}
#organisation-email-versand .ns-mail-toolbar {border-color:var(--portal-border)!important}
#organisation-email-versand .ns-mail-actions {flex-flow:row nowrap!important;align-items:center!important}
#organisation-email-versand .ns-mail-actions > button {margin:0!important}
#organisation-email-versand .ns-mail-test-sandbox {
  border:1px dashed var(--portal-border)!important;margin-top:18px;padding:16px;
}
#organisation-email-versand .ns-mail-test-sandbox .ns-mail-actions {margin-top:10px;padding-top:4px}
#organisation-email-versand .ns-mail-test-sandbox button:disabled {cursor:not-allowed;opacity:.65}
#organisation-email-versand :is(input,select,button,summary,a):focus-visible,
.sidebar .navigation .nav-item:focus-visible {
  outline:3px solid var(--portal-focus)!important;outline-offset:2px;
}
html[data-color-mode="kontrast"] #organisation-email-versand :is(
  .ns-mail-policy,.ns-mail-provider,.ns-mail-provider-body,
  .ns-r10-provider-status .ns-r10-status,.ns-r10-provider-status .ns-r10-secret-status,.ns-mail-test-sandbox
) {border-color:var(--portal-border)!important}
html[data-color-mode="kontrast"] #organisation-email-versand .ns-r10-provider-toggle:not(.is-on) {
  background:var(--portal-surface-raised)!important;color:var(--portal-text)!important;
}
@media(max-width:767px) {
  #organisation-email-versand .ns-r10-provider-actions{scrollbar-width:auto}
  #organisation-email-versand .ns-r10-provider-toggle{min-height:44px!important}
  #organisation-email-versand .ns-mail-test-sandbox{padding:12px}
}
/* Personal settings must inherit actual contrast palette, including selected
   choice cards and the success message. Current personal preview JS supplies
   data-settings-choice/is-selected, but no independent palette is introduced. */
html[data-color-mode="kontrast"] [data-personal-settings-form] :is(fieldset,[data-settings-choice],.settings-card,.settings-panel) {
  background:var(--portal-surface-raised)!important;
  border-color:var(--portal-border)!important;
  color:var(--portal-text)!important;
}
html[data-color-mode="kontrast"] [data-personal-settings-form] [data-settings-choice] :is(label,span,strong,small) {
  color:var(--portal-text)!important;
}
html[data-color-mode="kontrast"] [data-personal-settings-form] [data-settings-choice].is-selected {
  background:var(--portal-button-primary-bg)!important;
  border-color:var(--portal-button-primary-bg)!important;
  color:var(--portal-button-primary-text)!important;
}
html[data-color-mode="kontrast"] [data-personal-settings-form] [data-settings-choice].is-selected :is(label,span,strong,small) {
  color:var(--portal-button-primary-text)!important;
}
html[data-color-mode="kontrast"] :is(.portal-message,.portal-message--success,.portal-message--error) {
  background:var(--portal-surface)!important;
  border:1px solid var(--portal-border)!important;
  color:var(--portal-text)!important;
}
html[data-color-mode="kontrast"] :is(.portal-message,.portal-message--success,.portal-message--error) :is(p,span,strong,small) {
  color:var(--portal-text)!important;
}
/* Disabled Mailpit buttons must remain legible in high contrast. */
html[data-color-mode="kontrast"] #organisation-email-versand .ns-mail-test-sandbox button:disabled {
  opacity:1!important;
  background:var(--portal-surface-muted)!important;
  border-color:var(--portal-border)!important;
  color:var(--portal-text-muted)!important;
}

/* NETSTYLE R20/HF10/R10 DESIGN FIX5 – portal-wide readability acceptance.
   Supplements FIX4; no DB, mail, or new theme persistence mechanism.
   All contrast colors resolve through the central --portal-* theme contract. */

/* Restore AAA-readable supporting text across customers/inventory/documentation
   in the normal dark corporate palette. Previous component CSS had navy text on
   navy backgrounds with higher specificity than the general R3 theme layer. */
html[data-theme-mode="dark"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) :is(td,th),
html[data-theme-mode="dark"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) td :is(strong,span:not([class*="status"]):not([class*="badge"]),em),
html[data-theme-mode="dark"] :is(.customer-contact-cell,.customer-name-link,.customer-address-cell,.customer-location-cell) {
  color:var(--portal-text) !important;
}
html[data-theme-mode="dark"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) td :is(small,.muted,.helptext) {
  color:var(--portal-text-muted) !important;
}
html[data-theme-mode="dark"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) td a:not(.primary-button):not(.secondary-button):not(.danger-button),
html[data-theme-mode="dark"] :is(a.customer-name-link,.customer-contact-cell a) {
  color:var(--portal-link) !important;
}
@media (prefers-color-scheme:dark) {
  html[data-theme-mode="system"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) :is(td,th),
  html[data-theme-mode="system"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) td :is(strong,span:not([class*="status"]):not([class*="badge"]),em),
  html[data-theme-mode="system"] :is(.customer-contact-cell,.customer-name-link,.customer-address-cell,.customer-location-cell) {color:var(--portal-text) !important}
  html[data-theme-mode="system"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) td :is(small,.muted,.helptext) {color:var(--portal-text-muted) !important}
  html[data-theme-mode="system"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table) td a:not(.primary-button):not(.secondary-button):not(.danger-button),
  html[data-theme-mode="system"] :is(a.customer-name-link,.customer-contact-cell a) {color:var(--portal-link) !important}
}

/* Contrast must be TRUE monochrome surfaces, rather than dark-blue cards with
   a yellow search button. This token layer is independent of company branding. */
html[data-color-mode="kontrast"] {
  --portal-brand-soft:var(--portal-surface-raised) !important;
  --portal-surface-muted:var(--portal-surface) !important;
  --portal-info:var(--portal-link) !important;
  --blue-soft:var(--portal-surface-raised) !important;
  --portal-shadow:none !important;
}
html[data-theme-mode="dark"][data-color-mode="kontrast"] {
  --portal-sidebar:#000000 !important;
  --portal-brand-sidebar:#000000 !important;
  --portal-sidebar-text:#FFFFFF !important;
  --portal-sidebar-muted:#FFFFFF !important;
  --portal-surface-muted:#090909 !important;
  --portal-border-strong:#FFFFFF !important;
  --portal-focus:#FFD400 !important;
  --portal-brand-soft:#111111 !important;
  --blue-soft:#111111 !important;
}
@media (prefers-color-scheme:dark) {
  html[data-theme-mode="system"][data-color-mode="kontrast"] {
    --portal-sidebar:#000000 !important;
    --portal-brand-sidebar:#000000 !important;
    --portal-sidebar-text:#FFFFFF !important;
    --portal-sidebar-muted:#FFFFFF !important;
    --portal-surface-muted:#090909 !important;
    --portal-border-strong:#FFFFFF !important;
    --portal-focus:#FFD400 !important;
    --portal-brand-soft:#111111 !important;
    --blue-soft:#111111 !important;
  }
}
/* Root panels, their nested cards, and all tables retain the semantic theme.
   No blanket * color rule: keep status, buttons, warnings, and link semantics. */
html[data-color-mode="kontrast"] :is(
  .personal-settings-panel,.panel,.portal-card,.dashboard-card,.kpi-card,
  .worktime-row,.audit-note,.portal-panel,.customer-tabs,
  .ns-mail-policy,.ns-mail-provider,.ns-mail-test-sandbox,
  .ns-integrations-table-wrapper,
  .search-filter-panel,.filter-bar,.filter-panel,.report-filter,fieldset
) {
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="kontrast"] :is(
  table,.customer-table,.portal-table,.list-table,.data-table,.workorder-table,
  .report-table,.enterprise-actions-table,.ns-integrations-table
) {
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
}
html[data-color-mode="kontrast"] table :is(thead,tbody,tfoot,tr,td,th),
html[data-color-mode="kontrast"] :is(.customer-table,.portal-table,.list-table,.data-table,.workorder-table,.report-table,.enterprise-actions-table,.ns-integrations-table) :is(thead,tbody,tfoot,tr,td,th) {
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
}
html[data-color-mode="kontrast"] table thead th {
  background:var(--portal-surface-raised) !important;
  color:var(--portal-heading) !important;
}
html[data-color-mode="kontrast"] table td :is(strong,span:not([class*="status"]):not([class*="badge"]),em,small,.muted,.helptext),
html[data-color-mode="kontrast"] :is(.customer-contact-cell,.customer-address-cell,.customer-location-cell,.customer-name-cell) :is(span,strong,small) {
  color:var(--portal-text) !important;
}
html[data-color-mode="kontrast"] table td a:not(.primary-button):not(.secondary-button):not(.danger-button),
html[data-color-mode="kontrast"] a.customer-name-link,
html[data-color-mode="kontrast"] .customer-contact-cell a,
html[data-color-mode="kontrast"] table th a {
  color:var(--portal-link) !important;
  text-decoration:underline;
  text-underline-offset:2px;
}
html[data-color-mode="kontrast"] table tbody tr:hover :is(td,th),
html[data-color-mode="kontrast"] table tbody tr:focus-within :is(td,th) {
  background:var(--portal-surface-raised) !important;
}
/* High-contrast page headings and metadata. */
html[data-color-mode="kontrast"] :is(.page-heading h1,.page-heading h2,.panel h2,.panel h3,.settings-panel-title,.work-profile-title,legend) {
  color:var(--portal-heading) !important;
}
html[data-color-mode="kontrast"] :is(.page-heading p,.panel p,.panel small,.fieldset-help,.helptext) {
  color:var(--portal-text-muted) !important;
}
/* Actual personal-settings choice component is .settings-choice-card; FIX4
   matched a data-attribute but did not override the legacy blue backgrounds. */
html[data-color-mode="kontrast"] [data-personal-settings-form] .settings-choice-card,
html[data-color-mode="kontrast"] [data-personal-settings-form] [data-settings-choice] {
  background:var(--portal-surface-raised) !important;
  color:var(--portal-text) !important;
  border:1px solid var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="kontrast"] [data-personal-settings-form] .settings-choice-card.is-selected,
html[data-color-mode="kontrast"] [data-personal-settings-form] [data-settings-choice].is-selected {
  background:var(--portal-button-primary-bg) !important;
  color:var(--portal-button-primary-text) !important;
  border:2px solid var(--portal-button-primary-bg) !important;
  box-shadow:0 0 0 1px var(--portal-border) !important;
}
html[data-color-mode="kontrast"] [data-personal-settings-form] .settings-choice-card.is-selected :is(span,strong,small,label),
html[data-color-mode="kontrast"] [data-personal-settings-form] [data-settings-choice].is-selected :is(span,strong,small,label) {
  color:var(--portal-button-primary-text) !important;
}
html[data-color-mode="kontrast"] [data-personal-settings-form] .settings-choice-card:not(.is-selected) :is(span,strong,small,label) {
  color:var(--portal-text) !important;
}
/* Previous success notification retained very dark text via its more specific
   semantic success rules. Cover actual portal-message and legacy Django alerts. */
html[data-color-mode="kontrast"] :is(
  .portal-message,.portal-message.info,.portal-message.success,
  .portal-message--success,.portal-message--error,
  .alert,.alert-success,.alert-info,.alert-error,
  .messages > li,.message,.flash-message,.notification-banner
) {
  background:var(--portal-surface) !important;
  border:1px solid var(--portal-border) !important;
  color:var(--portal-text) !important;
}
html[data-color-mode="kontrast"] :is(
  .portal-message,.portal-message.info,.portal-message.success,
  .portal-message--success,.portal-message--error,
  .alert,.alert-success,.alert-info,.alert-error,
  .messages > li,.message,.flash-message,.notification-banner
) :is(span,strong,small,p,div:not(.portal-message-icon),button:not(.primary-button)) {
  color:var(--portal-text) !important;
}
html[data-color-mode="kontrast"] :is(.portal-message,.alert,.messages > li,.flash-message) a {color:var(--portal-link) !important}
/* Space between the border and heading text in the personal settings / work
   profile header, without moving site-wide grid gutters. */
body:has([data-personal-settings-form]) .content > :is(.page-heading,.profile-heading,.work-profile-heading) {
  padding-inline:12px;
  box-sizing:border-box;
}
body:has([data-personal-settings-form]) :is(.personal-settings-panel,.workprofile-panel) > :is(.page-heading,h2,h3) {
  padding-inline:12px;
}
/* Preserve strong navigation icon/text alignment and adequate touch targets. */
html .sidebar .navigation .nav-item {display:flex!important;align-items:center!important;gap:12px!important;padding-inline:12px!important;min-height:40px!important}
html .sidebar .navigation .nav-item > .nav-icon {display:inline-flex!important;flex:0 0 22px!important;min-width:22px!important;justify-content:center!important;align-items:center!important}
html .sidebar .navigation .nav-item > span:not(.nav-icon) {min-width:0}
/* Enforce WCAG-visible focus without introducing coloured contrast backgrounds. */
html[data-color-mode="kontrast"] :is(a,button,input,select,textarea,summary):focus-visible {
  outline:3px solid var(--portal-focus) !important;
  outline-offset:2px;
}

html[data-color-mode="kontrast"] #ns-integrations-hub {background:var(--portal-surface) !important;color:var(--portal-text) !important;border-color:var(--portal-border) !important}

/* NETSTYLE Technikportal R20 HF10 R10 – MODE SYSTEM R6
 * CHANGES: MONOCHROM (not branding), CONTRAST corrections, global spacing.
 * Source audit: 2026-10-20; mono and contrast only; R21 excluded.
 * Loaded after the complete R10 FIX5 CSS stack; never mutates saved profiles.
 */
html[data-color-mode="monochrom"] {
  color-scheme:light;
  --portal-bg:#f4f4f4 !important;
  --portal-surface:#ffffff !important;
  --portal-surface-raised:#fafafa !important;
  --portal-surface-muted:#ededed !important;
  --portal-text:#171717 !important;
  --portal-heading:#111111 !important;
  --portal-text-muted:#494949 !important;
  --portal-border:#8a8a8a !important;
  --portal-border-strong:#606060 !important;
  --portal-brand-primary:#262626 !important;
  --portal-brand-accent:#333333 !important;
  --portal-brand-hover:#101010 !important;
  --portal-brand-active:#000000 !important;
  --portal-brand-soft:#ededed !important;
  --portal-brand-on-primary:#ffffff !important;
  --portal-link:#202020 !important;
  --portal-button-primary-bg:#222222 !important;
  --portal-button-primary-text:#ffffff !important;
  --portal-button-primary-hover:#383838 !important;
  --portal-nav-active-bg:#343434 !important;
  --portal-nav-active-text:#ffffff !important;
  --portal-focus:#202020 !important;
  --portal-sidebar:#151515 !important;
  --portal-brand-sidebar:#151515 !important;
  --portal-sidebar-text:#fff !important;
  --portal-sidebar-muted:#e2e2e2 !important;
  --portal-shadow:none !important;
  --portal-info:#242424 !important;
  --portal-success:#333333 !important;
  --portal-warning:#444444 !important;
  --portal-danger:#333333 !important;
  --ns-ui-page:var(--portal-bg);
  --ns-ui-card:var(--portal-surface);
  --ns-ui-field:var(--portal-surface-raised);
  --ns-ui-hover:#e1e1e1;
  --ns-ui-ink:var(--portal-text);
  --ns-ui-line:var(--portal-border);
  --ns-ui-btn:var(--portal-button-primary-bg);
  --ns-ui-btn-text:var(--portal-button-primary-text);
}
html[data-color-mode="monochrom"][data-theme-mode="dark"] {
  color-scheme:dark;
  --portal-bg:#070707 !important;
  --portal-surface:#141414 !important;
  --portal-surface-raised:#202020 !important;
  --portal-surface-muted:#272727 !important;
  --portal-text:#f8f8f8 !important;
  --portal-heading:#fff !important;
  --portal-text-muted:#d0d0d0 !important;
  --portal-border:#878787 !important;
  --portal-border-strong:#b8b8b8 !important;
  --portal-brand-primary:#f3f3f3 !important;
  --portal-brand-accent:#e9e9e9 !important;
  --portal-brand-hover:#e3e3e3 !important;
  --portal-brand-active:#fff !important;
  --portal-brand-soft:#303030 !important;
  --portal-brand-on-primary:#090909 !important;
  --portal-link:#ffffff !important;
  --portal-button-primary-bg:#eeeeee !important;
  --portal-button-primary-text:#090909 !important;
  --portal-button-primary-hover:#ffffff !important;
  --portal-nav-active-bg:#eeeeee !important;
  --portal-nav-active-text:#090909 !important;
  --portal-focus:#fff !important;
  --portal-sidebar:#070707 !important;
  --portal-brand-sidebar:#070707 !important;
  --portal-sidebar-text:#fff !important;
  --portal-sidebar-muted:#ddd !important;
  --ns-ui-hover:#393939;
}
@media (prefers-color-scheme:dark) {
  html[data-color-mode="monochrom"][data-theme-mode="system"] {
    color-scheme:dark;
    --portal-bg:#070707 !important;
    --portal-surface:#141414 !important;
    --portal-surface-raised:#202020 !important;
    --portal-surface-muted:#272727 !important;
    --portal-text:#f8f8f8 !important;
    --portal-heading:#fff !important;
    --portal-text-muted:#d0d0d0 !important;
    --portal-border:#878787 !important;
    --portal-border-strong:#b8b8b8 !important;
    --portal-brand-primary:#f3f3f3 !important;
    --portal-brand-accent:#e9e9e9 !important;
    --portal-brand-hover:#e3e3e3 !important;
    --portal-brand-active:#fff !important;
    --portal-brand-soft:#303030 !important;
    --portal-brand-on-primary:#090909 !important;
    --portal-link:#fff !important;
    --portal-button-primary-bg:#eeeeee !important;
    --portal-button-primary-text:#090909 !important;
    --portal-button-primary-hover:#fff !important;
    --portal-nav-active-bg:#eeeeee !important;
    --portal-nav-active-text:#090909 !important;
    --portal-focus:#fff !important;
    --portal-sidebar:#070707 !important;
    --portal-brand-sidebar:#070707 !important;
    --portal-sidebar-text:#fff !important;
    --portal-sidebar-muted:#ddd !important;
    --ns-ui-hover:#393939;
  }
}
/* Historical component-specific fallback tokens must also follow monochrome. */
html[data-color-mode="monochrom"] {
  --blue:var(--portal-brand-primary) !important;
  --navy:var(--portal-bg) !important;
  --text:var(--portal-text) !important;
  --muted:var(--portal-text-muted) !important;
  --line:var(--portal-border) !important;
  --ns-night-text:var(--portal-text) !important;
  --ns-night-muted:var(--portal-text-muted) !important;
  --ns-night-border:var(--portal-border) !important;
  --ns-night-surface:var(--portal-surface) !important;
  --ns-night-raised:var(--portal-surface-raised) !important;
  --ns-night-btn:var(--portal-button-primary-bg) !important;
  --ns-night-link:var(--portal-link) !important;
  --ns-hf2-night-raised:var(--portal-surface-raised) !important;
  --ns-hf2-night-border:var(--portal-border) !important;
  --ns-hf2-night-muted:var(--portal-text-muted) !important;
  --ns-hf2-night-fg:var(--portal-text) !important;
  --ns-dark-surface-card:var(--portal-surface) !important;
  --ns-dark-surface-page:var(--portal-bg) !important;
  --ns-dark-text:var(--portal-text) !important;
  --ns-dark-border:var(--portal-border) !important;
  --ns-dark-primary:var(--portal-brand-primary) !important;
  --ns-dark-accent:var(--portal-brand-accent) !important;
  --ns-dark-button-primary-text:var(--portal-button-primary-text) !important;
  --ns-dark-button-primary-hover:var(--portal-button-primary-hover) !important;
  --ns-settings-card:var(--portal-surface-raised) !important;
  --ns-settings-accent:var(--portal-brand-primary) !important;
  --ns-settings-border:var(--portal-border) !important;
  --ns-settings-secondary:var(--portal-text-muted) !important;
  --ns-settings-text:var(--portal-text) !important;
  --ns-form-border:var(--portal-border) !important;
  --ns-form-text:var(--portal-text) !important;
  --hf5-surface:var(--portal-surface-raised) !important;
  --hf5-surface-low:var(--portal-surface-muted) !important;
  --hf5-text:var(--portal-text) !important;
  --hf5-muted:var(--portal-text-muted) !important;
  --hf5-line:var(--portal-border) !important;
  --hf5-accent:var(--portal-focus) !important;
  --hf6-ink:var(--portal-text) !important;
  --hf6-muted:var(--portal-text-muted) !important;
  --hf6-panel:var(--portal-surface) !important;
  --hf6-line:var(--portal-border) !important;
  --hf7-text:var(--portal-text) !important;
  --hf7-bg:var(--portal-surface) !important;
  --hf7-border:var(--portal-border) !important;
  --hf7-link:var(--portal-link) !important;
}
/* Shell, modal layers, cards, module toolbars: remove branded background fills. */
html[data-color-mode="monochrom"] :is(body,.main-column,.content,.page-layout,.portal-layout) {
  background:var(--portal-bg) !important;
  color:var(--portal-text) !important;
}
html[data-color-mode="monochrom"] :is(
  .topbar,.panel,.portal-panel,.portal-card,.dashboard-card,.kpi-card,.audit-kpi-card,
  .card,.tile,.modal,.dialog,.portal-confirm-dialog,.user-menu-dropdown,
  .detail-summary,.summary-card,.result-card,.inventory-card,.inventar-launch-card,
  .category-card,.knowledge-card,.runtime-credential-card,.runtime-knowledge-card,
  .calendar-card,.checklist-card,.report-card,.inspector-card,.settings-panel,
  .ns-r20-personal-profile,.personal-settings-panel,.workprofile-panel,
  .ns-mail-provider,.ns-mail-test-sandbox,#organisation-email-versand,
  #ns-integrations-hub,.ns-integrations-card,.ns-integrations-kpi,
  .enterprise-list-toolbar-panel,.enterprise-list-toolbar,.list-filter,
  .workorder-toolbar,.filter-toolbar,.search-toolbar,.search-panel,
  .portal-messages,.portal-message,.alert,.flash-message,.empty-state,
  fieldset,.structured-form,.calendar-toggle-card,.weekday-card,
  .point-toggle-card,.credential-scope-card,.runtime-checkbox,
  .detail-section,.audit-note,.access-card,.accordion,.accordion-panel
) {
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(
  .global-search,.global-search input,.enterprise-list-toolbar input,
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  textarea,select,.portal-input,.form-control,.search-field,.select-control,
  .ns-mail-field input,.ns-mail-field select,.ns-mail-field textarea,
  .ns-mail-policy,.ns-mail-provider-body,.ns-mail-provider > summary
) {
  background:var(--portal-surface-raised) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(input,textarea)::placeholder {
  color:var(--portal-text-muted) !important;opacity:1 !important;
}
/* Full tables and list rows including inline hardcoded blue styles. */
html[data-color-mode="monochrom"] :is(
  table,.table-wrapper,.data-table,.workorder-table,.enterprise-actions-table,
  .report-table,.ns-integrations-table,.compact-list,.table-responsive,
  .customer-table,.inventar-table,.audit-table,.list-table
) {
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(table,.data-table,.workorder-table,.enterprise-actions-table,.ns-integrations-table) :is(thead,th) {
  background:var(--portal-surface-muted) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
}
html[data-color-mode="monochrom"] :is(table,.data-table,.workorder-table,.enterprise-actions-table,.ns-integrations-table) :is(tbody,tr,td),
html[data-color-mode="monochrom"] :is(.compact-list > a,.compact-list > div,.enterprise-list-row,.customer-row,.audit-row,.search-result-row) {
  background:var(--portal-surface) !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
}
html[data-color-mode="monochrom"] :is(table,.data-table,.workorder-table,.enterprise-actions-table,.ns-integrations-table) tr:is(:hover,:focus-within,.selected,.is-selected,.is-active,[aria-selected="true"]),
html[data-color-mode="monochrom"] :is(.compact-list > a,.enterprise-list-row,.customer-row,.audit-row,.search-result-row):is(:hover,:focus-within,.selected,.is-selected,.is-active) {
  background:var(--ns-ui-hover) !important;
}
html[data-color-mode="monochrom"] :is(table,.data-table,.workorder-table,.enterprise-actions-table,.ns-integrations-table) tr:is(:hover,:focus-within,.selected,.is-selected,.is-active) > :is(th,td) {
  background:var(--ns-ui-hover) !important;
}
/* Navigation and every common action button, including global search/create CTAs. */
html[data-color-mode="monochrom"] :is(
  .primary-button,button.primary-button,a.primary-button,
  .portal-create-button,.knowledge-top-button,.enterprise-filter-button,
  .enterprise-row-button,.portal-standard-button,.search-submit,.global-search-submit,
  .button-primary,.btn-primary,.ns-mail-action-primary,.ns-r10-provider-toggle.is-on,
  .ns-mail-toggle.is-on,.ns-mail-tls-toggle.is-on,
  .editor-tab.is-active,.tab.is-active,.pagination .active
) {
  background:var(--portal-button-primary-bg) !important;
  background-image:none !important;
  color:var(--portal-button-primary-text) !important;
  border-color:var(--portal-button-primary-bg) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(
  .secondary-button,.button-secondary,.btn-secondary,.enterprise-reset-button,
  .enterprise-row-actions a,.enterprise-row-actions button,.table-actions a,.table-actions button,
  .nav-tabs a,.editor-tab,.tab,.ns-mail-test-button,
  .ns-mail-action-secondary,.ns-r10-provider-toggle:not(.is-on),
  .ns-mail-tls-toggle:not(.is-on),.ns-hf4-select-option
) {
  background:var(--portal-surface-raised) !important;
  background-image:none !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(
  .primary-button,.secondary-button,.portal-create-button,.knowledge-top-button,
  .portal-standard-button,.search-submit,.global-search-submit,
  .enterprise-filter-button,.enterprise-reset-button,.enterprise-row-button,
  .ns-r10-provider-toggle,.ns-mail-tls-toggle,.ns-mail-test-button
) :is(span,strong,small,kbd) {color:inherit !important;}
html[data-color-mode="monochrom"] :is(
  .primary-button,.secondary-button,.portal-create-button,.knowledge-top-button,
  .portal-standard-button,.search-submit,.global-search-submit,
  .enterprise-filter-button,.enterprise-reset-button,.enterprise-row-button
):hover {filter:brightness(.9);}
/* Personal settings: actual HTML class names from the R10 source export. */
html[data-color-mode="monochrom"] :is(.settings-choice-card,[data-settings-choice],.calendar-toggle-card) {
  background:var(--portal-surface-raised) !important;
  color:var(--portal-text) !important;
  border:1px solid var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(.settings-choice-card,[data-settings-choice]).is-selected,
html[data-color-mode="monochrom"] :is(.settings-choice-card,[data-settings-choice]):has(input:checked) {
  background:var(--portal-button-primary-bg) !important;
  color:var(--portal-button-primary-text) !important;
  border:2px solid var(--portal-border-strong) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(.settings-choice-card,[data-settings-choice]) :is(span,strong,small,label) {color:inherit !important;}
html[data-color-mode="monochrom"] :is(.settings-choice-card,[data-settings-choice]) input {accent-color:var(--portal-focus) !important;}
/* Neutralize old blue badges/metrics. Preserve meaning through the label, not hue. */
html[data-color-mode="monochrom"] :is(
  .status-badge,.status-pill,.badge,.badge-success,.badge-warning,.badge-info,
  .status--abgeschlossen,.status--archiviert,.status--offen,.status--in_bearbeitung,
  .result-count,.kpi-icon,.inventar-launch-icon,.search-hero-icon,
  .builder-section-number,.field-type-badge,.portal-dropzone-icon,
  .dashboard-icon,.category-icon,.workorder-progress,.progress-bar,.report-meter
) {
  background:var(--portal-surface-muted) !important;
  background-image:none !important;
  color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] :is(.progress-bar > span,.status-progress-fill,.report-meter > span) {
  background:var(--portal-text-muted) !important;
}
/* Actual text inside cards, table rows, alerts and list elements; don't recolor media. */
html[data-color-mode="monochrom"] :is(
  .panel,.portal-card,.dashboard-card,.workorder-table,.enterprise-actions-table,
  .data-table,.compact-list,.page-heading,.ns-r20-personal-profile,
  .portal-message,.ns-integrations-table,.customer-overview-grid
) :is(h1,h2,h3,h4,h5,p,small,strong,em,dt,dd,th,td,label) {
  color:var(--portal-text) !important;
  opacity:1 !important;
}
html[data-color-mode="monochrom"] :is(
  .content,.main-column,.topbar,.user-menu-dropdown
) a:not(.primary-button):not(.secondary-button):not(.portal-create-button):not(.knowledge-top-button):not(.enterprise-row-button):not(.portal-standard-button):not(.search-submit):not([role="button"]) {
  color:var(--portal-link) !important;
  text-decoration:underline;
}
html[data-color-mode="monochrom"] :is(.portal-message,.alert,.messages > li,.flash-message,.notification-banner),
html[data-color-mode="kontrast"] :is(.portal-message,.alert,.messages > li,.flash-message,.notification-banner) {
  background:var(--portal-surface) !important;
  border:1px solid var(--portal-border) !important;
  color:var(--portal-text) !important;
}
html[data-color-mode="monochrom"] :is(.portal-message,.alert,.messages > li,.flash-message,.notification-banner) :is(.portal-message-copy,span,p,strong,small),
html[data-color-mode="kontrast"] :is(.portal-message,.alert,.messages > li,.flash-message,.notification-banner) :is(.portal-message-copy,span,p,strong,small) {
  color:var(--portal-text) !important;opacity:1 !important;
}
html[data-color-mode="monochrom"] :is(.sidebar .nav-item,.sidebar .nav-item.is-active,.sidebar .nav-item.active) {
  color:var(--portal-sidebar-text) !important;
}
html[data-color-mode="monochrom"] .sidebar :is(.nav-item.is-active,.nav-item.active,[aria-current="page"]) {
  background:var(--portal-surface-muted) !important;
  color:#111 !important;
}
html[data-color-mode="monochrom"] :is(a,button,input,select,textarea,summary):focus-visible {
  outline:3px solid var(--portal-focus) !important;outline-offset:2px;
}
/* The heavily reported profile heading padding is a layout contract shared across themes. */
html .content > .panel.ns-r20-personal-profile {
  box-sizing:border-box !important;
  padding:16px 20px !important;
  margin-bottom:16px !important;
}
html .content > .panel.ns-r20-personal-profile .ns-r20-personal-profile-row {
  display:flex !important;align-items:center !important;column-gap:18px !important;
  row-gap:10px !important;flex-wrap:wrap !important;
}
html .content > .panel.ns-r20-personal-profile .ns-r20-personal-profile-row > div:first-child {
  padding-inline:0 !important;margin-inline:0 !important;min-width:200px;
}
html .content > .panel.ns-r20-personal-profile :is(h2,p) {
  padding:0 !important;margin-left:0 !important;margin-right:0 !important;
}
html .content > .panel.ns-r20-personal-profile .ns-r20-personal-profile-actions {
  display:flex !important;flex-flow:row nowrap !important;align-items:center !important;
  gap:10px !important;overflow-x:auto;max-width:100%;
}
html .content > .panel.ns-r20-personal-profile .ns-r20-personal-profile-actions > * {flex:0 0 auto !important;}
/* Contrast remains independent: readable messages/profile, no legacy blue cards. */
html[data-color-mode="kontrast"] .content > .panel.ns-r20-personal-profile {
  background:var(--portal-surface) !important;
  border-color:var(--portal-border) !important;
}
html[data-color-mode="kontrast"] .content > .panel.ns-r20-personal-profile :is(h2,p) {
  color:var(--portal-text) !important;
}
/* Stronger than the historical R20 dark-mode selection selector. */
html[data-color-mode="monochrom"] [data-personal-settings-form] .settings-choice-grid > label.settings-choice-card.is-selected,
html[data-color-mode="monochrom"] [data-personal-settings-form] .settings-choice-grid > label.settings-choice-card:has(input:checked) {
  background:var(--portal-button-primary-bg) !important;
  border-color:var(--portal-border-strong) !important;
  color:var(--portal-button-primary-text) !important;
}
html[data-color-mode="monochrom"] [data-personal-settings-form] .settings-choice-grid > label.settings-choice-card.is-selected :is(span,strong,small),
html[data-color-mode="monochrom"] [data-personal-settings-form] .settings-choice-grid > label.settings-choice-card:has(input:checked) :is(span,strong,small) {
  color:var(--portal-button-primary-text) !important;
}


/* NETSTYLE R20 HF10 R10 FIX7 – semantic action state contract.
 * REQUIRED: always bind foreground and background as a pair.
 * This layer loads at the very end of netstyle_r10_mode_system_fix6.css.
 * Only personal monochrome/high-contrast; enterprise branding untouched.
 * Colors cover default, hovered, active, focus, disabled, tab and nested labels.
 */
html[data-color-mode="monochrom"] {
  --ns-action-bg:#222222;
  --ns-action-fg:#ffffff;
  --ns-action-hover-bg:#373737;
  --ns-action-hover-fg:#ffffff;
  --ns-action-pressed-bg:#000000;
  --ns-action-pressed-fg:#ffffff;
  --ns-action-secondary-bg:var(--portal-surface-raised);
  --ns-action-secondary-fg:var(--portal-text);
  --ns-action-secondary-hover-bg:#dedede;
  --ns-action-secondary-hover-fg:#171717;
  --ns-action-disabled-bg:#e5e5e5;
  --ns-action-disabled-fg:#484848;
  --ns-action-border:var(--portal-border);
}
html[data-color-mode="monochrom"][data-theme-mode="dark"] {
  --ns-action-bg:#eeeeee;
  --ns-action-fg:#080808;
  --ns-action-hover-bg:#ffffff;
  --ns-action-hover-fg:#000000;
  --ns-action-pressed-bg:#d7d7d7;
  --ns-action-pressed-fg:#080808;
  --ns-action-secondary-hover-bg:#484848;
  --ns-action-secondary-hover-fg:#ffffff;
  --ns-action-disabled-bg:#424242;
  --ns-action-disabled-fg:#eeeeee;
}
@media (prefers-color-scheme:dark) {
 html[data-color-mode="monochrom"][data-theme-mode="system"] {
  --ns-action-bg:#eeeeee;
  --ns-action-fg:#080808;
  --ns-action-hover-bg:#ffffff;
  --ns-action-hover-fg:#000000;
  --ns-action-pressed-bg:#d7d7d7;
  --ns-action-pressed-fg:#080808;
  --ns-action-secondary-hover-bg:#484848;
  --ns-action-secondary-hover-fg:#ffffff;
  --ns-action-disabled-bg:#424242;
  --ns-action-disabled-fg:#eeeeee;
 }
}
html[data-color-mode="kontrast"] {
  --ns-action-bg:var(--portal-button-primary-bg);
  --ns-action-fg:var(--portal-button-primary-text);
  --ns-action-hover-bg:var(--portal-button-primary-hover);
  --ns-action-hover-fg:var(--portal-button-primary-text);
  --ns-action-pressed-bg:var(--portal-nav-active-bg);
  --ns-action-pressed-fg:var(--portal-nav-active-text);
  --ns-action-secondary-bg:var(--portal-surface-raised,#ffffff);
  --ns-action-secondary-fg:var(--portal-text,#111111);
  --ns-action-secondary-hover-bg:var(--portal-nav-active-bg,#ffd400);
  --ns-action-secondary-hover-fg:var(--portal-nav-active-text);
  --ns-action-disabled-bg:#d0d0d0;
  --ns-action-disabled-fg:#222222;
  --ns-action-border:var(--portal-border,#666666);
  --ns-tab-active-bg:var(--portal-nav-active-bg);
  --ns-tab-active-fg:var(--portal-nav-active-text);
  --ns-tab-active-hover-bg:var(--portal-nav-active-bg);
  --ns-tab-active-hover-fg:var(--portal-nav-active-text);
}
html[data-color-mode="kontrast"][data-theme-mode="dark"] {
  --ns-action-disabled-bg:#454545;
  --ns-action-disabled-fg:#ffffff;
}
@media (prefers-color-scheme:dark) {
 html[data-color-mode="kontrast"][data-theme-mode="system"] {
  --ns-action-bg:#ffd400;
  --ns-action-fg:#000000;
  --ns-action-hover-bg:#ffe45b;
  --ns-action-hover-fg:#000000;
  --ns-action-pressed-bg:#ffd400;
  --ns-action-pressed-fg:#000000;
  --ns-action-secondary-hover-bg:#ffd400;
  --ns-action-secondary-hover-fg:#000000;
  --ns-action-disabled-bg:#454545;
  --ns-action-disabled-fg:#ffffff;
  --ns-tab-active-bg:#ffd400;
  --ns-tab-active-fg:#000000;
 }
}
html[data-color-mode="monochrom"] {
 --ns-tab-active-bg:var(--ns-action-bg);
 --ns-tab-active-fg:var(--ns-action-fg);
 --ns-tab-active-hover-bg:var(--ns-action-hover-bg);
 --ns-tab-active-hover-fg:var(--ns-action-hover-fg);
}
/* Exact current tab markup + legacy specificity exclusions. The exclusion
 * list matches portal_theme_r3329.css and r20_ui_acceptance.css. */
html[data-color-mode="monochrom"] :is(
  .portal-subnav > a.is-active,
  .customer-tabs > a.is-active,
  .portal-section-tabs > a.is-active,
  .section-tabs.inventar-tabs > a.is-active,
  .portal-section-tabs.inventar-tabs > a.is-active,
  #ns-integrations-hub .ns-integrations-tab.is-active,
  .editor-tabs .editor-tab.is-active,
  .nav-tabs > a.is-active,
  [role="tab"][aria-selected="true"]
):not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html[data-color-mode="kontrast"] :is(
  .portal-subnav > a.is-active,
  .customer-tabs > a.is-active,
  .portal-section-tabs > a.is-active,
  .section-tabs.inventar-tabs > a.is-active,
  .portal-section-tabs.inventar-tabs > a.is-active,
  #ns-integrations-hub .ns-integrations-tab.is-active,
  .editor-tabs .editor-tab.is-active,
  .nav-tabs > a.is-active,
  [role="tab"][aria-selected="true"]
):not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) {
  background:var(--ns-tab-active-bg) !important;
  background-image:none !important;
  color:var(--ns-tab-active-fg) !important;
  border-color:var(--ns-tab-active-bg) !important;
  text-shadow:none !important;
  opacity:1 !important;
}
html[data-color-mode="monochrom"] :is(
  .portal-subnav > a.is-active,
  .customer-tabs > a.is-active,
  .portal-section-tabs > a.is-active,
  .section-tabs.inventar-tabs > a.is-active,
  .portal-section-tabs.inventar-tabs > a.is-active,
  #ns-integrations-hub .ns-integrations-tab.is-active,
  .editor-tabs .editor-tab.is-active,
  .nav-tabs > a.is-active,
  [role="tab"][aria-selected="true"]
):is(:hover,:focus-visible,:active):not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification),
html[data-color-mode="kontrast"] :is(
  .portal-subnav > a.is-active,
  .customer-tabs > a.is-active,
  .portal-section-tabs > a.is-active,
  .section-tabs.inventar-tabs > a.is-active,
  .portal-section-tabs.inventar-tabs > a.is-active,
  #ns-integrations-hub .ns-integrations-tab.is-active,
  .editor-tabs .editor-tab.is-active,
  .nav-tabs > a.is-active,
  [role="tab"][aria-selected="true"]
):is(:hover,:focus-visible,:active):not(.nav-item):not(.primary-button):not(.secondary-button):not(.brand-link):not(.portal-danger-button):not(.notification) {
  background:var(--ns-tab-active-hover-bg,var(--ns-tab-active-bg)) !important;
  color:var(--ns-tab-active-hover-fg,var(--ns-tab-active-fg)) !important;
  border-color:var(--ns-tab-active-hover-bg,var(--ns-tab-active-bg)) !important;
}
/* Nested text and tab counters must never inherit an old "white on blue"
 * rule when the entire active tab is light. */
html[data-color-mode="monochrom"] :is(
  .portal-subnav > a.is-active,
  .customer-tabs > a.is-active,
  .portal-section-tabs > a.is-active,
  .section-tabs.inventar-tabs > a.is-active,
  .portal-section-tabs.inventar-tabs > a.is-active,
  #ns-integrations-hub .ns-integrations-tab.is-active,
  [role="tab"][aria-selected="true"]
) :is(span,strong,small,em,kbd),
html[data-color-mode="kontrast"] :is(
  .portal-subnav > a.is-active,
  .customer-tabs > a.is-active,
  .portal-section-tabs > a.is-active,
  .section-tabs.inventar-tabs > a.is-active,
  .portal-section-tabs.inventar-tabs > a.is-active,
  #ns-integrations-hub .ns-integrations-tab.is-active,
  [role="tab"][aria-selected="true"]
) :is(span,strong,small,em,kbd) {
  color:inherit !important;
  text-shadow:none !important;
}
/* Use paired foreground/background on every standard primary action state.
 * Semantic alerts and status chips are deliberately not recolored. */
html[data-color-mode="monochrom"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle.is-on,.ns-mail-tls-toggle.is-on
),
html[data-color-mode="kontrast"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle.is-on,.ns-mail-tls-toggle.is-on
) {
  background:var(--ns-action-bg) !important;
  background-image:none !important;
  color:var(--ns-action-fg) !important;
  border-color:var(--ns-action-bg) !important;
  text-shadow:none !important;
  filter:none !important;
  opacity:1 !important;
}
html[data-color-mode="monochrom"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle.is-on,.ns-mail-tls-toggle.is-on
):is(:hover,:focus-visible),
html[data-color-mode="kontrast"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle.is-on,.ns-mail-tls-toggle.is-on
):is(:hover,:focus-visible) {
  background:var(--ns-action-hover-bg) !important;
  color:var(--ns-action-hover-fg) !important;
  border-color:var(--ns-action-hover-bg) !important;
  filter:none !important;
}
html[data-color-mode="monochrom"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle.is-on,.ns-mail-tls-toggle.is-on
):active,
html[data-color-mode="kontrast"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle.is-on,.ns-mail-tls-toggle.is-on
):active {
  background:var(--ns-action-pressed-bg) !important;
  color:var(--ns-action-pressed-fg) !important;
  border-color:var(--ns-action-pressed-bg) !important;
}
/* Secondary default and focus states: no transparent button with inherited
 * white foreground on a light page, and no hidden text inside nested spans. */
html[data-color-mode="monochrom"] :is(
  .secondary-button,.button-secondary,.btn-secondary,.enterprise-reset-button,
  .ns-mail-test-button,.ns-mail-action-secondary,.ns-mail-tls-toggle:not(.is-on),
  .ns-r10-provider-toggle:not(.is-on),.ns-hf4-select-option,
  .portal-section-tabs a:not(.is-active),.section-tabs.inventar-tabs a:not(.is-active)
),
html[data-color-mode="kontrast"] :is(
  .secondary-button,.button-secondary,.btn-secondary,.enterprise-reset-button,
  .ns-mail-test-button,.ns-mail-action-secondary,.ns-mail-tls-toggle:not(.is-on),
  .ns-r10-provider-toggle:not(.is-on),.ns-hf4-select-option,
  .portal-section-tabs a:not(.is-active),.section-tabs.inventar-tabs a:not(.is-active)
) {
  background:var(--ns-action-secondary-bg) !important;
  background-image:none !important;
  color:var(--ns-action-secondary-fg) !important;
  border-color:var(--ns-action-border) !important;
  opacity:1 !important;
  text-shadow:none !important;
}

/* Secondary controls remain legible when their hover fill turns light. */
html[data-color-mode="monochrom"] :is(
  .secondary-button,.button-secondary,.btn-secondary,.enterprise-reset-button,
  .ns-mail-test-button,.ns-mail-action-secondary,.ns-mail-tls-toggle:not(.is-on),
  .ns-r10-provider-toggle:not(.is-on),.ns-hf4-select-option,
  .portal-section-tabs a:not(.is-active),.section-tabs.inventar-tabs a:not(.is-active)
):hover,
html[data-color-mode="kontrast"] :is(
  .secondary-button,.button-secondary,.btn-secondary,.enterprise-reset-button,
  .ns-mail-test-button,.ns-mail-action-secondary,.ns-mail-tls-toggle:not(.is-on),
  .ns-r10-provider-toggle:not(.is-on),.ns-hf4-select-option,
  .portal-section-tabs a:not(.is-active),.section-tabs.inventar-tabs a:not(.is-active)
):hover {
  background:var(--ns-action-secondary-hover-bg) !important;
  color:var(--ns-action-secondary-hover-fg) !important;
  border-color:var(--ns-action-border) !important;
  filter:none !important;
}
/* Disabled actions retain contrast, not low-opacity ghost text. */
html[data-color-mode="monochrom"] :is(
  button,a[role="button"],.primary-button,.secondary-button,.button-primary,.btn-primary,.btn-secondary,
  .portal-create-button,.knowledge-top-button,.ns-mail-test-button,.ns-r10-provider-toggle
):is(:disabled,[disabled],[aria-disabled="true"],.is-disabled),
html[data-color-mode="kontrast"] :is(
  button,a[role="button"],.primary-button,.secondary-button,.button-primary,.btn-primary,.btn-secondary,
  .portal-create-button,.knowledge-top-button,.ns-mail-test-button,.ns-r10-provider-toggle
):is(:disabled,[disabled],[aria-disabled="true"],.is-disabled) {
  background:var(--ns-action-disabled-bg) !important;
  color:var(--ns-action-disabled-fg) !important;
  border-color:var(--ns-action-border) !important;
  opacity:1 !important;
  filter:none !important;
  cursor:not-allowed;
}
/* Nested icons/titles inherit the resolved action foreground in all states. */
html[data-color-mode="monochrom"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle,.ns-mail-tls-toggle,.secondary-button,.button-secondary,.btn-secondary
) :is(span,strong,small,svg,i),
html[data-color-mode="kontrast"] :is(
  button.primary-button,a.primary-button,.button-primary,.btn-primary,.portal-create-button,
  .knowledge-top-button,.portal-standard-button,.global-search-submit,.search-submit,
  .enterprise-filter-button,.enterprise-row-button,.ns-mail-action-primary,
  .ns-r10-provider-toggle,.ns-mail-tls-toggle,.secondary-button,.button-secondary,.btn-secondary
) :is(span,strong,small,svg,i) { color:inherit !important; }

/* NETSTYLE R20/HF10 R10 FIX8 – monochrom Fachmodule acceptance.
   Only monochrom mode; never touches branding or the independent R21 workspace.
   Warning/danger hues remain intentional; blue *surfaces* are forbidden. */
html[data-color-mode="monochrom"] {
  --ns-m8-surface:var(--portal-surface-raised);
  --ns-m8-highlight:var(--portal-surface-muted);
  --ns-m8-ink:var(--portal-text);
  --ns-m8-muted:var(--portal-text-muted);
  --ns-m8-stroke:var(--portal-border);
  --ns-m8-info:var(--portal-surface-muted);
  --ns-m8-link:var(--portal-link);
}

/* Checklist runtime: document/image upload, options, info and linked instructions. */
html[data-color-mode="monochrom"] body :is(
 .runtime-upload-zone,.runtime-upload-block,.runtime-upload-icon,
 .runtime-upload-content,.runtime-upload-status,.runtime-upload-action,
 .runtime-multiselect-option,.runtime-number-unit,.info-box,
 .runtime-knowledge-card,.runtime-knowledge-card-icon,.runtime-knowledge-card-body,
 .runtime-knowledge-card-meta,.runtime-knowledge-summary,
 .runtime-credential-card--r2,.runtime-credential-entry
) {
  background:var(--ns-m8-surface) !important;
  background-image:none !important;
  color:var(--ns-m8-ink) !important;
  border-color:var(--ns-m8-stroke) !important;
  box-shadow:none !important;
  text-shadow:none !important;
}
html[data-color-mode="monochrom"] body :is(
 .runtime-upload-zone,.runtime-multiselect-option,.runtime-knowledge-card,
 .runtime-credential-entry
):is(:hover,:focus-within,.is-dragover) {
  background:var(--ns-m8-highlight) !important;
  border-color:var(--portal-border-strong) !important;
  color:var(--ns-m8-ink) !important;
}
html[data-color-mode="monochrom"] body :is(
 .runtime-upload-zone,.runtime-upload-block,.runtime-knowledge-card,
 .runtime-multiselect-option,.info-box
) :is(span,strong,small,p,em,svg,i,.runtime-upload-action,.runtime-upload-content) {
  color:inherit !important;
  opacity:1 !important;
}
html[data-color-mode="monochrom"] body :is(
 .runtime-upload-zone,.runtime-knowledge-card,.runtime-credential-entry
) a {color:var(--ns-m8-link) !important;text-decoration:underline;}

/* Knowledge-editor upload: neutral in BOTH dropzones, dragover and keyboard focus. */
html[data-color-mode="monochrom"] body :is(
 .knowledge-dropzone,.knowledge-dropzone--image,.knowledge-dropzone--document,
 .knowledge-dropzone-icon,.knowledge-dropzone-copy,.knowledge-new-files,
 .knowledge-existing-files,.knowledge-document-row,.knowledge-existing-image
) {
  background:var(--ns-m8-surface) !important;
  background-image:none !important;
  color:var(--ns-m8-ink) !important;
  border-color:var(--ns-m8-stroke) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] body .knowledge-dropzone:is(:hover,:focus-within,:focus,.is-dragover) {
  background:var(--ns-m8-highlight) !important;
  border-color:var(--portal-border-strong) !important;
}
html[data-color-mode="monochrom"] body .knowledge-dropzone :is(strong,span,small,.knowledge-dropzone-copy) {
  color:var(--ns-m8-ink) !important;
}

/* Checklist builder: fixed blue palette icons and selectable item panels. */
html[data-color-mode="monochrom"] body :is(
 .palette-panel,.palette-item,.palette-icon,.palette-blue,.palette-green,
 .palette-muted,.builder-section,.builder-section-header,.builder-item,
 .builder-item-icon,.builder-item.is-selected,.inspector-info-box,
 .point-structure-info,.editor-template-icon,.inspector-panel,
 .inspector-card,.editor-palette
) {
  background:var(--ns-m8-surface) !important;
  color:var(--ns-m8-ink) !important;
  border-color:var(--ns-m8-stroke) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] body :is(.palette-item,.builder-item):is(:hover,:focus-visible,.is-selected) {
  background:var(--ns-m8-highlight) !important;
  border-color:var(--portal-border-strong) !important;
}
html[data-color-mode="monochrom"] body :is(.palette-item,.builder-item) :is(span,strong,small) {color:inherit !important;}
/* Preserve intentional warnings and danger indicators, never generic brand-blue. */
html[data-color-mode="monochrom"] body :is(
 .checklist-layout-warning,.checklist-layout-warning-icon,.palette-orange,
 .builder-item[data-type="warnung"] .builder-item-icon
) {background:#fff1c6 !important;color:#422a00 !important;border-color:#bd7900 !important;}
html[data-color-mode="monochrom"] body :is(.checklist-layout-warning,.checklist-layout-warning-icon) :is(span,strong,p) {color:#422a00 !important;}
html[data-color-mode="monochrom"] body :is(.palette-red,.badge-danger,.alert-danger) {background:#ffe4e1 !important;color:#700c08 !important;border-color:#b42318 !important;}

/* Customer cockpit: explicit holiday notice = yellow semantic note, not blue. */
html[data-color-mode="monochrom"] body .school-holiday-banner {
  background:#fff0bd !important;color:#302000 !important;
  border:1px solid #af7400 !important;box-shadow:none !important;
}
html[data-color-mode="monochrom"] body .school-holiday-banner :is(strong,a,span) {color:#302000 !important;}

/* Access cockpit: neutral relation cards, secret cards, permission metrics. */
html[data-color-mode="monochrom"] body :is(
 .credential-cockpit-card,.credential-cockpit-secret,.credential-secret-row,
 .credential-status-facts > div,.credential-context-grid > div,
 .credential-technical-grid > div,.credential-relation-grid > div,
 .credential-grant-kpis > div,.credential-access-row,.credential-status-row,
 .credential-secret-panel,.credential-relation-card,.credential-context-card
) {
  background:var(--ns-m8-surface) !important;
  color:var(--ns-m8-ink) !important;
  border-color:var(--ns-m8-stroke) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] body :is(
 .credential-cockpit-card,.credential-status-facts,.credential-context-grid,
 .credential-relation-grid,.credential-grant-kpis,.credential-secret-panel
) :is(span,strong,small,p,h2,h3,label) {color:var(--ns-m8-ink) !important;opacity:1 !important;}
html[data-color-mode="monochrom"] body :is(.credential-relation-grid,.credential-access-row,.credential-secret-panel) a {
  color:var(--ns-m8-link) !important;text-decoration:underline;
}
/* Badges carry permission meaning without blue fill. Preserve true warning/danger semantics. */
html[data-color-mode="monochrom"] body .credential-cockpit-badge:not(.is-warning) {
  background:var(--ns-m8-highlight) !important;color:var(--ns-m8-ink) !important;
  border-color:var(--ns-m8-stroke) !important;
}

/* Sidebar: neutral mouseover and focus, no late blue hover rules. */
html[data-color-mode="monochrom"] body .sidebar .navigation .nav-item:is(:hover,:focus-visible) {
  background:#3b3b3b !important;color:#fff !important;
  border-color:#666 !important;text-shadow:none !important;
}
html[data-color-mode="monochrom"] body .sidebar .navigation .nav-item:is(:hover,:focus-visible) :is(span,.nav-icon) {
  color:#fff !important;
}
html[data-color-mode="monochrom"] body .sidebar .navigation .nav-item[aria-current="page"] {
  background:#ededed !important;color:#121212 !important;
}
html[data-color-mode="monochrom"] body .sidebar .navigation .nav-item[aria-current="page"] span {color:inherit !important;}
/* Older HF6 dark selectors carry extra specificity; mode-specific final guard. */
html[data-color-mode="monochrom"][data-theme-mode="dark"] body :is(
 .runtime-upload-zone,.runtime-upload-block,.runtime-multiselect-option,
 .knowledge-dropzone,.palette-item,.palette-icon,.info-box,
 .runtime-knowledge-card,.runtime-knowledge-card-icon
) {
 background:var(--ns-m8-surface) !important;
 background-image:none !important;color:var(--ns-m8-ink) !important;
 border-color:var(--ns-m8-stroke) !important;
}
html[data-color-mode="monochrom"][data-theme-mode="dark"] body :is(
 .runtime-upload-zone,.runtime-multiselect-option,.knowledge-dropzone,.palette-item
):is(:hover,:focus-within,.is-dragover) {
 background:var(--ns-m8-highlight) !important;
 border-color:var(--portal-border-strong) !important;
}


/* NETSTYLE R10 FIX9 – Credential relation tiles in monochrome.
   The real template renders linked tiles as <a>, not <div>; earlier FIX8
   matched only .credential-relation-grid > div and therefore missed them. */
html[data-color-mode="monochrom"] body .credential-relation-grid > .credential-relation-tile,
html[data-color-mode="monochrom"] body .credential-relation-grid > a.credential-relation-tile.is-linked {
  background:var(--ns-m8-surface) !important;
  background-image:none !important;
  color:var(--ns-m8-ink) !important;
  border:1px solid var(--ns-m8-stroke) !important;
  box-shadow:none !important;
  text-shadow:none !important;
}
html[data-color-mode="monochrom"] body .credential-relation-grid > a.credential-relation-tile.is-linked:is(:hover,:focus-visible,:active) {
  background:var(--ns-m8-highlight) !important;
  background-image:none !important;
  color:var(--ns-m8-ink) !important;
  border-color:var(--portal-border-strong) !important;
  box-shadow:none !important;
}
html[data-color-mode="monochrom"] body .credential-relation-grid > a.credential-relation-tile.is-linked:focus-visible {
  outline:2px solid var(--ns-m8-ink) !important;
  outline-offset:2px;
}
html[data-color-mode="monochrom"] body .credential-relation-grid > .credential-relation-tile :is(span,strong,small) {
  color:var(--ns-m8-ink) !important;
  opacity:1 !important;
}
html[data-color-mode="monochrom"] body .credential-relation-grid > a.credential-relation-tile.is-linked small {
  text-decoration:underline !important;
  text-underline-offset:2px;
}


/* NETSTYLE R20 HF10 R10 FIX10 – Monochrom controls and hover audit.
 * All rules restricted to monochrom; semantic warning/danger colors are preserved.
 * Preserve native input, checkbox interaction, accessible focus and upload behavior.
 */
html[data-color-mode="monochrom"] {
 --ns-f10-switch-off:var(--portal-surface-muted);
 --ns-f10-switch-on:var(--portal-button-primary-bg);
 --ns-f10-switch-knob:var(--portal-button-primary-text);
 --ns-f10-hover:var(--portal-surface-muted);
 --ns-f10-hover-text:var(--portal-text);
}
/* Completion switches: checked and unchecked in black/white, never brand blue. */
html[data-color-mode="monochrom"] body .completed-control .completed-control-switch {
 background:var(--ns-f10-switch-off) !important;
 border:1px solid var(--portal-border-strong) !important;
 box-shadow:none !important;
}
html[data-color-mode="monochrom"] body .completed-control input[type="checkbox"]:checked + .completed-control-switch {
 background:var(--ns-f10-switch-on) !important;
 border-color:var(--portal-border-strong) !important;
}
html[data-color-mode="monochrom"] body .completed-control .completed-control-switch::after {
 background:var(--portal-text) !important;
 box-shadow:none !important;
}
html[data-color-mode="monochrom"] body .completed-control input[type="checkbox"]:checked + .completed-control-switch::after {
 background:var(--ns-f10-switch-knob) !important;
}
html[data-color-mode="monochrom"] body .completed-control input[type="checkbox"]:focus-visible + .completed-control-switch {
 outline:2px solid var(--portal-text) !important;
 outline-offset:3px !important;
 box-shadow:none !important;
}
html[data-color-mode="monochrom"] body .completed-control:is(:hover,:focus-within) .completed-control-text {
 color:var(--portal-text) !important;
}
html[data-color-mode="monochrom"] body .completed-control--readonly .completed-control-switch {
 opacity:0.75;
}
/* Form toggles elsewhere: preserve status semantics, but remove purely brand-blue fill. */
html[data-color-mode="monochrom"] body .hf10-customer-active-toggle input[type="checkbox"]:checked {
 background:var(--portal-button-primary-bg) !important;
 border-color:var(--portal-border-strong) !important;
}
html[data-color-mode="monochrom"] body .hf10-customer-active-toggle input[type="checkbox"]:focus-visible {
 outline:2px solid var(--portal-text) !important;
 outline-offset:3px !important;
}
/* Profile and generic uploads (the old code has hard-coded #176fd1 and #e6f0fc). */
html[data-color-mode="monochrom"] body :is(.profile-upload-dropzone,.portal-dropzone,.portal-dropzone--builder) {
 background:var(--portal-surface-raised) !important;
 background-image:none !important;
 border-color:var(--portal-border) !important;
 color:var(--portal-text) !important;
 box-shadow:none !important;
}
html[data-color-mode="monochrom"] body :is(.profile-upload-dropzone,.portal-dropzone,.portal-dropzone--builder):is(:hover,:focus-visible,:focus-within,.is-dragover) {
 background:var(--portal-surface-muted) !important;
 border-color:var(--portal-border-strong) !important;
 color:var(--portal-text) !important;
 box-shadow:none !important;
}
html[data-color-mode="monochrom"] body :is(.profile-upload-dropzone-icon,.portal-dropzone-icon,.portal-dropzone--builder .portal-dropzone-icon) {
 background:var(--portal-surface-muted) !important;
 border-color:var(--portal-border) !important;
 color:var(--portal-text) !important;
}
html[data-color-mode="monochrom"] body :is(.profile-upload-dropzone-text,.profile-upload-dropzone-text strong,.profile-upload-dropzone-text span,.profile-upload-dropzone-text small,.portal-dropzone-title,.portal-dropzone-copy,.portal-dropzone-file) {
 color:var(--portal-text) !important;
 opacity:1 !important;
}
/* Full inventory section: not only tabs, but surrounding strip and inactive hover. */
html[data-color-mode="monochrom"] body :is(.portal-section-tabs,.section-tabs.inventar-tabs,.portal-section-tabs.inventar-tabs) {
 background:var(--portal-surface-muted) !important;
 border-color:var(--portal-border) !important;
 background-image:none !important;
}
html[data-color-mode="monochrom"] body :is(.portal-section-tabs,.section-tabs.inventar-tabs,.portal-section-tabs.inventar-tabs) a:not(.is-active) {
 background:var(--portal-surface-raised) !important;
 color:var(--portal-text) !important;
 border-color:var(--portal-border) !important;
}
html[data-color-mode="monochrom"] body :is(.portal-section-tabs,.section-tabs.inventar-tabs,.portal-section-tabs.inventar-tabs) a:not(.is-active):is(:hover,:focus-visible,:active) {
 background:var(--portal-surface-muted) !important;
 color:var(--portal-text) !important;
 border-color:var(--portal-border-strong) !important;
}
/* Checklist rows must not become blue or blue-white on hover. Exclude true warnings. */
html[data-color-mode="monochrom"] body :is(.checklist-item,.runtime-checkbox,.runtime-multiselect-option,.point-toggle-card,.portal-list-row):not(.checklist-item--warnung):is(:hover,:focus-within) {
 background:var(--portal-surface-muted) !important;
 color:var(--portal-text) !important;
 border-color:var(--portal-border) !important;
 background-image:none !important;
}
html[data-color-mode="monochrom"] body :is(.checklist-item,.runtime-checkbox,.runtime-multiselect-option,.point-toggle-card,.portal-list-row):is(:hover,:focus-within) :is(.checklist-label strong,.completed-control-text,.runtime-checkbox-label) {
 color:var(--portal-text) !important;
}
/* Neutral standalone icon/chip links in the form fields; real warnings remain untouched. */
html[data-color-mode="monochrom"] body :is(.search-hero-icon,.result-count,.mini-badge,.customer-autocomplete-option):not(.is-warning):not(.is-danger) {
 background:var(--portal-surface-muted) !important;
 color:var(--portal-text) !important;
 border-color:var(--portal-border) !important;
}
html[data-color-mode="monochrom"] body .customer-autocomplete-option:is(:hover,.is-active) {
 background:var(--portal-surface-muted) !important;
 color:var(--portal-text) !important;
}

/* NETSTYLE Technikportal UI-Abschluss 2026-10-26.
   Only uses the existing data-theme-mode / data-color-mode contract.
   No change to company-palette persistence, light/dark switch or rights. */
.portal-confirm-backdrop .portal-confirm-dialog {
  background:var(--portal-surface,#fff) !important;
  color:var(--portal-text,#111827) !important;
  border:1px solid var(--portal-border,#cbd5e1) !important;
  box-shadow:var(--portal-shadow,0 24px 50px #0004) !important;
  max-height:min(90vh,720px);overflow-y:auto;
}
.portal-confirm-backdrop .portal-confirm-content h2 {color:var(--portal-heading,var(--portal-text)) !important;}
.portal-confirm-backdrop .portal-confirm-content p {color:var(--portal-text-muted,var(--portal-text)) !important;}
.portal-confirm-backdrop .portal-confirm-symbol {
  color:var(--portal-text) !important;
  background:var(--portal-surface-muted) !important;
  border:1px solid var(--portal-border) !important;
}
.portal-confirm-backdrop .ns-final-confirm-required[hidden] {display:none !important;}
.portal-confirm-backdrop .ns-final-confirm-required {margin-top:14px;max-width:100%;}
.portal-confirm-backdrop .ns-final-confirm-label {display:block;margin-bottom:6px;font-weight:650;color:var(--portal-text) !important;}
.portal-confirm-backdrop .ns-final-confirm-input {
  display:block;width:100%;min-width:0;box-sizing:border-box;
  background:var(--portal-surface-raised,var(--portal-surface)) !important;
  border:2px solid var(--portal-border-strong,var(--portal-border)) !important;
  color:var(--portal-text) !important;border-radius:7px;padding:9px 10px;font:inherit;
}
.portal-confirm-backdrop .ns-final-confirm-input:focus-visible,
.portal-confirm-backdrop :is(button,input):focus-visible {
  outline:3px solid var(--portal-focus,#1769d2) !important;outline-offset:2px !important;
}
.portal-confirm-backdrop .portal-confirm-actions {display:flex;flex-direction:row !important;flex-wrap:nowrap !important;overflow-x:auto;align-items:center;justify-content:flex-end;}
.portal-confirm-backdrop .portal-confirm-actions > button {white-space:nowrap;min-width:max-content;}
.portal-confirm-backdrop .portal-confirm-actions .secondary-button {
  background:var(--portal-surface-raised,var(--portal-surface)) !important;
  color:var(--portal-text) !important;border-color:var(--portal-border-strong,var(--portal-border)) !important;
}
.portal-confirm-backdrop .portal-confirm-actions .portal-danger-button {
  background:#b42318 !important;color:#fff !important;border-color:#b42318 !important;
}
.portal-confirm-backdrop .portal-confirm-actions .portal-danger-button:hover {background:#912018 !important;border-color:#912018 !important;}
.portal-confirm-backdrop .portal-confirm-actions .portal-danger-button:disabled {opacity:.45 !important;cursor:not-allowed !important;}
html[data-color-mode="monochrom"] .portal-confirm-backdrop .portal-confirm-actions .portal-danger-button {
  background:var(--portal-button-primary-bg) !important;color:var(--portal-button-primary-text) !important;border-color:var(--portal-border-strong) !important;
}
html[data-color-mode="monochrom"] .portal-confirm-backdrop .portal-confirm-actions .portal-danger-button:hover {
  background:var(--portal-button-primary-hover) !important;
}
html[data-color-mode="kontrast"] .portal-confirm-backdrop .portal-confirm-actions .portal-danger-button {
  background:var(--portal-button-primary-bg) !important;color:var(--portal-button-primary-text) !important;border:2px solid var(--portal-border-strong) !important;
}
/* The theme context defines these modes; the final layer enforces the same
   foreground/background pair for structural surfaces and action tables. */
html[data-color-mode="monochrom"] :is(.topbar,.sidebar,.panel,.portal-card,.user-menu-dropdown,.portal-subnav,.table-wrapper),
html[data-color-mode="kontrast"] :is(.topbar,.panel,.portal-card,.user-menu-dropdown,.portal-subnav,.table-wrapper) {
  background:var(--portal-surface) !important;color:var(--portal-text) !important;
  border-color:var(--portal-border) !important;
}
html[data-color-mode="monochrom"] .sidebar {background:var(--portal-sidebar) !important;color:var(--portal-sidebar-text) !important;}
html[data-color-mode="monochrom"] .sidebar :is(.nav-item,.brand,.sidebar-footer),
html[data-color-mode="kontrast"] .sidebar :is(.nav-item,.brand,.sidebar-footer) {color:var(--portal-sidebar-text) !important;}
html[data-color-mode="monochrom"] :is(.workorder-table,.enterprise-actions-table,.data-table) :is(thead,tr,td,th),
html[data-color-mode="kontrast"] :is(.workorder-table,.enterprise-actions-table,.data-table) :is(thead,tr,td,th) {
  color:var(--portal-text) !important;border-color:var(--portal-border) !important;
}
html[data-color-mode="monochrom"] :is(.workorder-table,.enterprise-actions-table,.data-table) tr:hover :is(td,th),
html[data-color-mode="kontrast"] :is(.workorder-table,.enterprise-actions-table,.data-table) tr:hover :is(td,th) {
  background:var(--portal-surface-muted) !important;color:var(--portal-text) !important;
}
/* Monochrome must be chromatically neutral; status communicates using text. */
html[data-color-mode="monochrom"] :is(.hf10-danger-button,.portal-danger-button):not(.portal-confirm-actions .portal-danger-button) {
  background:var(--portal-button-primary-bg) !important;color:var(--portal-button-primary-text) !important;border-color:var(--portal-border-strong) !important;
}
/* High contrast retains explicit action semantics, with accessible focus. */
html[data-color-mode="kontrast"] :is(.hf10-danger-button,.portal-danger-button):not(.portal-confirm-actions .portal-danger-button) {
  background:#9c1c16 !important;color:#fff !important;border:2px solid #fff !important;
}
html[data-color-mode="kontrast"] :is(.topbar,.panel,.portal-card) :is(a,button,input,select,textarea):focus-visible,
html[data-color-mode="monochrom"] :is(.topbar,.panel,.portal-card) :is(a,button,input,select,textarea):focus-visible {
  outline:3px solid var(--portal-focus) !important;outline-offset:2px !important;
}
html[data-color-mode="kontrast"] .portal-subnav > a.is-active,
html[data-color-mode="monochrom"] .portal-subnav > a.is-active {
  background:var(--ns-tab-active-bg,var(--portal-nav-active-bg)) !important;
  color:var(--ns-tab-active-fg,var(--portal-nav-active-text)) !important;
}
/* Do not alter corporate (unternehmen) palette, nor disable browser focus. */
@media (prefers-color-scheme:dark) {
  html[data-theme-mode="system"][data-color-mode="monochrom"] .sidebar {background:var(--portal-sidebar) !important;}
}
@media(max-width:500px){.portal-confirm-backdrop{padding:10px;}.portal-confirm-dialog{width:100% !important;}}

/* NETSTYLE FIX11 design transfer – scoped to the main portal; theme tokens are authoritative. */
.nsrb-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}
.nsrb-toolbar,.nsrb-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;overflow-x:auto;max-width:100%}
.nsrb-toolbar>* ,.nsrb-actions>* {flex:0 0 auto;white-space:nowrap}
.nsrb-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin:16px 0}
.nsrb-card{min-width:0;padding:18px!important}
.nsrb-card h2,.nsrb-panel-heading h2{margin:0 0 10px;font-size:1.12rem;color:var(--portal-heading,var(--portal-text,#13263f))}
.nsrb-card p{margin:0 0 16px;color:var(--portal-text-muted,var(--portal-text,#334155));line-height:1.5}
.nsrb-assign-form{display:flex;gap:9px;align-items:end;flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:2px}
.nsrb-assign-form label,.nsrb-rights-toolbar label{display:flex;flex:1 1 130px;min-width:130px;flex-direction:column;gap:5px;font-weight:600;color:var(--portal-text,#172a48);font-size:.85rem}
.nsrb-assign-form select,.nsrb-rights-toolbar select,.nsrb-rights-toolbar input{box-sizing:border-box;width:100%;min-height:39px;padding:7px 8px;border:1px solid var(--portal-border,#bac9dc);border-radius:6px;color:var(--portal-text,#172a48);background:var(--portal-surface,#fff);font:inherit}
.nsrb-assign-form button{min-height:39px}
.nsrb-main-panel{padding:16px!important;margin-top:14px}
.nsrb-panel-heading,.nsrb-rights-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.nsrb-muted{color:var(--portal-text-muted,var(--portal-text,#52647e));font-size:.83rem}
.nsrb-table-scroll,.nsrb-rights-scroll{max-width:100%;overflow-x:auto}
.nsrb-table{width:100%;min-width:780px;border-collapse:collapse}
.nsrb-table th:last-child,.nsrb-table td:last-child{text-align:right}
.nsrb-table td{vertical-align:middle}
.nsrb-identity{display:flex;gap:9px;align-items:center;min-width:200px}
.nsrb-identity span{display:flex;flex-direction:column;gap:3px;min-width:0}
.nsrb-identity small{font-size:.79rem;color:var(--portal-text-muted,var(--portal-text,#52647e))}
.nsrb-actions-end{justify-content:flex-end}
.nsrb-type{display:inline-flex;padding:3px 8px;border-radius:10px;border:1px solid var(--portal-border,#bcc9d8);font-size:.78rem;color:var(--portal-text,#172a48)}
.nsrb-notice{margin:14px 0;padding:13px 15px;border:2px solid var(--portal-focus,#1268c4);border-radius:9px;background:var(--portal-surface,#fff);color:var(--portal-text,#172a48);line-height:1.5}
.nsrb-rights-toolbar{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin-bottom:12px}
.nsrb-rights-toolbar label{flex:1 1 230px}
.nsrb-rights-toolbar .nsrb-actions{padding-bottom:2px}
.nsrb-rights-meta{font-size:.8rem;color:var(--portal-text-muted,var(--portal-text,#52647e))}
.nsrb-rights-table{border-collapse:collapse;min-width:1250px;width:100%;font-size:.85rem;color:var(--portal-text,#172a48)}
.nsrb-rights-table th,.nsrb-rights-table td{border-bottom:1px solid var(--portal-border,#c9d4e2);padding:7px 8px;text-align:left;vertical-align:middle}
.nsrb-rights-table thead{background:var(--portal-surface-muted,#ecf1f8);position:sticky;top:0;z-index:1}
.nsrb-rights-table thead th{font-weight:750}
.nsrb-rights-table thead th:first-child{min-width:320px;width:34%}
.nsrb-rights-table .nsrb-group-row th{background:var(--portal-surface-muted,#e5edf6);font-size:.82rem;color:var(--portal-text,#172a48);padding:11px 9px}
.nsrb-rights-table tr.nsrb-detail-row{background:var(--portal-surface,#fff)}
.nsrb-tree-toggle{display:inline-flex;align-items:center;gap:10px;padding:6px 3px;border:0;background:none;color:var(--portal-text,#172a48);font-weight:700;cursor:pointer;text-align:left;font:inherit}
.nsrb-tree-toggle::before{content:'▸';display:inline-block;transition:transform .15s ease}
.nsrb-tree-toggle[aria-expanded=true]::before{transform:rotate(90deg)}
.nsrb-detail-indent{display:inline-block;color:var(--portal-text-muted,var(--portal-text,#52647e));padding:0 9px}
.nsrb-count-mini{font-size:.68rem;font-weight:500;opacity:.76}
.nsrb-rights-cell{min-width:166px}
.nsrb-rights-cell select{display:block;min-width:0;width:100%;margin:2px 0;min-height:30px;background:var(--portal-surface,#fff);color:var(--portal-text,#172a48);border:1px solid var(--portal-border,#bdc9dd);border-radius:5px;padding:4px 5px}
.nsrb-rights-cell .nsrb-scope-choice{font-size:.75rem;opacity:.88}
.nsrb-rights-cell[data-decision=deny]{box-shadow:inset 3px 0 #b42318}
.nsrb-rights-cell[data-decision=allow]{box-shadow:inset 3px 0 var(--portal-focus,#1568c7)}
.nsrb-savebar{position:sticky;bottom:0;z-index:2;background:var(--portal-surface,#fff);border-top:2px solid var(--portal-border,#bdc9dd);display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 4px;color:var(--portal-text,#172a48);font-size:.8rem}
.nsrb-rights-table :is(button,select):focus-visible,.nsrb-main-panel :is(a,button,select,input):focus-visible{outline:3px solid var(--portal-focus,#1769d2)!important;outline-offset:2px}
.nsrb-rights-table tr[hidden]{display:none!important}
html[data-color-mode=monochrom] .nsrb-rights-cell[data-decision=deny],html[data-color-mode=kontrast] .nsrb-rights-cell[data-decision=deny]{box-shadow:inset 3px 0 var(--portal-text,#fff)}
html[data-color-mode=monochrom] :is(.nsrb-notice,.nsrb-rights-table,.nsrb-savebar,.nsrb-main-panel),html[data-color-mode=kontrast] :is(.nsrb-notice,.nsrb-rights-table,.nsrb-savebar,.nsrb-main-panel){background:var(--portal-surface)!important;color:var(--portal-text)!important;border-color:var(--portal-border)!important}
@media(max-width:920px){.nsrb-card-grid{grid-template-columns:1fr}.nsrb-heading{align-items:start}}
@media(max-width:520px){.nsrb-main-panel{padding:10px!important}.nsrb-assign-form{overflow-x:auto}.nsrb-heading .nsrb-toolbar{width:100%}}
@media(prefers-reduced-motion:reduce){.nsrb-tree-toggle::before{transition:none}}

/* Only scoped add-ons; central NETSTYLE theme remains authoritative. */
.nsrb-activate{display:flex;align-items:center;gap:8px;font-weight:600;min-width:230px}
.nsrb-activate input{width:18px;height:18px}
.nsrb-role-form{display:flex;gap:10px;flex-wrap:wrap;align-items:end}
.nsrb-role-form label{display:flex;flex-direction:column;flex:1 1 170px;gap:5px;font-weight:600;color:var(--portal-text,#172a48)}
.nsrb-role-form select,.nsrb-role-form input{background:var(--portal-surface,#fff);color:var(--portal-text,#172a48);border:1px solid var(--portal-border,#bac9dc);border-radius:6px;padding:8px;width:100%;box-sizing:border-box}
.nsrb-role-form button{flex:0 0 auto}
.nsrb-table .hf10-inline-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:6px;white-space:nowrap;overflow-x:auto}
.nsrb-table td.nsrb-all-actions{min-width:340px}
.nsrb-table .hf10-inline-actions > *{flex:0 0 auto}
.nsrb-savebar{flex-wrap:nowrap;overflow-x:auto}
.nsrb-savebar span{flex:0 1 auto;min-width:160px}
@media(max-width:1000px){.nsrb-savebar{flex-wrap:wrap}}
