/* Buttons, Meldungen und Tabellen */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 16px;
    padding: 10px 18px;
    border: 0;
    border-radius: 4px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.button--header {
    margin-top: 0;
}

.button--primary {
    color: var(--club-action-text);
    background: var(--club-action);
}

.button--primary:hover,
.button--primary:focus-visible {
    background: var(--club-action-hover);
}

.button--secondary {
    color: var(--club-secondary-text);
    background: var(--club-secondary);
    border: 1px solid #b9c5cf;
}

.button--secondary:hover,
.button--secondary:focus-visible {
    background: var(--club-secondary-hover);
}

.button--compact {
    min-height: 36px;
    margin-top: 0;
    padding: 7px 12px;
    font-size: 14px;
    white-space: nowrap;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-left: 4px solid;
}

.alert--error {
    color: #721c24;
    background: #fbeaec;
    border-color: #b4232c;
}

.alert--success {
    color: #164f38;
    background: #e6f4ed;
    border-color: #248a57;
}

.alert--warning {
    color: #614800;
    background: #fff5d8;
    border-color: #c99400;
}

.alert--info {
    color: #174f78;
    background: #e8f2f8;
    border-color: #347da7;
}

[hidden] {
    display: none !important;
}

.flash-error p {
    margin: 0;
}

.flash-error p + p {
    margin-top: 8px;
}

.flash-error__close {
    display: none;
}

.js .flash-error {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 100;
    box-sizing: border-box;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding-right: 42px;
    border: 1px solid #e4a8ad;
    border-left: 4px solid #b4232c;
    box-shadow: 0 12px 28px rgb(23 32 42 / 18%);
    transform: translate(-50%, -50%);
}

.js .flash-error__close {
    position: absolute;
    top: 7px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 22px;
}

.app-tooltip {
    position: fixed;
    z-index: 110;
    box-sizing: border-box;
    max-width: min(320px, calc(100vw - 16px));
    padding: 7px 10px;
    color: #fff;
    background: #263746;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgb(23 32 42 / 20%);
    font-size: 13px;
    line-height: 1.35;
    pointer-events: none;
}

@media (hover: none), (pointer: coarse) {
    .app-tooltip {
        display: none;
    }
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.data-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #d9e0e7;
    border-radius: 6px;
}

