﻿.zahlwerk-modal-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-index-modal-overlay);
    overflow: hidden;
}

    .zahlwerk-modal-overlay.hidden {
        display: none;
    }

    .zahlwerk-modal-overlay.visible {
        display: flex;
    }

.zahlwerk-modal-dialog {
    display: flex;
    flex-direction: column;
    height: auto;
    width: fit-content;
    min-width: 0;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 24px);
    background-color: var(--Zahlwerk-white);
    /* border-radius: 12px; */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: var(--z-index-modal-dialog);
}

    .zahlwerk-modal-dialog > form {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0; /* critical: allow inner children to shrink */
    }

.zahlwerk-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 26px;
    border-bottom: 1px solid var(--Zahlwerk-light-primary);
}

    .zahlwerk-modal-header .zahlwerk-modal-title {
        font-size: 24px;
        font-weight: 400;
    }

    .zahlwerk-modal-header .btn-close {
        background: url('/images/close-icon.svg') no-repeat center center;
        border: none;
        font-size: 20px;
        cursor: pointer;
    }

.zahlwerk-modal-body {
    padding: 22px 26px;
    flex-direction: column;
    gap: 30px;
    min-height: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

    .zahlwerk-modal-body::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    .zahlwerk-modal-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .zahlwerk-modal-body::-webkit-scrollbar-thumb {
        background: var(--Zahlwerk-primary);
        border-radius: 4px;
    }

.zahlwerk-modal-input-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.modal-input-pair {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}
.modal-input-pair .input-container {
    flex: 1;
    min-width: 48%;
}

.create-user-modal .modal-input-pair .input-container.role-delete-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.create-user-modal .role-delete-container .dropdown-wrapper {
    flex: 1 1 auto;
    min-width: 0;
}

.create-user-modal .delete-row-button {
    background: transparent;
    border: none;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.create-user-modal .delete-row-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.create-user-modal .delete-row-button img {
    width: 28px;
    height: 28px;
}

.create-user-validation {
    margin-top: 12px;
    color: var(--Zahlwerk-error);
    font-size: 14px;
}
.zahlwerk-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 26px;
    border-top: 1px solid var(--Zahlwerk-light-primary);
}

    .zahlwerk-modal-footer .btn {
        padding: 8px 16px;
        font-size: 14px;
        /* border-radius: 4px; */
        background-color: transparent;
        border: 1px solid var(--Zahlwerk-primary);
        color: var(--Zahlwerk-primary);
        font-size: 16px;
        font-weight: 400;
    }

        .zahlwerk-modal-footer .btn.btn-danger {
            background-color: var(--Zahlwerk-primary);
            color: var(--Zahlwerk-white);
        }

            .zahlwerk-modal-footer .btn.btn-danger:hover {
                color: var(--Zahlwerk-primary);
            }

        .zahlwerk-modal-footer .btn:hover {
            background-color: var(--Zahlwerk-soft-light-primary);
        }

        .zahlwerk-modal-footer .btn:disabled {
            background-color: var(--Zahlwerk-disabled-grey);
            border-color: var(--Zahlwerk-disabled-grey);
            color: var(--Zahlwerk-white);
        }

.zahlwerk-modal-text {
    margin-bottom: 0;
}

    .zahlwerk-modal-text span {
        display: block;
        margin-bottom: 40px;
        font-size: 24px;
        line-height: 32px;
    }

.zahlwerk-modal-header,
.zahlwerk-modal-footer {
    flex: 0 0 auto;
}

.zahlwerk-modal-body-grid {
    display: grid;
    column-gap: 20px;
    row-gap: 20px;
    align-items: start;
    min-height: 0;
}
    .zahlwerk-modal-body-grid .modal-input-pair {
        display: contents;
    }

        .zahlwerk-modal-body-grid .modal-input-pair.no-contents {
            display: grid;
            grid-column: 1 / -1;
            grid-template-columns: repeat(2, minmax(280px,1fr));
            column-gap: 20px;
        }

    .zahlwerk-modal-body-grid.two-col {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }

    .zahlwerk-modal-body-grid > h4 {
        margin: 0;
        align-self: center;
    }

    .zahlwerk-modal-body-grid .static-text {
        justify-self: start;
        padding: 8px 12px;
        /* border-radius: 4px; */
        border: 1px solid var(--Zahlwerk-light-primary);
        background: var(--Zahlwerk-soft-light-primary);
        width: 100%;
        align-self: center;
    }

.grid-span-2 {
    grid-column: 1 / -1;
}

/* =====================================================
   ANNUAL PLANNING ADJUST MODALS (shared base)
   Used by result/liquidity/imputed-costs adjust monthly modals
   ===================================================== */
.annual-planning-adjust-modal {
    --ap-modal-header-padding: 30px;
    --ap-modal-footer-padding: 30px;
    --ap-modal-body-padding: 60px;

    height: 100vh;
    width: 1600px;
    max-height: calc(100vh - 60px);
    max-width: calc(100vw - 60px);
    display: flex;
    flex-direction: column;
    background-color: var(--Zahlwerk-white);
    /* border-radius: 12px; */
    overflow: hidden;
}

.annual-planning-adjust-modal .modal-header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--ap-modal-header-padding);
    font-size: 20px;
    line-height: 1.6;
    border-bottom: 1px solid var(--Zahlwerk-light-primary);
    background-color: var(--Zahlwerk-white);
    z-index: 1;
}

.annual-planning-adjust-modal .modal-header h3 {
    margin-bottom: 0;
    font-size: 24px;
    font-weight: 400;
    line-height: 32px;
}

.annual-planning-adjust-modal .modal-header .close-button {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 0;
    background: transparent;
}

.annual-planning-adjust-modal .modal-header .close-button img {
    width: 24px;
    height: 24px;
    display: block;
}

.annual-planning-adjust-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    background-color: var(--Zahlwerk-white);
    display: flex;
    padding: var(--ap-modal-body-padding);
    gap: 20px;
    justify-content: end;
    flex-wrap: wrap;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--Zahlwerk-primary) transparent;
}

.annual-planning-adjust-modal .modal-footer {
    padding: var(--ap-modal-footer-padding);
    background-color: var(--Zahlwerk-white);
    border-top: 1px solid var(--Zahlwerk-light-primary);
}

.annual-planning-adjust-modal .modal-header,
.annual-planning-adjust-modal .modal-footer {
    flex: 0 0 auto;
}

.zahlwerk-side-modal {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.zahlwerk-side-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--Zahlwerk-light-primary);
}

.zahlwerk-side-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--Zahlwerk-black);
}

.zahlwerk-side-modal__body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px 20px;
}

.zahlwerk-side-modal__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--Zahlwerk-light-primary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@media (max-width: 720px) {
    .zahlwerk-modal-body-grid.two-col {
        grid-template-columns: 1fr;
    }
}
