.beiblatt-header-row {
    align-items: flex-start;
    gap: 28px;
}

.beiblatt-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.beiblatt-hinweis {
    min-width: 300px;
    max-width: 420px;
}

.beiblatt-flash {
    margin: 12px 20px;
    padding: 11px 14px;
    border-radius: 7px;
    font-weight: 700;
}

.beiblatt-flash.success {
    background: #d9eadf;
    color: #1d5f36;
}

.beiblatt-flash.error {
    background: #f8c7c7;
    color: #8a0000;
    border: 1px solid #c0392b;
}

.beiblatt-flash.warning {
    background: #fff2cc;
    color: #7a5200;
    border: 1px solid #d6a600;
}

.beiblatt-flash ul {
    margin: 6px 0 0 20px;
}

.beiblatt-date-panel {
    display: grid;
    grid-template-columns: minmax(240px, 420px);
    gap: 14px;
    margin: 14px 0;
    padding: 12px 20px;
    background: #f7f7f7;
    border-top: 1px solid #c7c7c7;
    border-bottom: 1px solid #c7c7c7;
    box-sizing: border-box;
}

.beiblatt-date-panel-av {
    grid-template-columns: repeat(3, minmax(0, 300px));
}

.beiblatt-date-panel label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
}

.beiblatt-date-panel input {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 5px 8px;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 5px;
    background: #fff;
    color: #222;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.beiblatt-table-wrapper {
    height: calc(100vh - 285px);
    max-height: none;
    overflow: auto;
}

.beiblatt-table {
    width: max-content;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #fff;
    --w-vorname: 180px;
    --w-nachname: 180px;
    --w-profil: 70px;
    --w-abschluss: 120px;
    --w-dokument: 145px;
}

.beiblatt-table th,
.beiblatt-table td {
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    height: 49px;
    padding: 4px;
    vertical-align: middle;
    text-align: center;
    box-sizing: border-box;
    background: #fff;
}

.beiblatt-table th:first-child,
.beiblatt-table td:first-child {
    border-left: 1px solid #ccc;
}

.beiblatt-table thead th {
    position: sticky;
    top: 0;
    z-index: 55;
    height: 74px;
    background: #e9e9e9;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 600;
    white-space: normal;
}

.beiblatt-table .col-bb-vorname,
.beiblatt-table .sticky-bb-vorname {
    width: var(--w-vorname);
    min-width: var(--w-vorname);
    max-width: var(--w-vorname);
}

.beiblatt-table .col-bb-nachname,
.beiblatt-table .sticky-bb-nachname {
    width: var(--w-nachname);
    min-width: var(--w-nachname);
    max-width: var(--w-nachname);
}

.beiblatt-table .col-bb-profil,
.beiblatt-table .sticky-bb-profil {
    width: var(--w-profil);
    min-width: var(--w-profil);
    max-width: var(--w-profil);
}

.beiblatt-table .col-bb-abschluss,
.beiblatt-table .sticky-bb-abschluss {
    width: var(--w-abschluss);
    min-width: var(--w-abschluss);
    max-width: var(--w-abschluss);
}

.beiblatt-table .col-bb-dokument,
.beiblatt-table .beiblatt-document-head,
.beiblatt-table .beiblatt-action-cell {
    width: var(--w-dokument);
    min-width: var(--w-dokument);
    max-width: var(--w-dokument);
}

.sticky-bb-vorname,
.sticky-bb-nachname,
.sticky-bb-profil,
.sticky-bb-abschluss {
    position: sticky;
    background: #f0f0f0 !important;
    z-index: 35;
}

.sticky-bb-vorname { left: 0; }
.sticky-bb-nachname { left: var(--w-vorname); }
.sticky-bb-profil { left: calc(var(--w-vorname) + var(--w-nachname)); }
.sticky-bb-abschluss {
    left: calc(var(--w-vorname) + var(--w-nachname) + var(--w-profil));
    box-shadow: 4px 0 6px rgba(0,0,0,0.12);
}

.beiblatt-table-2bfs .sticky-bb-profil {
    box-shadow: 4px 0 6px rgba(0,0,0,0.12);
}

.beiblatt-table thead .sticky-bb-vorname,
.beiblatt-table thead .sticky-bb-nachname,
.beiblatt-table thead .sticky-bb-profil,
.beiblatt-table thead .sticky-bb-abschluss {
    z-index: 75;
}

.beiblatt-table .field.name-field {
    width: 165px;
    font-weight: normal;
}

.beiblatt-table .profil-field {
    width: 58px;
    height: 40px;
}

