﻿.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 80vh;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--Zahlwerk-primary) transparent;
}

.table-wrapper::-webkit-scrollbar {
    width: var(--scrollbar-size, 8px);
    height: var(--scrollbar-size, 8px);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--Zahlwerk-primary);
    border-radius: 4px;
}

    .table-wrapper::-webkit-scrollbar-thumb:hover {
        background-color: var(--Zahlwerk-dark-primary);
    }

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrapper::-webkit-scrollbar-button,
.table-wrapper::-webkit-scrollbar-button:single-button {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

.header-container {
    position: sticky;
    top: 0;
    left: 0;
    z-index: var(--z-index-page-header-container);
    background-color: transparent;
}

.header-settings {
    border-bottom: 1px solid var(--Zahlwerk-primary);
    color: var(--Zahlwerk-black);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--Zahlwerk-light-primary);
    white-space: nowrap;
}

.header-left {
    flex: 1 1 auto; 
    min-width: 0;
    white-space: normal;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    flex: 0 0 auto;
    margin-left: 20px;
}

.header-title {
    margin: 10px 20px;
    font-size: 20px;
    font-weight: 400;
    line-height: 32px;
}

.details-table-wrapper {
    border: 1px solid var(--Zahlwerk-light-primary);
    border-radius: 5px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease-in-out, border-radius 0.2s ease-in-out;
}

    .details-table-wrapper.expanded {
        border-color: var(--Zahlwerk-primary);
    }

.summary-table-wrapper {
    border: 1px solid var(--Zahlwerk-light-primary);
    border-left: none;
    border-right: none;
    margin-bottom: 20px;
    transition: border-color 0.2s ease-in-out, border-radius 0.2s ease-in-out;
}

.table {
    border-collapse: collapse;
    background-color: var(--Zahlwerk-white);
    table-layout: auto;
    width: 100%;
    margin: 0;
}
    .table th,
    .table td {
        padding: 0 10px;
        text-align: left;
        border: 1px solid var(--Zahlwerk-light-primary);
        border-left: none;
        height: 44px;
        white-space: normal;
        text-overflow: ellipsis;
        overflow: visible;
        vertical-align: middle;
    }

    .table th {
        background-color: var(--Zahlwerk-soft-light-primary);
        font-weight: bold;
        position: sticky;
        top: 0;
        z-index: 2;
        text-align: left;
        overflow: hidden;
    }

    .table td {
        white-space: normal;
        word-wrap: break-word;
        text-align: right;
    }
        .table th:first-child,
        .table td:first-child {
            width: 20%;
            text-align: left;
        }
        .table td:last-child {
            position: sticky;
            right: 0;
            background-color: var(--Zahlwerk-white);
            z-index: 2;
        }
        .table td.money-column {
            text-align: right !important;
        }
    .table .settings-icon {
        margin: 0;
    }

    .table td:has(.settings-icon) {
        text-overflow: clip;
    }

    .table thead tr:last-child th:last-child {
        position: sticky;
        right: -1px;
        z-index: 5;
        box-shadow: inset 1px 0 0 0 var(--Zahlwerk-light-primary);
    }

    .table thead {
        background-color: var(--Zahlwerk-soft-light-primary);
        font-weight: bold;
    }

    .table > :not(:last-child) > :last-child > * {
        border-bottom-color: var(--Zahlwerk-light-primary);
    }

th.sortable {
    /* Remove position: sticky, top, z-index, background-color from here! */
    padding-right: 2em; /* Extra space for arrow */
    cursor: pointer;
}

    th.sortable::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 0.5em;
        transform: translateY(-50%);
        width: 1.5em;
        height: 1.5em;
        background: url('/images/sort-arrow.svg') no-repeat center center;
        background-size: contain;
        z-index: 4;
        pointer-events: none;
    }

.status-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
}

.settings-cell {
    background-color: var(--Zahlwerk-white);
    text-align: center;
    vertical-align: middle;
    padding: 0;
}

    .settings-cell .settings-icon {
        display: inline-block;
        margin: auto;
    }

    .settings-cell.is-disabled {
        pointer-events: none;
        cursor: not-allowed;
    }

        .settings-cell.is-disabled .settings-icon {
            opacity: 0.2;
        }


.note-preview {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.numeric {
    text-align: right !important;
}
.left-aligned {
    text-align: left !important;
}
.summary-divider {
    border: none;
    border-top: 1px solid var(--Zahlwerk-light-primary);
    background: var(--Zahlwerk-light-primary);
    margin: 20px;
    opacity: 1;
}

.collapse-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('/images/arrow-down.svg') no-repeat center;
    background-size: contain;
    transition: transform 0.2s ease-in-out;
}

    .collapse-icon.expanded {
        transform: rotate(180deg);
    }

.details-table {
    margin: 20px;
    height: auto;
    width: auto;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .details-table::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

.details-table-header {
    padding: 10px;
    background-color: var(--Zahlwerk-white);
    border: 1px solid var(--Zahlwerk-light-primary);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-radius 0.2s ease-in-out, border-color 0.2s ease-in-out;
    border-color: var(--Zahlwerk-light-primary);
}

    .details-table-header.expanded {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .details-table-header:hover {
        background-color: var(--Zahlwerk-light-primary);
    }

.collapse-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('/images/arrow-down.svg') no-repeat center;
    background-size: contain;
    transition: transform 0.2s ease-in-out;
}

    .collapse-icon.expanded {
        transform: rotate(180deg);
    }

.tooltip-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.info-button-container {
    position: relative;
    display: inline-block;
}

.info-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    padding: 0;
}

    .info-button img {
        width: 100%;
        height: auto;
    }

.info-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    max-width: min(80vw, 480px);
    background-color: var(--Zahlwerk-light-primary);
    color: var(--Zahlwerk-black);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    z-index: 99999;
    overflow-wrap: anywhere;
    text-align: left;
}

.info-button-container:hover .info-tooltip,
.info-button:focus + .info-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.button-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.info-tooltip {
    overflow-wrap: anywhere;
}

.overview-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.overview-top__left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.overview-top__title {
    font-size: 16px;
    font-weight: 700;
}

.overview-top__subtitle {
    font-size: 12px;
    color: var(--Zahlwerk-light-gray);
    max-width: 620px;
}

.overview-top__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
}

.overview-top__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.overview-top__actions .button-zahlwerk {
    margin-top: 0;
}

.overview-top__action {
    min-width: 170px;
}

    .info-tooltip a {
        text-decoration: underline;
    }

.financial-data-container {
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    padding: 20px;
    gap: 20px;
    background-color: var(--Zahlwerk-white);
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.top-content-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .table-wrapper {
        overflow-x: auto;
        overflow-y: auto;
    }

    .table {
        display: block;
        overflow-x: auto;
        overflow-y: auto;
        white-space: nowrap;
    }

        .table th,
        .table td {
            text-align: center;
            padding: 10px;
        }
}

@media (max-width: 720px) {
    .overview-top__right {
        width: 100%;
        justify-content: flex-start;
    }

    .overview-top__actions {
        justify-content: flex-start;
        width: 100%;
    }

    .overview-top__action {
        width: 100%;
        min-width: 0;
    }
}
