
.data-grid-group {
    display: flex;
    flex-direction: column;
    gap: 8px;

    .grid-actions-bar {
        display: flex;
        align-items: center;
        /*border: 1px dashed lightpink;*/
        gap: 8px;
        /*justify-content: flex-end;*/

        .spacer {
            flex-grow: 1;
        }

        .expand-collapse-btn {
            cursor: pointer !important;
            width: 18px;
            height: 18px;
            padding: 4px;
            border-radius: 4px;
            transition: background-color 0.3s;

            &:hover {
                background-color: #FFEAC6;
            }
        }
    }

    .data-grid-block {
        display: flex;
        /*align-items: start;*/
        /*gap: 16px;*/
        position: relative;

        .data-grid-area {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }

        .data-grid-actions-area {
            width: 240px;
            opacity: 1;
            margin-left: 16px;
            transition: width 0.3s, opacity 0.2s;
            contain: content;

            &.collapsed {
                width: 0;
                opacity: 0;
                margin-left: 0;
            }

            .data-grid-actions-block {
                height: 100%;
                border-radius: 6px;
                background-color: #F6EFE3;
                padding: 14px;
                box-sizing: border-box;
                display: flex;
                flex-direction: column;
                gap: 4px;
            }

            .data-grid-action-items-host {
                display: flex;
                flex-direction: column;
                gap: 4px;
            }

            .data-grid-action-item {
                color: #202020;
                cursor: pointer;
                display: flex;
                align-items: center;
                gap: 4px;
                padding: 6px;
                border-radius: 5px;
                transition: background-color 0.2s;

                &:hover {
                    background-color: #E5DCCD;
                }

                > img[data-rel=icon] {
                    width: 16px;
                    height: 16px;
                }
            }
        }
    }
}

/* Data grid table */
table.__data-grid {
    --bg-alt: #f3f0ec;
    --bg-hover: #dfdace;
    --border-color: #E5DCCD;

    border-collapse: collapse;
    cursor: default;

    td, th {
        border: 1px solid var(--border-color);
        text-align: left;
    }

    td {
        padding: 6px 10px 6px 10px;
        transition: background-color 0.3s;

        &[data-rel=more] {
            img {
                width: 16px;
                height: 16px;
                cursor: pointer;

                &:hover {
                    opacity: 0.5;
                }
            }
        }
    }

    th {
        padding: 10px 10px 10px 10px;
        background-color: #D1C3AB;
        color: #202020;
    }

    td.serial, th.serial {
        width: 36px;
        text-align: center;
    }

    .center-align {
        text-align: center;
    }

    .left-align {
        text-align: left;
    }

    .right-align {
        text-align: right;
    }

    &.no-vertical-border {
        td, th {
            border-left: none !important;
            border-right: none !important;
        }
    }

    &.alt-row-bg {
        tr:nth-child(even) {
            > td {
                background-color: var(--bg-alt);
            }
        }
    }

    tr:hover {
        > td {
            background-color: var(--bg-hover) !important;
        }
    }
}

/* Popup menu for each table record item. */
.data-grid-record-menu {
    /*background-color: #f4d198;*/
    background-color: #DC9314;
    display: flex;
    flex-direction: column;
    border-radius: 4px;

    > .menuitem {
        display: flex;
        align-items: center;
        padding: 4px 8px;
        transition: background-color 0.3s;
        cursor: pointer;

        &:hover {
            background-color: #f4d198;
        }

        &:not(:last-child) {
            border-bottom: 1px solid #C87F00;
        }

        &:first-child {
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
        }

        &:last-child {
            border-bottom-left-radius: 4px;
            border-bottom-right-radius: 4px;
        }
    }
}