.beiblatt-abschluss-field {
    width: 108px;
    height: 40px;
    padding: 5px;
    border: 1px solid #bbb;
    border-radius: 5px;
    box-sizing: border-box;
    background: #fff !important;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.beiblatt-document-head > div {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dokumentaktionen auf dieser Seite verwenden den festen AV-Farbton. */
.beiblatt-small-button,
body[data-klasse] .page-content > header .beiblatt-toolbar .beiblatt-class-choice,
.beiblatt-dialog .beiblatt-dialog-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    padding: 5px 10px;
    box-sizing: border-box;
    border: 2px solid var(--av-green, #54955C);
    border-radius: 6px;
    background: #fff;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

/* Die Klassen-Auswahl gehört zu den gefüllten Hauptaktionen im Kopf. */
body[data-klasse] .page-content > header .beiblatt-toolbar .beiblatt-class-choice {
    background: var(--av-green, #54955C);
}

.beiblatt-small-button:hover:not(:disabled),
body[data-klasse] .page-content > header .beiblatt-toolbar .beiblatt-class-choice:hover,
.beiblatt-dialog .beiblatt-dialog-actions button:hover:not(:disabled) {
    background: var(--av-green, #54955C);
    color: #000;
    text-decoration: none;
}

.beiblatt-action-cell .beiblatt-small-button {
    width: 100%;
}

.beiblatt-small-button:disabled,
.beiblatt-dialog .beiblatt-dialog-actions button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.beiblatt-small-button:focus-visible,
.beiblatt-class-choice:focus-visible,
.beiblatt-choice-dialog button:focus-visible,
.beiblatt-dialog button:focus-visible {
    outline: 2px solid var(--av-green, #54955C);
    outline-offset: 3px;
}

/* Der Dialogtitel erhält den Startfokus, ist aber kein Bedienelement. */
.beiblatt-choice-header h2[tabindex="-1"]:focus {
    outline: none;
}

.beiblatt-phase-badge,
.beiblatt-batch-reason,
.beiblatt-unavailable-reason {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 31px;
    box-sizing: border-box;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.beiblatt-phase-badge {
    max-width: 72px;
    margin: 5px auto 0;
    background: #d4d4d4;
    color: #666;
}

.beiblatt-batch-reason,
.beiblatt-unavailable-reason {
    color: #222;
    background: #fff;
    border: 1px solid #c0392b;
    overflow-wrap: anywhere;
}

.beiblatt-batch-reason {
    margin-top: 5px;
}

.beiblatt-dialog {
    max-height: calc(100vh - 32px);
    overflow: auto;
    box-sizing: border-box;
    color: #000;
    width: min(460px, calc(100vw - 32px));
    border: none;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 12px 38px rgba(0,0,0,0.28);
}

.beiblatt-dialog::backdrop {
    background: rgba(0,0,0,0.38);
}

.beiblatt-dialog form {
    padding: 22px;
}

.beiblatt-dialog h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.beiblatt-dialog label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
}

.beiblatt-dialog input[type="date"] {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    padding: 7px 9px;
    border: 1px solid #999;
    border-radius: 6px;
    font-size: 14px;
}

.beiblatt-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 850px) {
    .beiblatt-date-panel-av {
        grid-template-columns: minmax(0, 300px);
    }
}

@media print {
    .main-nav,
    .beiblatt-toolbar,
    .beiblatt-date-panel,
    .hinweis-box,
    .beiblatt-small-button,
    .beiblatt-phase-badge,
    .beiblatt-batch-reason,
    .beiblatt-unavailable-reason,
    .archiv-hinweis {
        display: none !important;
    }
    .beiblatt-table-wrapper {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

/* Die normalen Zelllinien bleiben zwischen allen Dokumentbereichen erhalten. */
.beiblatt-table {
    --w-hk: 210px;
}

.beiblatt-table .col-bb-hk,
.beiblatt-table .beiblatt-hk-cell {
    width: var(--w-hk);
    min-width: var(--w-hk);
    max-width: var(--w-hk);
}

.beiblatt-action-cell .beiblatt-unavailable-reason + .beiblatt-unavailable-reason {
    margin-top: 4px;
}

.beiblatt-choice-dialog {
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    box-sizing: border-box;
    border: 1px solid #bbb;
    border-radius: 8px;
    background: #fff;
    color: #000;
    box-shadow: 0 8px 24px rgba(38, 50, 56, 0.25);
}

.beiblatt-class-dialog {
    width: min(720px, calc(100vw - 32px));
}

.beiblatt-choice-dialog::backdrop {
    background: rgba(38, 50, 56, 0.4);
}

.beiblatt-choice-header,
.beiblatt-generate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.beiblatt-choice-header {
    padding: 16px 20px;
    background: #fffaf0;
    border-top: 3px solid #F6BD32;
    border-bottom: 1px solid #F6BD32;
}

.beiblatt-choice-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
    overflow-wrap: anywhere;
}

.beiblatt-choice-header p {
    margin: 0;
    font-size: 14px;
}

.beiblatt-choice-dialog .beiblatt-choice-close,
.beiblatt-dialog .beiblatt-choice-close {
    flex: 0 0 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #000;
    font-size: 26px;
    cursor: pointer;
}

.beiblatt-choice-dialog .beiblatt-choice-close:hover,
.beiblatt-dialog .beiblatt-choice-close:hover {
    background: var(--av-green, #54955C);
    color: #000;
}

.beiblatt-choice-content {
    display: grid;
    gap: 20px;
    padding: 20px;
}

.beiblatt-choice-content section {
    min-width: 0;
}

.beiblatt-choice-content h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.beiblatt-batch-unavailable h4 {
    margin: 0 0 6px;
    font-size: 13px;
}

.beiblatt-choice-content .beiblatt-small-button,
.beiblatt-combined-choice .beiblatt-small-button {
    width: 100%;
    min-height: 40px;
    font-size: 14px;
}

.beiblatt-choice-content section > .beiblatt-small-button + .beiblatt-small-button,
.beiblatt-choice-content .beiblatt-unavailable-reason + .beiblatt-unavailable-reason {
    margin-top: 8px;
}

.beiblatt-lfp-grid,
.beiblatt-batch-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.beiblatt-choice-dialog .beiblatt-unavailable-reason {
    font-size: 12px;
    min-height: 40px;
    font-weight: normal;
}

.beiblatt-combined-choice {
    padding: 20px 20px 0;
}

.beiblatt-choice-intro,
.beiblatt-choice-footer {
    margin: 0;
    padding: 12px 20px;
    font-size: 13px;
    color: #555;
}

.beiblatt-choice-footer {
    border-top: 1px solid #ccc;
}

.beiblatt-choice-intro {
    padding-bottom: 0;
}

@media (max-width: 540px) {
    .beiblatt-lfp-grid,
    .beiblatt-batch-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media print {
    .beiblatt-choice-dialog,
    .beiblatt-dialog {
        display: none !important;
    }
}