.data-table-wrapper.data-table-wrapper--bank-changes,
.data-table-wrapper.data-table-wrapper--booking-notices,
.data-table-wrapper.data-table-wrapper--accounting-review,
.data-table-wrapper.data-table-wrapper--payment-pending {
    max-height: min(420px, 60vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.data-table-wrapper--bank-changes .data-table th,
.data-table-wrapper--booking-notices .data-table th,
.data-table-wrapper--accounting-review .data-table th,
.data-table-wrapper--payment-pending .data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e3e8ed;
}

.data-table th {
    color: var(--club-table-header-text);
    background: var(--club-table-header);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

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

.data-table__detail {
    display: block;
    max-width: 340px;
    margin-top: 4px;
    color: #687786;
    line-height: 1.45;
}

.data-table__reason {
    max-width: 420px;
    overflow-wrap: anywhere;
}

.data-table__note {
    max-width: 460px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.data-table__actions {
    text-align: right !important;
}

.data-table__actions form {
    display: inline-block;
}

.action-group {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.action-group form {
    display: flex;
}

.user-table {
    table-layout: fixed;
    font-size: 13px;
}

.user-table th:nth-child(3) {
    width: 150px;
}

.user-table th:nth-child(4) {
    width: 190px;
}

.user-table th,
.user-table td {
    padding: 10px 12px;
    overflow-wrap: anywhere;
}

.user-table__detail {
    max-width: none;
    margin-top: 2px;
    font-size: 12px;
}

.user-table__meta {
    display: grid;
    gap: 8px;
}

.user-table__meta > div {
    display: grid;
    gap: 2px;
}

.user-table__meta-label {
    color: #687786;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-table .data-table__actions {
    text-align: left !important;
}

.user-table .action-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
}

.user-table .action-group form {
    display: block;
    width: 100%;
}

.user-table .action-group .button {
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 6px 8px;
    font-size: 13px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.license-administration {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #cbd5df;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.license-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 0 0 20px;
    overflow: hidden;
    background: #d9e0e7;
    border: 1px solid #d9e0e7;
    border-radius: 6px;
}

.license-facts div {
    min-width: 0;
    padding: 14px 16px;
    background: #fff;
}

.license-facts dt {
    margin-bottom: 5px;
    color: #52606d;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.license-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.license-actions {
    display: grid;
    grid-template-columns: minmax(0, 900px) auto;
    align-items: end;
    justify-content: start;
    gap: 16px;
    max-width: none;
}

.license-actions.form-panel {
    max-width: none;
}

.license-activation-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
    min-width: 0;
}

.license-check-form {
    margin: 0;
}

.license-activation-form .button,
.license-check-form .button {
    margin-top: 0;
}

@media (max-width: 1250px) {
    .license-actions {
        grid-template-columns: 1fr;
    }
}

.filter-bar input:not([type="hidden"]),
.filter-bar select {
    width: min(100%, 440px);
    min-height: 42px;
    padding: 9px 12px;
    color: #17202a;
    background: #fff;
    border: 1px solid #9aa8b6;
    border-radius: 4px;
    font: inherit;
}

.filter-bar select {
    width: min(100%, 240px);
}

.filter-bar input:focus,
.filter-bar select:focus,
.form-field input:focus,
.form-field select:focus {
    border-color: #16324f;
    outline: 3px solid rgb(22 50 79 / 18%);
}

.text-link {
    color: var(--club-link);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-link--header {
    margin-top: 10px;
}

/* Formulare und Einstellungen */
.form-panel {
    max-width: 820px;
    padding: 24px;
    background: #fff;
    border: 1px solid #d9e0e7;
    border-radius: 6px;
}

.settings-form {
    max-width: 1100px;
}

.mail-settings-form .form-field {
    align-content: start;
}

.mail-template-panel {
    max-width: 900px;
    margin-top: 20px;
}

.mail-template-panel .form-field {
    margin-top: 16px;
}

.mail-template-panel code,
.mail-template-default {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

#personal-data {
    max-width: none;
}

.profile-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.profile-panels > .form-panel {
    display: flex;
    min-width: 0;
    max-width: none;
    flex-direction: column;
    margin-top: 0;
}

.profile-panels #totp > .settings-form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.profile-panels .form-actions {
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 26px;
}

.form-panel--compact {
    max-width: 620px;
}

.form-panel + .form-panel {
    margin-top: 24px;
}

.profile-panels > .form-panel + .form-panel {
    margin-top: 0;
}

.account-access-panel h2 {
    margin: 0 0 10px;
    font-size: 20px;
}

.account-access-panel p {
    margin: 0 0 12px;
}

.account-access-panel form + .account-password-form,
.account-access-panel p + .account-password-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #d9e0e7;
}

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

.organization-colors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.organization-colors input[type="color"] {
    height: 48px;
    padding: 4px;
    cursor: pointer;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-grid--profile-contact .form-field {
    align-content: start;
}

.form-grid--account-access .form-field {
    align-content: start;
}

.form-field--wide {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: 14px;
    font-weight: 700;
}

.label-optional {
    color: #687786;
    font-size: 12px;
    font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    color: #17202a;
    background: #fff;
    border: 1px solid #9aa8b6;
    border-radius: 4px;
    font: inherit;
}

.form-field input[readonly],
.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled {
    color: #52606d;
    background: #edf2f6;
    border-color: #c5d0da;
    cursor: not-allowed;
}

.form-field input[readonly]:hover,
.form-field input:disabled:hover,
.form-field select:disabled:hover {
    border-color: #8292a1;
}

.form-field input[aria-invalid="true"] {
    border-color: #b4232c;
}

.form-field__error {
    color: #a51c26;
    font-size: 13px;
}

.totp-qr {
    display: grid;
    justify-items: start;
    gap: 10px;
    margin-bottom: 20px;
}

.totp-qr[hidden] {
    display: none;
}

.totp-qr__image svg {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 100%;
}

.totp-recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
    padding-left: 22px;
    font-size: 17px;
}

.totp-recovery-codes code {
    white-space: nowrap;
}

@media (max-width: 560px) {
    .totp-recovery-codes {
        grid-template-columns: 1fr;
    }
}

.form-field textarea {
    min-height: 112px;
    line-height: 1.5;
    resize: vertical;
}

.form-hint {
    color: #52606d;
    font-size: 13px;
    line-height: 1.4;
}

.compensation-options {
    gap: 8px;
    padding-top: 4px;
}

.page-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.page-header__actions .text-link--header {
    margin-top: 0;
}

.settings-form__notice {
    margin-top: 22px;
    margin-bottom: 0;
}

.settings-test-form {
    margin-top: 22px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}

.form-actions .button {
    margin-top: 0;
}

.assignment-form {
    max-width: 980px;
}

.form-section {
    min-width: 0;
    margin: 0;
    padding: 0 0 24px;
    border: 0;
}

.form-section + .form-section {
    padding-top: 24px;
    border-top: 1px solid #d9e0e7;
}

.form-section legend {
    width: 100%;
    margin-bottom: 16px;
    padding: 0;
    font-size: 18px;
    font-weight: 700;
}

.access-setup {
    margin: 0;
    padding: 0;
    border: 0;
}

.access-setup legend {
    margin-bottom: 4px;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading-row h2 {
    margin: 0;
    font-size: 20px;
}

.form-section__empty {
    margin: 0;
    color: #52606d;
}

.form-section__label {
    margin: 18px 0 10px;
    color: #3f4d5a;
    font-size: 14px;
    font-weight: 700;
}

.two-factor-global-option {
    padding-bottom: 14px;
    border-bottom: 1px solid #e3e8ed;
}

.organization-settings-form {
    max-width: 900px;
}

.organization-logo-section {
    max-width: 900px;
}

.organization-logo-preview,
.organization-logo-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 14px;
}

.organization-logo-preview {
    align-items: center;
    margin-bottom: 16px;
}

.organization-logo-preview img {
    display: block;
    width: 120px;
    height: 80px;
    padding: 6px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #d9e0e7;
}

.organization-logo-form .form-field {
    flex: 1 1 260px;
    max-width: 430px;
}

.organization-logo-form .button,
.organization-logo-preview .button {
    margin-top: 0;
}

/* Footer und Handbuch */
.app-footer {
    margin-top: auto;
    padding: 22px 20px;
    color: #52606d;
    background: #fff;
    border-top: 1px solid #d9e0e7;
    font-size: 13px;
}

.app-footer__inner {
    display: flex;
    justify-content: space-between;
    gap: 16px 40px;
    width: min(1120px, 100%);
    margin: 0 auto;
}

.app-footer__identity,
.app-footer__details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-footer__details {
    align-items: flex-end;
    text-align: right;
}

.app-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 18px;
}

.app-footer a {
    color: var(--club-link);
}

.manual-layout {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: 42px;
}

.manual-nav {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 16px;
    border-right: 1px solid #d9e0e7;
}

.manual-nav a {
    padding: 8px 0;
    color: var(--club-link);
    text-decoration: none;
}

.manual-nav a:hover,
.manual-nav a:focus-visible {
    text-decoration: underline;
}

.manual-nav a[aria-current="page"] {
    padding-left: 10px;
    border-left: 3px solid var(--club-action);
    color: #1e2934;
    font-weight: 700;
}

.manual-content h1 {
    margin: 0 0 18px;
    font-size: 26px;
}

.manual-content h2 {
    margin: 32px 0 12px;
    font-size: 21px;
}

.manual-content p,
.manual-content li {
    line-height: 1.65;
}

.manual-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 18px 0 24px;
    border: 1px solid #d9e0e7;
}

