:root {
    color-scheme: dark;
    --bg: #14191d;
    --surface: #20272c;
    --surface-2: #273139;
    --border: #39454c;
    --text: #eef1f3;
    --muted: #9baab3;
    --brand: #8c4444;
    --brand-hover: #a45454;
    --danger: #b83d3d;
    --success: #2d7e52;
    --warning: #9b6b24;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 system-ui, -apple-system, Segoe UI, sans-serif;
}
a { color: #e9a0a0; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 28px;
    background: var(--brand);
    box-shadow: 0 2px 10px #0006;
}
.topbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 19px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.topbar .brand:hover { text-decoration: none; }
.topbar .brand img {
    display: block;
    width: 128px;
    height: auto;
    max-height: 34px;
    object-fit: contain;
}
.topbar nav { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar nav a { color: white; font-weight: 600; }
.container { width: min(1200px, calc(100% - 32px)); margin: 30px auto 60px; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: 0 4px 16px #0003;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 850px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; padding: 14px 20px; gap: 10px; }
}
label { display: block; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #111619;
    color: var(--text);
    padding: 10px 11px;
    font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
button, .button, .button-secondary, .button-danger, .button-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    padding: 10px 15px;
    background: var(--brand);
    color: white;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}
button:hover, .button:hover { background: var(--brand-hover); text-decoration: none; }
.button-secondary { background: var(--surface-2); border: 1px solid var(--border); }
.button-danger { background: var(--danger); }
.button-success { background: var(--success); }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.text-right { text-align: right; }
.muted { color: var(--muted); }
.big-number { font-size: 28px; font-weight: 800; margin-top: 4px; }
.flash { padding: 12px 15px; border-radius: 7px; margin-bottom: 18px; }
.flash-success { background: #173b2a; border: 1px solid #2d7e52; }
.flash-error { background: #471d1d; border: 1px solid #a64949; }
.position-row {
    background: #171d21;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 14px;
}
.position-grid {
    display: grid;
    grid-template-columns: 90px minmax(240px, 1fr) 150px 150px 42px;
    gap: 12px;
    align-items: end;
}
@media (max-width: 900px) {
    .position-grid { grid-template-columns: 1fr; }
}
.position-description { margin-top: 12px; }
.item-title-input { font-weight: 800; }
.total-preview { font-size: 20px; font-weight: 800; text-align: right; margin-top: 16px; }
.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 12px;
}
.status-paid { background: #1f5d3d; }
.status-canceled { background: #652828; }
.status-draft { background: #565c61; }
h1 { margin-top: 0; }
small { color: var(--muted); }

.user-menu {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
    color: #fff;
    font-weight: 650;
}
.user-menu form { margin: 0; }
.compact-button { min-height: 34px; padding: 7px 10px; }
.icon-button{width:36px;min-width:36px;height:36px;min-height:36px;padding:0;font-size:15px}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.container-login { width: min(460px, calc(100% - 32px)); margin-top: 10vh; }
.login-shell { min-height: 65vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; text-align: center; }
.login-card form, .login-card .flash { text-align: left; }
.login-logo {
    display: block;
    width: min(300px, 82%);
    height: auto;
    margin: 2px auto 24px;
}
.login-card h1 { margin-bottom: 4px; }
.login-card .muted { margin-top: 0; margin-bottom: 24px; }
code { background: #0e1214; border: 1px solid var(--border); border-radius: 4px; padding: 2px 5px; }
@media (max-width: 850px) {
    .user-menu { margin-left: 0; width: 100%; justify-content: space-between; }
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.page-heading h1 { margin-bottom: 4px; }
.page-heading p { margin: 0; }
.table-scroll { overflow-x: auto; }
.form-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-fieldset[disabled] { opacity: .82; }
.letter-editor { min-height: 320px; line-height: 1.55; }
.notice-box {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--warning);
    border-radius: 7px;
    background: #3a2a16;
    color: #f3dfbd;
}
.status-finalized { background: #344b63; }
.status-sent { background: #34583f; }
.status-archived { background: #50446a; }
@media (max-width: 850px) {
    .page-heading { flex-direction: column; }
}


/* BusinessOffice 2026-07-26j */
.admin-tile { color: var(--text); text-decoration:none; }
.admin-tile:hover { border-color: var(--brand-hover); text-decoration:none; }
details { margin-top:16px; border-top:1px solid var(--border); padding-top:12px; }
summary { cursor:pointer; font-weight:750; color:#efc0c0; margin-bottom:14px; }
.timeline { display:flex; flex-direction:column; gap:0; }
.timeline-item { display:grid; grid-template-columns:145px 1fr; gap:16px; padding:14px 0; border-bottom:1px solid var(--border); }
.timeline-item time { color:var(--muted); font-size:13px; }
.search-row { display:grid; grid-template-columns:1fr auto; gap:10px; }
.search-results { display:flex; flex-direction:column; }
.search-result { display:grid; grid-template-columns:120px 220px 1fr 120px; gap:12px; align-items:center; padding:13px 8px; border-bottom:1px solid var(--border); color:var(--text); }
.search-result:hover { background:var(--surface-2); text-decoration:none; }
@media(max-width:850px){.timeline-item{grid-template-columns:1fr}.search-result{grid-template-columns:1fr}.search-row{grid-template-columns:1fr}}

.dispatch-card{border:1px solid var(--border);border-radius:8px;background:#171d21;padding:15px;margin:12px 0}.dispatch-card form{padding-top:10px;border-top:1px solid var(--border)}
.form-actions{margin-top:18px}.autosave-status{margin-bottom:10px}
.autosave-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.autosave-toolbar .autosave-status{margin:0}
.checkbox-list{display:grid;gap:8px;max-height:320px;overflow:auto;padding:10px;border:1px solid var(--border);border-radius:7px;background:#171d21}.checkbox-list label{display:flex;align-items:center;gap:8px;margin:0;color:var(--text)}.checkbox-list input{width:auto}
.expense-create{padding-top:14px}.expense-create>summary{margin:0}.expense-create[open]>summary{margin-bottom:18px}
.attachment-settings{display:grid;grid-template-columns:1fr 90px;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--border)}
.badge-green{background:#7ee2a8;color:#14191d}.badge-yellow{background:#f1d56b;color:#14191d}.badge-orange{background:#f2aa65;color:#14191d}.badge-red{background:#ef8d8d;color:#14191d}
.pdf-overlay{position:fixed;inset:0;background:#000b;z-index:9999;padding:3vh 3vw}.pdf-overlay-panel{height:94vh;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:10px}.pdf-overlay iframe{width:100%;height:100%;border:0;background:white}.pdf-overlay-close{align-self:flex-end}
.case-color{display:inline-block;width:5px;height:32px;border-radius:3px;vertical-align:middle;margin-right:9px;background:#59636b}
.case-view .card table tbody tr:last-child > td{border-bottom:0}
.case-view .timeline .timeline-item:last-child{border-bottom:0}
.case-color-blue{background:#63a8f0}.case-color-purple{background:#b487e8}.case-color-red{background:#ef767a}.case-color-orange{background:#efa45f}.case-color-gray{background:#9aa2a8}.case-color-green{background:#6fcf91}
details form>button{margin-top:16px}

/* BusinessOffice – zentraler Seitenabschluss */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container {
    flex: 1 0 auto;
    width: 100%;
}

.app-footer {
    flex-shrink: 0;
    width: 100%;
    padding: 22px 20px 18px;
    text-align: center;
    color: var(--muted, #9eb0bd);
}

.app-footer small {
    line-height: 1.6;
}

.app-footer a,
.app-footer a:visited {
    color: #67d9ef;
    text-decoration: none;
}

.app-footer a:hover,
.app-footer a:active {
    color: #bd85f5;
    text-decoration: underline;
}

/* BusinessOffice – Seitenleiste und neues Branding */
:root {
    --sidebar-width: 268px;
    --navigation-bg: #683434;
    --navigation-bg-deep: #4d2525;
    --navigation-hover: #7b4141;
    --navigation-border: #a56565;
}

body.with-sidebar {
    min-height: 100vh;
    display: block;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    min-height: 100vh;
    color: #fff;
    background:
        linear-gradient(
            180deg,
            var(--navigation-bg) 0%,
            var(--navigation-bg-deep) 100%
        );
    border-right: 1px solid #0008;
    box-shadow: 4px 0 18px #0005;
}

.sidebar-header {
    flex: 0 0 auto;
    padding: 20px 18px 18px;
    border-bottom: 1px solid #ffffff24;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand:hover {
    text-decoration: none;
}

.sidebar-brand-mark {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding-top: 8px;
    flex: 0 0 52px;
    overflow: hidden;
    border: 1px solid var(--navigation-border);
    border-radius: 14px;
    background: #3f1e1e;
    box-shadow:
        inset 0 0 0 2px #ffffff0e,
        0 3px 8px #0005;
    line-height: 1;
}

.sidebar-brand-mark strong {
    font-size: 27px;
    font-weight: 850;
}

.sidebar-brand-mark em {
    margin-left: -2px;
    color: #f0d2d2;
    font-size: 25px;
    font-weight: 650;
}

.sidebar-brand-name {
    font-size: 21px;
    line-height: 1;
    white-space: nowrap;
}

.sidebar-brand-name strong {
    font-weight: 850;
}

.sidebar-brand-name em {
    color: #f0d2d2;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 10px 20px;
    scrollbar-width: thin;
    scrollbar-color: #ffffff45 transparent;
}

.sidebar-group {
    margin-bottom: 12px;
}

.sidebar-group-title {
    padding: 10px 12px 6px;
    color: #efcccc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    margin: 2px 0;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    font-weight: 650;
    text-decoration: none;
}

.sidebar-nav a i {
    width: 20px;
    flex: 0 0 20px;
    color: #f1d6d6;
    text-align: center;
}

.sidebar-nav a:hover {
    background: var(--navigation-hover);
    border-color: #ffffff18;
    text-decoration: none;
}

.sidebar-nav a.is-active {
    color: #fff;
    background: #ffffff1f;
    border-color: #ffffff30;
    box-shadow: inset 4px 0 0 #f0b3b3;
}

.sidebar-footer {
    flex: 0 0 auto;
    padding: 12px 14px 14px;
    background: #0002;
    border-top: 1px solid #ffffff24;
}

.sidebar-account {
    padding-bottom: 13px;
    margin-bottom: 13px;
    border-bottom: 1px solid #ffffff24;
}

.sidebar-username {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 700;
}

.sidebar-account form {
    margin: 0;
}

.sidebar-logout {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    color: #fff;
    background: #20272caa;
    border-color: #ffffff2b;
}

.sidebar-logout:hover {
    background: #20272c;
}

.sidebar-meta {
    color: #e8cdcd;
    line-height: 1.45;
}

.sidebar-version {
    margin-bottom: 5px;
    color: #fff;
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
}

.sidebar-version strong {
    font-weight: 850;
}

.sidebar-version em {
    color: #f0d2d2;
    font-weight: 600;
}

.sidebar-legal {
    font-size: 11px;
    line-height: 1.45;
}

.sidebar-legal a,
.sidebar-legal a:visited {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-legal a:hover {
    text-decoration: underline;
}

.with-sidebar .app-content {
    width: calc(100% - var(--sidebar-width));
    max-width: none;
    min-height: 100vh;
    margin: 0 0 0 var(--sidebar-width);
    padding: 30px 28px 60px;
}

.mobile-menu-button {
    display: none;
}

.sidebar-backdrop[hidden] {
    display: none;
}

.login-footer {
    padding-top: 14px;
}

.login-footer strong {
    color: var(--text);
}

.login-footer em {
    color: #dbaaaa;
    font-weight: 600;
}

@media (max-width: 1279px) {
    .app-sidebar {
        width: min(286px, calc(100vw - 48px));
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .mobile-menu-button {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1400;
        display: inline-flex;
        min-height: 42px;
        padding: 9px 13px;
        background: var(--navigation-bg);
        border: 1px solid #ffffff24;
        box-shadow: 0 3px 12px #0007;
    }

    .sidebar-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 1100;
        display: block;
        background: #000a;
        backdrop-filter: blur(2px);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .with-sidebar .app-content {
        width: 100%;
        margin: 0;
        padding: 76px 16px 48px;
    }
}

@media (max-width: 520px) {
    .sidebar-header {
        padding-top: 16px;
    }

    .with-sidebar .app-content {
        padding-right: 12px;
        padding-left: 12px;
    }
}

/* BusinessOffice – produktiver Altbeleg-Prüfmodus */
.page-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.document-status-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.document-status-overview-compact {
    max-width: 720px;
}

.document-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 14px 16px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: 0 3px 12px #0002;
    text-decoration: none;
}

.document-status-card:hover {
    border-color: var(--brand-hover);
    background: var(--surface-2);
    text-decoration: none;
}

.document-status-card.is-selected {
    border-color: #e0a1a1;
    box-shadow: inset 4px 0 0 #e0a1a1;
}

.document-status-open {
    border-left: 4px solid #d4a94f;
}

.document-status-confirmed {
    border-left: 4px solid var(--success);
}

.document-status-ignored {
    border-left: 4px solid #747d84;
}

.document-status-label {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-weight: 700;
}

.document-status-number {
    flex: 0 0 auto;
    color: var(--text);
    font-size: 24px;
    line-height: 1;
}

.filter-submit {
    align-self: end;
}

.document-review-grid {
    display: grid;
    grid-template-columns:
        minmax(420px, 1.12fr)
        minmax(420px, .88fr);
    gap: 22px;
    align-items: start;
}

.document-review-grid > * {
    min-width: 0;
}

.document-preview-card {
    position: sticky;
    top: 20px;
    margin-bottom: 0;
}

.document-preview-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.document-preview-toolbar > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.document-preview-frame {
    display: block;
    width: 100%;
    height: min(72vh, 900px);
    min-height: 560px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
}

.document-preview-unavailable {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    text-align: center;
    color: var(--muted);
    background: #171d21;
    border: 1px dashed var(--border);
    border-radius: 7px;
}

.document-preview-unavailable i {
    color: #d7a4a4;
    font-size: 52px;
}

.document-preview-unavailable strong {
    color: var(--text);
    font-size: 17px;
}

.document-preview-unavailable p {
    max-width: 440px;
    margin: 0;
}

.document-review-form .card:last-of-type {
    margin-bottom: 0;
}

.form-field-spaced {
    margin-top: 16px;
}

.document-review-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 12px;
    background: #171d21f2;
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: 0 -5px 18px #0005;
    backdrop-filter: blur(8px);
}

.document-review-actions .button-success,
.document-review-actions .button-secondary,
.document-review-actions .button-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

.document-review-actions button i {
    flex: 0 0 auto;
    font-size: 1em;
    line-height: 1;
}

.document-review-actions .button-success {
    flex: 1 1 auto;
}

.document-review-actions .button-secondary,
.document-review-actions .button-warning {
    flex: 0 0 auto;
}

.button-warning {
    background: var(--warning);
}

.button-warning:hover {
    background: #b37b2a;
}

.document-review-actions .button-secondary:hover {
    background: #354149;
}

.document-action-hint {
    flex-basis: 100%;
    margin-top: 2px;
    line-height: 1.35;
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .document-review-grid {
        grid-template-columns: 1fr;
    }

    .document-preview-card {
        position: static;
    }

    .document-preview-frame {
        height: 70vh;
        min-height: 480px;
    }
}

@media (max-width: 700px) {
    .document-status-overview {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .document-status-overview-compact {
        max-width: none;
    }

    .document-status-card {
        padding: 11px 13px;
    }

    .document-status-number {
        font-size: 21px;
    }

    .document-preview-toolbar {
        flex-direction: column;
    }

    .document-preview-toolbar .button {
        width: 100%;
    }

    .document-preview-frame {
        height: 62vh;
        min-height: 380px;
    }

    .document-review-actions {
        position: static;
    }

    .document-review-actions .button-success,
    .document-review-actions .button-secondary,
    .document-review-actions .button-warning {
        width: 100%;
        white-space: normal;
    }

    .document-action-hint {
        white-space: normal;
    }
}


.integration-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.integration-heading h2,
.integration-heading p {
    margin-top: 0;
}

.integration-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .86rem;
    font-weight: 700;
    white-space: nowrap;
}

.integration-status-active {
    background: #dcefdc;
    color: #245c2c;
}

.integration-status-paused {
    background: #fff0c7;
    color: #765600;
}

.integration-status-retired {
    background: #e4e4e4;
    color: #4c4c4c;
}

.integration-details {
    margin-bottom: 24px;
}

.integration-details > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.integration-details span {
    overflow-wrap: anywhere;
}

.api-documentation summary {
    cursor: pointer;
    font-weight: 700;
}

.api-documentation-content {
    margin-top: 20px;
    padding: 28px;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .06);
    line-height: 1.65;
}

@media (max-width: 700px) {
    .api-documentation-content {
        padding: 18px;
    }
}

.api-documentation-content h1 {
    margin-top: 0;
}

.api-documentation-content h2 {
    margin-top: 34px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #d8d8d8);
}

.api-documentation-content h3 {
    margin-top: 28px;
}

.api-documentation-content p,
.api-documentation-content li {
    max-width: 950px;
}

.api-documentation-content table {
    width: 100%;
}

.api-documentation-content code {
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, .08);
    font-family: Consolas, Monaco, monospace;
}

.api-documentation-content pre {
    max-width: 100%;
    overflow: auto;
    padding: 18px;
    border-radius: 8px;
    background: #17191c;
    color: #f1f1f1;
    font: .88rem/1.55 Consolas, Monaco, monospace;
}

.api-documentation-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

/* API-Dokumentation im hellen Innenkasten */
.api-documentation-content {
    color: #202428;
}

.api-documentation-content h1,
.api-documentation-content h2,
.api-documentation-content h3,
.api-documentation-content h4,
.api-documentation-content p,
.api-documentation-content li,
.api-documentation-content th,
.api-documentation-content td,
.api-documentation-content strong,
.api-documentation-content em {
    color: inherit;
}

.api-documentation-content a {
    color: #7a3030;
    text-decoration: underline;
}

.api-documentation-content th,
.api-documentation-content td {
    border-color: #d7dce0;
}

.api-documentation-content blockquote {
    margin-left: 0;
    padding: 10px 16px;
    border-left: 4px solid #8d4a4a;
    background: #f3f5f6;
    color: #30363b;
}

.api-documentation-content code:not(pre code) {
    color: #202428;
    background: #e9edf0;
}


/* Dunkler Dokumentationsbereich passend zum BusinessOffice */
.api-documentation-content {
    background: #151b1f;
    border-color: #3b474f;
    color: #e6ecef;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.api-documentation-content h2 {
    border-bottom-color: #3b474f;
}

.api-documentation-content a {
    color: #f0aaa8;
}

.api-documentation-content th,
.api-documentation-content td {
    border-color: #3b474f;
}

.api-documentation-content th {
    background: #20282d;
}

.api-documentation-content blockquote {
    background: #20282d;
    color: #dfe6e9;
    border-left-color: #a85b5b;
}

.api-documentation-content code:not(pre code) {
    color: #f1d9d8;
    background: #252e34;
    border: 1px solid #3b474f;
}

.api-documentation-content pre {
    background: #0f1417;
    border: 1px solid #303a41;
}

/* API-Codeblöcke mit Formatangabe und Zeilennummern */
.api-code-block {
    margin: 16px 0 20px;
    overflow: hidden;
    border: 1px solid #303a41;
    border-radius: 8px;
    background: #0f1417;
}

.api-code-toolbar {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 13px;
    border-bottom: 1px solid #303a41;
    background: #20282d;
}

.api-code-language {
    color: #cfd8dc;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.api-code-block pre {
    margin: 0;
    padding: 14px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.api-code-block pre code {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit;
    text-decoration: none !important;
}

.api-code-block pre code * {
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit;
    text-decoration: none !important;
}

.api-code-block pre code {
    display: block;
    min-width: max-content;
}

.api-code-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 1.55em;
    padding: 0 16px;
}

.api-code-block.has-line-numbers .api-code-line {
    grid-template-columns: 3.4rem minmax(0, 1fr);
    padding: 0 16px 0 0;
}

.api-code-number {
    margin-right: 14px;
    padding-right: 14px;
    border-right: 1px solid #52616a !important;
    color: #71818a !important;
    text-align: right;
    user-select: none;
}

.api-code-text {
    min-width: 0;
    white-space: pre;
}


/* Markierung wiederhergestellter Formularfelder */
.autosave-restored-field {
    outline: 2px solid #d3a342;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(211, 163, 66, .18);
    animation: autosave-restored-pulse 1.6s ease-in-out 2;
}

@keyframes autosave-restored-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 5px rgba(211, 163, 66, .18);
    }

    50% {
        box-shadow: 0 0 0 9px rgba(211, 163, 66, .08);
    }
}


/* Gemeinsamer Bereich für Zwischenspeicherstatus und Löschknopf */
.autosave-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.autosave-control {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
}

.autosave-control .autosave-status {
    margin: 0;
    text-align: right;
}

#autosave-reset:disabled {
    opacity: .42;
    cursor: not-allowed;
    filter: saturate(.35);
    box-shadow: none;
}

@media (max-width: 700px) {
    .autosave-control {
        width: 100%;
        align-items: stretch;
    }

    .autosave-control .autosave-status {
        text-align: left;
    }
}


/* Abstand nach der Zwischenspeicher-Wiederherstellung */
#autosave-recovery:not([hidden]) {
    margin-bottom: 18px;
}

/* Zentraler Kontaktfinder im Briefformular */
.contact-picker-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px;
    border: 1px solid #3b474f;
    border-radius: 10px;
    background: #171e22;
}

.contact-picker-summary {
    min-width: 0;
}

.contact-picker-summary .form-label,
.contact-picker-summary strong,
.contact-picker-summary small {
    display: block;
}

.contact-picker-summary strong {
    margin-top: 3px;
}

.contact-picker-summary small {
    margin-top: 4px;
}

.contact-picker-hint {
    margin: 8px 0 18px;
}

.contact-search-dialog {
    width: min(860px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    border: 1px solid #45535c;
    border-radius: 14px;
    background: #151b1f;
    color: #edf2f4;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .58);
}

.contact-search-dialog::backdrop {
    background: rgba(4, 7, 9, .74);
    backdrop-filter: blur(3px);
}

.contact-search-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #354149;
    background: #20282d;
}

.contact-search-header h2,
.contact-search-header p {
    margin: 0;
}

.contact-search-header p {
    margin-top: 5px;
}

.contact-search-close {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.55rem;
    line-height: 1;
}

.contact-search-input-row {
    padding: 18px 24px 14px;
}

.contact-search-results {
    min-height: 180px;
    max-height: 510px;
    padding: 0 24px 24px;
    overflow-y: auto;
}

.contact-search-result {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 14px 16px;
    border: 1px solid #354149;
    border-radius: 10px;
    background: #1b2328;
    color: inherit;
    text-align: left;
}

.contact-search-result:hover,
.contact-search-result:focus-visible {
    border-color: #a85b5b;
    background: #252e34;
}

.contact-search-result strong,
.contact-result-meta,
.contact-result-badges {
    display: block;
}

.contact-result-meta {
    margin-top: 4px;
    color: #b9c4c9;
    font-size: .88rem;
    font-weight: 400;
}

.contact-result-badges {
    margin-top: 9px;
}

.contact-result-badge {
    display: inline-block;
    margin: 0 6px 5px 0;
    padding: 4px 8px;
    border: 1px solid #52616a;
    border-radius: 999px;
    background: #11171a;
    color: #dce4e7;
    font-size: .76rem;
    font-weight: 600;
}

@media (max-width: 700px) {
    .contact-picker-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .contact-picker-panel .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .contact-search-header,
    .contact-search-input-row,
    .contact-search-results {
        padding-left: 16px;
        padding-right: 16px;
    }
}


/* Warnung bei abweichender Briefanschrift */
.contact-address-warning {
    margin: 12px 0 0;
    border: 1px solid #c94f4f;
    background: rgba(201, 79, 79, .12);
    color: #ffd6d6;
}

.contact-address-warning[hidden] {
    display: none;
}

.contact-address-difference {
    outline: 2px solid #c94f4f;
    outline-offset: 2px;
    box-shadow:
        0 0 0 5px rgba(201, 79, 79, .16);
}

.contact-address-difference:focus {
    box-shadow:
        0 0 0 6px rgba(201, 79, 79, .24);
}

/* Feld ist zugleich wiederhergestellt und vom Kontakt abweichend */
.autosave-restored-field.contact-address-difference {
    outline: 2px solid #c94f4f;
    outline-offset: 2px;
    box-shadow:
        inset 0 0 0 2px #d3a342,
        0 0 0 5px rgba(201, 79, 79, .16);
    animation: none;
}

.autosave-restored-field.contact-address-difference:focus {
    box-shadow:
        inset 0 0 0 2px #d3a342,
        0 0 0 6px rgba(201, 79, 79, .24);
}

/* Loginbereich kompakt und zentriert */
.container-login {
    width: calc(100% - 32px);
    max-width: 860px;
    margin-inline: auto;
}

@media (max-width: 600px) {
    .container-login {
        width: calc(100% - 20px);
    }
}

/* Abstand zwischen GbR-Hinweis und folgendem Inhalt */
.gbr-access-notice {
    margin-bottom: 20px;
}


/* Dezenter Herkunftshinweis unter dem BusinessOffice-Schriftzug */
.sidebar-brand-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.sidebar-brand-credit {
    display: block;
    margin: 4px 0 0;
    padding: 0;
    color: #8c3c3c;
    line-height: 1.15;
    text-align: left;
    white-space: nowrap;
}

/* Mehrzeilige Betreffzeilen in Arbeitsmappen */
.case-letter-subject {
    display: inline-block;
    line-height: 1.35;
}


/* Ansprechpartner in Arbeitsmappen bündig ausrichten */
.case-party-contact-cell {
    vertical-align: top;
}

.case-party-contact-name,
.case-party-contact-details {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 1.35;
}

.case-party-contact-details:first-child {
    padding-top: 1px;
}

/* Ausgeklappte Bereiche erhalten einen eigenen Innenkasten */
.case-view details[open] > form {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(181, 202, 214, .20);
    border-radius: 8px;
    background: rgba(7, 12, 15, .34);
    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, .035);
}

/* Vorhandenen Brief links verknüpfen, neuen Brief rechts anlegen */
.case-letter-footer-actions {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
    align-items: end;
    gap: 18px;
    margin-top: 18px;
}

.case-letter-link-form {
    min-width: 0;
    margin: 0;
}

.case-letter-link-form select {
    width: 100%;
}

.case-letter-link-form button {
    margin-top: 10px;
}

.case-letter-create-button {
    grid-column: 2;
    align-self: end;
    justify-self: end;
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .case-letter-footer-actions {
        grid-template-columns: 1fr;
    }

    .case-letter-create-button {
        grid-column: 1;
        justify-self: stretch;
        text-align: center;
    }
}


/* Briefaktionen in Arbeitsmappen einheitlich rechts */
.case-letter-table {
    width: 100%;
}

.case-letter-actions-cell {
    width: 1%;
    vertical-align: top;
    text-align: right;
    white-space: nowrap;
}

.case-letter-row-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

/* Verknüpfung links, neuer Brief an der rechten Kante */
.case-letter-footer-actions {
    width: 100%;
    grid-template-columns:
        minmax(0, 1fr)
        auto;
}

.case-letter-create-button {
    align-self: end;
    justify-self: end;
    margin: 0;
}

/* Zeilenumbrüche aus dem gespeicherten Briefbetreff */
.letter-list-subject {
    display: inline-block;
    line-height: 1.35;
}


/* GbR-Tabellen: Aktionsspalten immer rechts */
.gbr-table .gbr-action-column {
    width: 1%;
    padding-left: 18px;
    text-align: right;
    white-space: nowrap;
}

.gbr-table .gbr-action-column > a,
.gbr-table .gbr-action-column > button {
    display: inline-flex;
    justify-content: center;
}

/* Dokumenttitel und Originaldatei getrennt darstellen */
.gbr-document-title {
    display: block;
    line-height: 1.35;
}

.gbr-document-filename {
    display: block;
    margin-top: 3px;
    line-height: 1.3;
}

/* Kompakte Statuskennzeichnungen statt starker Pillenform */
.gbr-status-badge,
.office-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: .84rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.gbr-status-info,
.office-status-info {
    color: #a9d6ff;
    background: rgba(67, 133, 195, .19);
    border-color: rgba(96, 164, 226, .42);
}

.gbr-status-success,
.office-status-success {
    color: #a9e8bf;
    background: rgba(55, 142, 88, .20);
    border-color: rgba(88, 178, 118, .42);
}

.gbr-status-warning,
.office-status-warning {
    color: #f0d58a;
    background: rgba(176, 121, 32, .20);
    border-color: rgba(213, 157, 61, .45);
}

.gbr-status-danger,
.office-status-danger {
    color: #f3aaaa;
    background: rgba(168, 62, 62, .21);
    border-color: rgba(211, 91, 91, .45);
}

.gbr-status-neutral,
.office-status-neutral {
    color: #ced6dc;
    background: rgba(126, 139, 148, .16);
    border-color: rgba(151, 164, 173, .30);
}


/* Arbeitsmappenübersicht: Aktionen immer rechts */
.case-list-table .case-list-action-column {
    width: 1%;
    padding-left: 18px;
    text-align: right;
    white-space: nowrap;
}

.case-list-table .case-list-action-column > a,
.case-list-table .case-list-action-column > button {
    display: inline-flex;
    justify-content: center;
}


/* Dokumentenarchiv: Aktionsspalte verbindlich rechts */
.case-document-action-cell {
    width: 1%;
    padding-left: 18px;
    vertical-align: top;
    text-align: right;
    white-space: nowrap;
}

.case-document-action-cell > a,
.case-document-action-cell > button {
    display: inline-flex;
    justify-content: center;
}


/* Verwaltungsaktion zwischen Arbeitsmappeninhalt und Freigaben */
.case-management-link {
    justify-content: flex-end;
    margin: 12px 0 16px;
}

.case-management-button {
    white-space: nowrap;
}


/* Vollständigkeitsprüfung */
.gbr-workspace-actions {
    justify-content: flex-end;
    margin: -8px 0 16px;
}

.evidence-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.evidence-summary-card {
    display: grid;
    gap: 8px;
    margin: 0;
}

.evidence-summary-card span {
    color: var(--muted);
    font-size: .88rem;
}

.evidence-summary-card strong {
    font-size: 1.7rem;
}

.evidence-table th:last-child,
.evidence-status-cell {
    text-align: right;
}

.evidence-table td {
    vertical-align: top;
}

.evidence-amounts {
    white-space: nowrap;
}

.evidence-item-list {
    display: grid;
    gap: 8px;
    min-width: 310px;
}

.evidence-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

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

.evidence-item > div:first-child {
    display: grid;
    gap: 2px;
}

.evidence-item-result {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    white-space: nowrap;
}

.evidence-status-cell {
    min-width: 190px;
}

.evidence-status-cell small {
    display: inline-block;
    max-width: 260px;
    margin-top: 8px;
    line-height: 1.35;
}

@media (max-width: 1050px) {
    .evidence-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .evidence-summary-grid {
        grid-template-columns: 1fr;
    }

    .gbr-workspace-actions {
        justify-content: stretch;
    }

    .gbr-workspace-actions .button {
        width: 100%;
        justify-content: center;
    }
}


.evidence-view-button {
    padding: 4px 8px;
    font-size: .8rem;
    line-height: 1.2;
}

.evidence-status-cell small {
    text-align: left;
}


.evidence-upload-form {
    margin: 0;
}

.evidence-upload-button {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: .8rem;
    line-height: 1.2;
    cursor: pointer;
}

.evidence-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}


.evidence-fee-negative {
    color: #e7a0a0;
    font-weight: 700;
}


/* Einheitliche Aktionen der Vollständigkeitsprüfung */
.evidence-upload-button {
    gap: 7px;
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
}

.evidence-upload-button:hover {
    border-color: var(--brand-hover);
    background: var(--brand-hover);
    text-decoration: none;
}

.evidence-view-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
}

/*
 * „Nicht erforderlich“ ist keine Aktion und kein
 * positiver Nachweis. Deshalb bewusst zurückgenommen.
 */
.evidence-item .office-status-neutral {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    opacity: .48;
    filter: saturate(.35);
}

.evidence-item .office-status-neutral:hover {
    opacity: .62;
}


.evidence-net-result {
    color: var(--text);
    font-weight: 750;
}


/* Vollständigkeitsprüfung – Kopfbereich */
.evidence-page-heading {
    align-items: flex-start;
}

.evidence-page-heading > .actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    padding-top: 22px;
}

.evidence-page-heading > .actions .button {
    gap: 8px;
}

/* Untermenü der GbR-Aufarbeitung */
.sidebar-nav-branch {
    margin-bottom: 2px;
}

.sidebar-nav a.is-parent-active {
    background: #ffffff0d;
    border-color: #ffffff18;
}

.sidebar-subnav {
    margin: -1px 0 5px 28px;
    padding-left: 11px;
    border-left: 1px solid #ffffff30;
}

.sidebar-subnav a {
    min-height: 34px;
    margin: 1px 0;
    padding: 6px 9px;
    border-radius: 6px;
    color: #f0dada;
    font-size: 12px;
    font-weight: 650;
}

.sidebar-subnav a i {
    width: 16px;
    flex-basis: 16px;
    color: #e8c6c6;
    font-size: 12px;
}

.sidebar-subnav a.is-active {
    background: #ffffff22;
    border-color: #ffffff32;
    box-shadow: inset 3px 0 0 #f0b3b3;
}

@media (max-width: 850px) {
    .evidence-page-heading > .actions {
        width: 100%;
        justify-content: flex-start;
        padding-top: 0;
    }
}


/* Fachliche Prüfung nachgereichter Nachweise */
.evidence-review-form {
    margin: 0;
}

.evidence-item-note {
    max-width: 330px;
    white-space: normal;
    color: #e6c3c3;
    line-height: 1.35;
}

.evidence-review-dialog {
    width: min(520px, calc(100vw - 32px));
    padding: 22px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 18px 60px #000b;
}

.evidence-review-dialog::backdrop {
    background: #000b;
    backdrop-filter: blur(2px);
}

.evidence-review-dialog form {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

.evidence-review-dialog .grid,
.evidence-review-dialog .grid > * {
    min-width: 0;
    max-width: 100%;
}

.evidence-review-dialog p,
.evidence-review-dialog strong,
.evidence-review-dialog small,
.evidence-review-dialog label {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.evidence-review-dialog input,
.evidence-review-dialog select,
.evidence-review-dialog textarea {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.evidence-review-dialog h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.evidence-review-dialog textarea {
    min-height: 120px;
}

.evidence-dialog-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.evidence-dialog-actions .button-danger {
    gap: 7px;
}


.evidence-item-note-rejected {
    color: #ff7474;
    font-weight: 800;
}


/* Filter und Export der Nachweisübersicht */
.evidence-filter-card {
    margin-bottom: 22px;
}

.evidence-filter-grid {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        minmax(150px, .65fr)
        minmax(230px, .9fr)
        auto;
    gap: 14px;
    align-items: end;
}

.evidence-checkbox-field {
    display: flex;
    align-items: center;
    min-height: 40px;
    gap: 9px;
    margin: 0;
    padding: 8px 11px;
    color: var(--text);
    background: #111619;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.evidence-checkbox-field input {
    width: auto;
    margin: 0;
}

.evidence-filter-actions {
    justify-content: flex-end;
}

.evidence-filter-actions .button,
.evidence-filter-actions button {
    gap: 7px;
    white-space: nowrap;
}

@media (max-width: 1350px) {
    .evidence-filter-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .evidence-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 650px) {
    .evidence-filter-grid {
        grid-template-columns: 1fr;
    }

    .evidence-filter-actions {
        grid-column: auto;
        align-items: stretch;
        flex-direction: column;
    }

    .evidence-filter-actions .button,
    .evidence-filter-actions button {
        width: 100%;
    }
}


/* Sammelupload fehlender Nachweise */
.evidence-batch-dialog {
    width: min(1040px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
}

.evidence-batch-dialog::backdrop {
    background: rgb(0 0 0 / 72%);
    backdrop-filter: blur(3px);
}

.evidence-batch-dialog > form {
    display: grid;
    gap: 18px;
    max-height: calc(100vh - 34px);
    padding: 22px;
    overflow: auto;
}

.evidence-batch-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.evidence-batch-heading h2 {
    margin: 0 0 5px;
}

.evidence-batch-heading p {
    margin: 0;
}

.evidence-batch-dropzone {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 130px;
    padding: 22px;
    text-align: center;
    background: #101518;
    border: 2px dashed var(--border);
    border-radius: 9px;
    cursor: pointer;
}

.evidence-batch-dropzone:hover {
    border-color: var(--accent);
}

.evidence-batch-dropzone > i {
    font-size: 28px;
}

.evidence-batch-dropzone input {
    width: min(100%, 520px);
    margin-top: 8px;
}

.evidence-batch-message {
    min-height: 22px;
}

.evidence-batch-preview {
    display: grid;
    gap: 10px;
}

.evidence-batch-preview-row {
    display: grid;
    grid-template-columns:
        54px
        minmax(160px, .7fr)
        minmax(320px, 1.5fr)
        auto;
    gap: 13px;
    align-items: center;
    padding: 11px;
    background: #111619;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.evidence-batch-file-visual {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    overflow: hidden;
    font-size: 26px;
    background: #0b0f11;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.evidence-batch-file-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.evidence-batch-file-info,
.evidence-batch-assignment {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.evidence-batch-file-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.evidence-batch-assignment label {
    margin: 0;
    font-size: .82rem;
}

.evidence-batch-assignment select {
    width: 100%;
}

.evidence-batch-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

@media (max-width: 780px) {
    .evidence-batch-preview-row {
        grid-template-columns:
            54px
            minmax(0, 1fr)
            auto;
    }

    .evidence-batch-assignment {
        grid-column: 1 / -1;
    }

    .evidence-batch-row-actions {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (max-width: 520px) {
    .evidence-batch-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .evidence-batch-dialog > form {
        max-height: calc(100vh - 18px);
        padding: 15px;
    }
}


/* BusinessOffice 0.6.0-dev: lokalisierte Geldfelder */
.money-input {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.money-input > input {
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.money-input-suffix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0 12px;
    color: var(--muted);
    background: #111619;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 7px 7px 0;
}

/* BusinessOffice 0.6.0-dev: Fallakten als echte Arbeitsakten */
.case-row-action-cell,
.case-document-action-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.case-row-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.case-party-contact-cell {
    min-width: 220px;
}

.case-party-contact-name {
    display: block;
    margin-bottom: 4px;
}

.case-contact-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.case-contact-line:hover span {
    text-decoration: underline;
}

.case-contact-line i {
    width: 16px;
    color: var(--muted);
    text-align: center;
}

.case-timeline-item {
    grid-template-columns: minmax(125px, auto) minmax(0, 1fr) auto;
    align-items: start;
}

.case-documents-card .notice-box,
.case-document-form .notice-box {
    margin: 14px 0;
}

.case-document-form {
    display: grid;
    gap: 14px;
}

@media (max-width: 780px) {
    .case-party-contact-cell {
        min-width: 180px;
    }

    .case-timeline-item {
        grid-template-columns: 1fr auto;
    }

    .case-timeline-item > time {
        grid-column: 1 / -1;
    }
}

/* BusinessOffice 0.6.0-dev: finanzielle Vollständigkeitsprüfung */
.evidence-monthly-summary,
.invoice-evidence-section {
    margin-top: 18px;
}

.invoice-proof-upload-form {
    display: grid;
    gap: 10px;
    min-width: min(360px, 75vw);
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.invoice-proof-upload-form label {
    display: grid;
    gap: 6px;
    margin: 0;
}

.invoice-proof-upload-form input[type="file"] {
    width: 100%;
}

.invoice-proof-result {
    flex-wrap: wrap;
    align-items: flex-start;
}

.invoice-evidence-table td {
    vertical-align: top;
}

/* BusinessOffice 0.6.1-dev – einheitliche Kennzahlen */
.dashboard-metrics {
    align-items: stretch;
}
.dashboard-metric-card {
    min-height: 128px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}
.dashboard-metric-label,
.dashboard-metric-heading {
    margin: 0;
    min-height: 24px;
    font-size: 15px;
    line-height: 1.35;
    color: var(--muted);
    font-weight: 600;
}
.dashboard-metric-heading {
    color: var(--text);
    font-size: 18px;
    font-weight: 750;
}
.dashboard-metric-value {
    margin: 0;
    font-size: clamp(25px, 2vw, 32px);
    line-height: 1.1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.dashboard-metric-value-text {
    font-size: 20px;
    line-height: 1.25;
}
.dashboard-metric-value-split {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

/* BusinessOffice 0.6.1-dev – reduzierte Anmeldung und neue Wortmarke */
.login-logo {
    width: min(520px, 94%);
    margin: 0 auto 28px;
}
.login-card {
    padding-top: 28px;
}


/* BusinessOffice 0.6.1-dev UI-Erklärungen und Plattformauswahl */
.field-label-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 6px;
}
.field-label-row > label {
    margin-bottom: 0;
}
.field-help {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}
.field-help-button {
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    font-size: 12px;
    line-height: 1;
}
.field-help-button:hover,
.field-help-button:focus {
    background: var(--brand);
    outline: none;
}
.field-help-popover {
    position: absolute;
    z-index: 120;
    top: calc(100% + 8px);
    left: 50%;
    width: min(340px, calc(100vw - 42px));
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0f1417;
    box-shadow: 0 8px 24px #0009;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -4px);
    transition:
        opacity .14s ease,
        transform .14s ease,
        visibility .14s ease;
}
.field-help:hover .field-help-popover,
.field-help:focus-within .field-help-popover {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}
.platform-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}
.platform-picker .icon-button {
    width: 42px;
    min-width: 42px;
    height: auto;
    min-height: 42px;
}
.new-platform-wrapper {
    margin-top: 10px;
    padding: 11px;
    border: 1px dashed var(--border);
    border-radius: 7px;
    background: #171d21;
}
.new-platform-wrapper[hidden] {
    display: none;
}
.evidence-amount-missing {
    color: #efbf71;
}
@media (max-width: 650px) {
    .field-help-popover {
        position: fixed;
        top: 50%;
        left: 50%;
        width: min(360px, calc(100vw - 32px));
        transform: translate(-50%, calc(-50% - 4px));
    }
    .field-help:hover .field-help-popover,
    .field-help:focus-within .field-help-popover {
        transform: translate(-50%, -50%);
    }
}

/* BusinessOffice 0.6.1-dev: Fallakten-Dokumente stabil ausrichten */
.case-documents-table {
    width: 100%;
    min-width: 650px;
    table-layout: fixed;
}

.case-document-category-column {
    width: 16%;
}

.case-document-title-column {
    width: auto;
}

.case-document-scope-column {
    width: 158px;
}

.case-document-actions-column {
    width: 150px;
}

.case-document-title-cell {
    min-width: 0;
    overflow-wrap: anywhere;
}

.case-documents-table th:nth-child(3),
.case-documents-table td:nth-child(3) {
    white-space: nowrap;
}

.case-documents-table .case-document-action-cell {
    width: 150px;
    min-width: 150px;
    padding-left: 12px;
    overflow: visible;
}

.case-documents-table .case-row-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
}

.case-documents-table .case-row-actions > .button {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .case-documents-table {
        min-width: 620px;
    }

    .case-document-category-column {
        width: 105px;
    }

    .case-document-scope-column {
        width: 150px;
    }

    .case-document-actions-column,
    .case-documents-table .case-document-action-cell {
        width: 150px;
        min-width: 150px;
    }
}


.evidence-proof-exception-note {
    max-width: 430px;
    color: #f1c98f;
}


/* Dynamische Buchungsnachweise je Ausgabe */
.expense-evidence-table th:nth-child(1),
.expense-evidence-table td:nth-child(1) {
    width: 120px;
}

.expense-evidence-table th:nth-child(2),
.expense-evidence-table td:nth-child(2) {
    width: 220px;
}

.expense-evidence-table th:nth-child(3),
.expense-evidence-table td:nth-child(3) {
    width: 145px;
}

.expense-evidence-table th:nth-child(4),
.expense-evidence-table td:nth-child(4) {
    min-width: 430px;
}

.expense-evidence-table th:nth-child(5),
.expense-evidence-table td:nth-child(5) {
    width: 170px;
}

.evidence-proof-group {
    display: block;
    min-width: 0;
}

.expense-proof-heading {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.expense-proof-list {
    display: grid;
    gap: 3px;
    width: 100%;
    margin-top: 4px;
}

.expense-proof-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    min-width: 0;
    padding: 5px 0;
}

.expense-proof-entry + .expense-proof-entry {
    border-top: 1px dashed var(--border);
}

.expense-proof-entry-main {
    display: grid;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
}

.expense-proof-entry-main strong {
    min-width: 0;
    max-width: 100%;
    font-size: .94rem;
    overflow-wrap: anywhere;
}

.expense-proof-note {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-proof-entry-actions {
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

@media (max-width: 1050px) {
    .expense-evidence-table th:nth-child(4),
    .expense-evidence-table td:nth-child(4) {
        min-width: 390px;
    }
}

@media (max-width: 720px) {
    .expense-proof-heading,
    .expense-proof-entry {
        align-items: stretch;
        flex-direction: column;
    }

    .expense-proof-entry-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* BusinessOffice 0.7.0-dev: Sammelnachweise für Plattformtransaktionen */
.evidence-item-collection {
    align-items: flex-start;
}

.evidence-collection-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.evidence-collection-heading h2,
.evidence-collection-heading h3 {
    margin-bottom: 6px;
}

.evidence-not-required-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
}

.evidence-not-required-toggle input {
    width: auto;
    margin: 0;
}

.evidence-collection-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 20px;
    margin-top: 18px;
}

.evidence-amount-entry-textarea {
    min-height: 250px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    line-height: 1.55;
}

.evidence-collection-summary {
    display: grid;
    align-content: start;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.025);
}

.evidence-collection-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 13px;
}

.evidence-collection-summary > div + div {
    border-top: 1px solid var(--border);
}

.evidence-collection-summary span {
    color: var(--muted);
}

.evidence-collection-summary strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.evidence-collection-result-row {
    background: rgba(255, 255, 255, 0.025);
}

.evidence-collection-documents {
    display: grid;
    gap: 8px;
}

.evidence-collection-documents h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.evidence-collection-document {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.evidence-collection-document > div:first-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.evidence-collection-document strong {
    overflow-wrap: anywhere;
}

.evidence-collection-document small {
    color: var(--muted);
}

.evidence-collection-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: .9rem;
}

.evidence-collection-remove input {
    width: auto;
    margin: 0;
}

.evidence-collection-match {
    color: #9be6b0;
    font-weight: 700;
}

.evidence-collection-mismatch {
    color: #ffb0a8;
    font-weight: 700;
}

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

@media (max-width: 620px) {
    .evidence-collection-document {
        align-items: stretch;
        flex-direction: column;
    }

    .evidence-collection-document .actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.evidence-collection-summary-compact {
    margin-top: 14px;
}

.evidence-collection-summary-compact > div {
    padding: 8px 10px;
    font-size: .92rem;
}

.evidence-section-not-required {
    opacity: .76;
}

.evidence-section-not-required textarea,
.evidence-section-not-required input[type="file"],
.evidence-section-not-required input[type="date"] {
    cursor: not-allowed;
}
