smart-sort-panel,
smart-group-panel,
smart-column-panel,
smart-multi-column-filter-panel {
    display: block;
    min-width: 375px;
    width: var(--smart-grid-panel-default-width);
    height: var(--smart-grid-panel-default-height);
    border: var(--smart-border-width) solid var(--smart-border);
    padding: var(--smart-grid-panel-padding);
    overflow: auto;
    background: var(--smart-background);
    color: var(--smart-background-color);
    border-top-right-radius: var(--smart-border-top-right-radius);
    border-top-left-radius: var(--smart-border-top-left-radius);
    border-bottom-left-radius: var(--border-bottom-left-radius);
    border-bottom-right-radius: var(--smart-border-bottom-right-radius);
    font-family: var(--smart-font-family);
    font-size: var(--smart-font-size);
}

    .smart-sort-panel .smart-sortable-container,
    .smart-group-panel .smart-sortable-container smart-column-panel smart-sortable {
        margin-bottom: var(--smart-grid-panel-padding);
    }

        .smart-sort-panel .smart-sortable-container:empty:after,
        .smart-group-panel .smart-sortable-container:empty:after,
        .smart-multi-column-filter-panel .smart-filter-panel-items-container:empty:after {
            margin-top: calc(var(--smart-grid-panel-vertical-offset) / 2);
            margin-bottom: calc(var(--smart-grid-panel-vertical-offset) / 2);
            opacity: 0.7;
        }

        .smart-sort-panel .smart-sortable-container:empty:after {
            content: attr(no-sorting);
        }

    .smart-group-panel .smart-sortable-container:empty:after {
        content: attr(no-grouping);
    }

    .smart-multi-column-filter-panel .smart-filter-panel-items-container:empty:after {
        content: attr(no-filters);
    }

    .smart-sort-panel .smart-grid-panel-container-footer,
    .smart-group-panel .smart-grid-panel-container-footer,
    .smart-column-panel .smart-grid-panel-container-footer,
    .smart-multi-column-filter-panel .smart-grid-panel-container-footer {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

        .smart-sort-panel .smart-grid-panel-container-footer > smart-input,
        .smart-group-panel .smart-grid-panel-container-footer > smart-input {
            min-width: 215px;
            width: 40%;
        }

    .smart-sort-panel .smart-grid-panel-buttons-container,
    .smart-group-panel .smart-grid-panel-buttons-container,
    .smart-column-panel .smart-grid-panel-buttons-container,
    .smart-multi-column-filter-panel .smart-grid-panel-buttons-container {
        width: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

        .smart-sort-panel .smart-grid-panel-buttons-container span:hover,
        .smart-group-panel .smart-grid-panel-buttons-container span:hover,
        .smart-column-panel .smart-grid-panel-buttons-container span:hover,
        .smart-multi-column-filter-panel .smart-grid-panel-buttons-container span:hover,
        .smart-multi-column-filter-panel .smart-filter-panel-add-filter-button:hover,
        .smart-sort-panel .smart-grid-panel-item-close-button:hover,
        .smart-group-panel .smart-grid-panel-item-close-button:hover,
        .smart-multi-column-filter-panel .smart-grid-panel-item-close-button:hover {
            color: var(--smart-grid-panel-color-hover);
            cursor: pointer;
        }

        .smart-sort-panel .smart-grid-panel-buttons-container span:active,
        .smart-sort-panel .smart-grid-panel-buttons-container span:focus,
        .smart-group-panel .smart-grid-panel-buttons-container span:active,
        .smart-group-panel .smart-grid-panel-buttons-container span:focus,
        .smart-column-panel .smart-grid-panel-buttons-container span:active,
        .smart-column-panel .smart-grid-panel-buttons-container span:focus,
        .smart-multi-column-filter-panel .smart-grid-panel-buttons-container span:active,
        .smart-multi-column-filter-panel .smart-grid-panel-buttons-container span:focus,
        .smart-multi-column-filter-panel .smart-filter-panel-add-filter-button:active,
        .smart-multi-column-filter-panel .smart-filter-panel-add-filter-button:focus {
            color: var(--smart-primary);
        }

        .smart-sort-panel .smart-grid-panel-buttons-container span:focus,
        .smart-group-panel .smart-grid-panel-buttons-container span:focus,
        .smart-column-panel .smart-grid-panel-buttons-container span:focus,
        .smart-multi-column-filter-panel .smart-grid-panel-buttons-container span:focus,
        .smart-multi-column-filter-panel .smart-filter-panel-add-filter-button:focus {
            outline: none;
        }

        .smart-sort-panel .smart-grid-panel-buttons-container .smart-grid-panel-apply-button,
        .smart-group-panel .smart-grid-panel-buttons-container .smart-grid-panel-apply-button,
        .smart-column-panel .smart-grid-panel-buttons-container .smart-grid-panel-apply-button,
        .smart-multi-column-filter-panel .smart-grid-panel-buttons-container .smart-grid-panel-apply-button {
            margin-left: 15px;
            font-weight: bold;
        }

    .smart-sort-panel .smart-grid-panel-item,
    .smart-group-panel .smart-grid-panel-item,
    .smart-column-panel .smart-grid-panel-item,
    .smart-multi-column-filter-panel .smart-grid-panel-item {
        display: flex;
        align-items: center;
        margin-top: calc(var(--smart-grid-panel-vertical-offset) / 2);
        margin-bottom: calc(var(--smart-grid-panel-vertical-offset) / 2);
        width: calc(100% - var(--smart-sortable-handle-size));
        height: var(--smart-grid-panel-item-height);
        min-height: var(--smart-grid-panel-item-height);
        background-color: var(--smart-background);
    }

    .smart-multi-column-filter-panel .smart-grid-panel-item {
        width: 100%;
    }

    .smart-sort-panel .smart-grid-panel-item.dragged,
    .smart-group-panel .smart-grid-panel-item.dragged {
        opacity: 0.7;
    }

    .smart-sort-panel .smart-grid-panel-item-close-button,
    .smart-group-panel .smart-grid-panel-item-close-button,
    .smart-multi-column-filter-panel .smart-grid-panel-item-close-button {
        display: flex;
        justify-content: center;
        width: 20px;
    }

        .smart-sort-panel .smart-grid-panel-item-close-button:active,
        .smart-sort-panel .smart-grid-panel-item-close-button:focus,
        .smart-group-panel .smart-grid-panel-item-close-button:active,
        .smart-group-panel .smart-grid-panel-item-close-button:focus,
        .smart-multi-column-filter-panel .smart-grid-panel-item-close-button:active,
        .smart-multi-column-filter-panel .smart-grid-panel-item-close-button:focus {
            color: var(--smart-primary);
        }

        .smart-sort-panel .smart-grid-panel-item-close-button:focus,
        .smart-group-panel .smart-grid-panel-item-close-button:focus,
        .smart-multi-column-filter-panel .smart-grid-panel-item-close-button:focus {
            outline: none;
        }

        .smart-sort-panel .smart-grid-panel-item-close-button:after,
        .smart-group-panel .smart-grid-panel-item-close-button:after,
        .smart-multi-column-filter-panel .smart-grid-panel-item-close-button:after {
            font-family: "smart-icons";
        }

    .smart-sort-panel[close-button-position="right"] .smart-grid-panel-item-close-button,
    .smart-group-panel[close-button-position="right"] .smart-grid-panel-item-close-button,
    .smart-multi-column-filter-panel[close-button-position="right"] .smart-grid-panel-item-close-button {
        order: 1;
    }

    .smart-sort-panel[close-button-position="right"] .smart-sortable-container,
    .smart-group-panel[close-button-position="right"] .smart-sortable-container,
    .smart-multi-column-filter-panel[close-button-position="right"] .smart-sortable-container {
        align-items: flex-end;
    }

    .smart-sort-panel .smart-grid-panel-label-by,
    .smart-group-panel .smart-grid-panel-label-by {
        padding: 5px;
        width: 60px;
        flex-grow: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .smart-sort-panel .smart-grid-panel-field-container,
    .smart-group-panel .smart-grid-panel-field-container {
        height: 100%;
        width: 100px;
        flex-grow: 3;
    }

    .smart-sort-panel .smart-grid-panel-field-selection,
    .smart-group-panel .smart-grid-panel-field-selection {
        height: 100%;
        width: 100%;
    }

    .smart-sort-panel .smart-grid-panel-from,
    .smart-group-panel .smart-grid-panel-from {
        display: flex;
        justify-content: center;
        padding: 5px;
        width: 40px;
        flex-grow: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }

    .smart-sort-panel .smart-grid-panel-direction,
    .smart-group-panel .smart-grid-panel-direction {
        display: flex;
        width: 115px;
        flex-grow: 2;
        height: 100%;
        background-color: var(--smart-surface);
    }

        .smart-sort-panel .smart-grid-panel-direction:focus,
        .smart-group-panel .smart-grid-panel-direction:focus {
            outline: none;
            box-shadow: 0 0 0 1px var(--smart-primary);
        }

        .smart-sort-panel .smart-grid-panel-direction,
        .smart-sort-panel .smart-grid-panel-direction > div,
        .smart-group-panel .smart-grid-panel-direction,
        .smart-group-panel .smart-grid-panel-direction > div {
            border-top-right-radius: var(--smart-border-top-right-radius);
            border-top-left-radius: var(--smart-border-top-left-radius);
            border-bottom-left-radius: var(--smart-border-bottom-left-radius);
            border-bottom-right-radius: var(--smart-border-bottom-right-radius);
        }

            .smart-sort-panel .smart-grid-panel-direction > div,
            .smart-group-panel .smart-grid-panel-direction > div {
                display: flex;
                align-items: center;
                justify-content: center;
                margin: 3px;
                width: calc(50% - 6px);
                height: calc(100% - 6px);
            }

                .smart-sort-panel .smart-grid-panel-direction > div.selected,
                .smart-group-panel .smart-grid-panel-direction > div.selected {
                    background-color: var(--smart-primary);
                    color: var(--smart-primary-color);
                }

    .smart-group-panel .smart-grid-panel-expand-collapse {
        justify-content: flex-end;
    }

    .smart-group-panel .smart-group-panel-expand-button {
        margin-left: 15px;
    }

.smart-column-panel {
    --smart-grid-panel-item-height: 20px;
    min-width: 100px;
}

    .smart-column-panel > .smart-container,
    .smart-column-panel.smart-container {
        display: flex;
        flex-direction: column;
    }

    .smart-column-panel .smart-column-panel-find-container {
        display: flex;
        align-items: center;
        border-bottom: 2px solid var(--smart-border);
        height: var(--smart-editor-height);
        position: relative;
    }

        .smart-column-panel .smart-column-panel-find-container.no-results:after {
            content: attr(no-results);
            position: absolute;
            top: calc(100% + 10px);
        }

        .smart-column-panel .smart-column-panel-find-container input {
            outline: none;
            border: none;
            width: calc(100% - 16px);
            height: 100%;
            font-family: var(--smart-font-family);
            font-size: var(--smart-font-size);
            background: var(--smart-grid-panel-background);
            color: var(--smart-grid-panel-color);
        }

        .smart-column-panel .smart-column-panel-find-container .clear-button {
            width: 16px;
            cursor: pointer;
        }

            .smart-column-panel .smart-column-panel-find-container .clear-button:after {
                font-family: var(--smart-font-family-icon);
                display: flex;
                align-items: center;
                justify-content: center;
            }

    .smart-column-panel smart-sortable {
        flex: 5;
        min-height: 50px;
        overflow: auto;
    }

    .smart-column-panel .smart-column-panel-label {
        margin-left: 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

        .smart-column-panel .smart-column-panel-label.icon {
            position: relative;
            padding-left: var(--smart-column-icon-size);
        }

            .smart-column-panel .smart-column-panel-label.icon:after {
                content: '';
                position: absolute;
                left: 0;
                top: 0;
                width: var(--smart-column-icon-size);
                height: 100%;
                background-repeat: no-repeat;
                background-position: center;
            }

    .smart-column-panel .smart-grid-panel-buttons-container {
        width: 100%;
        justify-content: flex-end;
    }

    .smart-column-panel .toggle-visibility {
        width: 16px;
        height: 16px;
        font-family: var(--smart-font-family-icon);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .smart-column-panel .toggle-visibility.disable-toggle {
            pointer-events: none;
        }

        .smart-column-panel .clear-button:focus,
        .smart-column-panel .toggle-visibility:focus {
            outline: none;
            color: var(--smart-primary);
        }

        .smart-column-panel .toggle-visibility:after {
        }

        .smart-column-panel .toggle-visibility.hidden:after {
        }

.smart-multi-column-filter-panel > .smart-container {
    display: grid;
    grid-auto-rows: 1fr max-content;
    grid-row-gap: var(--smart-grid-panel-padding);
}

.smart-multi-column-filter-panel .smart-filter-panel-items-container {
    overflow: auto;
}

.smart-multi-column-filter-panel .smart-grid-panel-item {
    display: grid;
    columns: 5;
    grid-template-columns: var(--smart-multi-column-filter-panel-template-columns);
    grid-gap: var(--smart-grid-panel-padding);
}

    .smart-multi-column-filter-panel .smart-grid-panel-item > * {
        width: 100%;
    }

.smart-multi-column-filter-panel[close-button-position="right"] {
    --smart-multi-column-filter-panel-template-columns: 60px 2fr 3fr 3fr 10px;
}

@media (pointer:coarse) {
    .smart-sort-panel .smart-grid-panel-item-close-button:after,
    .smart-group-panel .smart-grid-panel-item-close-button:after,
    .smart-multi-column-filter-panel .smart-grid-panel-item-close-button:after {
        font-size: 16px;
    }
}

/* --- Right-To-Left --- */

.smart-group-panel[right-to-left] .smart-group-panel-expand-button,
.smart-group-panel[right-to-left] .smart-group-panel-collapse-button,
.smart-group-panel[right-to-left] .smart-group-panel-cancel-button,
.smart-group-panel[right-to-left] .smart-group-panel-apply-button,
.smart-group-panel[right-to-left] .smart-grid-panel-label-by,
.smart-group-panel[right-to-left] .smart-grid-panel-from,
.smart-multi-column-filter-panel[right-to-left] .smart-grid-panel-apply-button,
.smart-multi-column-filter-panel[right-to-left] .smart-grid-panel-cancel-button,
.smart-multi-column-filter-panel[right-to-left] .smart-filter-panel-add-filter-button,
.smart-multi-column-filter-panel[right-to-left] .smart-grid-panel-item-close-button + div {
    direction: rtl;
}

/* --- */