.manual-content ol,
.manual-content ul {
    padding-left: 22px;
}

/* Auswahlfelder und Abteilungsteam */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
}

.checkbox-grid--functions {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 36px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.checkbox-option input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--club-action);
}

.checkbox-option span {
    min-width: 0;
}

.form-field .checkbox-option input {
    min-height: 18px;
}

.login-cancel-form {
    margin-top: 10px;
}

.login-cancel-form .button {
    width: 100%;
    margin-top: 0;
}

.department-assignment-list {
    border-top: 1px solid #e3e8ed;
}

.department-assignment {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #e3e8ed;
}

.department-assignment__name {
    padding-top: 8px;
}

.team-add-form {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.7fr);
    align-items: start;
    gap: 22px 28px;
    max-width: none;
    margin-bottom: 24px;
}

.team-add-form__person select {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    color: #17202a;
    background: #fff;
    border: 1px solid #9aa8b6;
    border-radius: 4px;
    font: inherit;
}

.team-add-form__person select:focus {
    border-color: #16324f;
    outline: 3px solid rgb(22 50 79 / 18%);
}

.team-function-options {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.team-function-options legend {
    margin-bottom: 7px;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
}

.team-add-form__submit {
    grid-column: 1 / -1;
    justify-self: end;
    margin-top: 0;
    white-space: nowrap;
}

.team-table .data-table {
    min-width: 880px;
}

.team-member-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.checkbox-grid--team-row {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 4px 12px;
}

.empty-state {
    padding: 28px;
    color: #52606d;
    text-align: center;
    background: #fff;
    border: 1px solid #d9e0e7;
    border-radius: 6px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge--success {
    color: #145c3f;
    background: #dff3e9;
}

.status-badge--warning {
    color: #6b4f00;
    background: #fff1c7;
}

.status-badge--neutral {
    color: #4d5c68;
    background: #e8edf1;
}

.status-badge--info {
    color: #174f78;
    background: #e2eff8;
}

.status-badge--danger {
    color: #721c24;
    background: #fbeaec;
}
