﻿
.smart_grid {
    --smart-gap: 4px;
    --smart-border: #d8dde3;
    --smart-bg: #f8f9fa;
    --smart-bg-input: #ffffff;
    --smart-text: #24384a;
    --smart-value-text: #1d2c3a;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.smart_row {
    display: grid;
    gap: var(--smart-gap);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-bottom: var(--smart-gap);
    align-items: stretch;
    box-sizing: border-box;
}

    .smart_row:last-child {
        margin-bottom: 0;
    }

.smart_cell {
    min-width: 0;
    max-width: 100%;
    min-height: 42px;
    padding: 4px 8px;
    border: 1px solid var(--smart-border);
    border-radius: 4px;
    background: var(--smart-bg);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    box-sizing: border-box;
}

    .smart_cell.smart_has_input {
        background: var(--smart-bg-input);
    }

    .smart_cell > label,
    .smart_cell > .smart_caption {
        display: block;
        margin: 0;
        min-width: 0;
        max-width: 100%;
        font-size: 12px;
        line-height: 12px;
        color: var(--smart-text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: normal;
        box-sizing: border-box;
        flex: 0 0 auto;
    }

    .smart_cell.smart_has_input > label,
    .smart_cell.smart_has_input > .smart_caption {
        margin-bottom: 1px;
    }

    .smart_cell > :not(label):not(.smart_caption):not(.smart_row):not(.smart_section_header),
    .smart_value {
        margin: 0;
        min-width: 0;
        max-width: 100%;
        font-size: 14px;
        line-height: 15px;
        min-height: 15px;
        color: var(--smart-value-text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box;
        flex: 0 0 auto;
        position: relative;
        top: 1px;
    }

.smart_input,
input.smart_input,
select.smart_input,
textarea.smart_input,
.form-control.smart_input {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 15px !important;
    min-height: 15px !important;
    line-height: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    color: var(--smart-value-text);
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    top: -1px;
}

    .smart_input:focus,
    input.smart_input:focus,
    select.smart_input:focus,
    textarea.smart_input:focus,
    .form-control.smart_input:focus {
        border: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

.smart_cell.smart_multiline {
    min-height: 64px;
}

    .smart_cell.smart_multiline > :not(label):not(.smart_caption),
    .smart_cell.smart_multiline .smart_value,
    .smart_cell.smart_multiline .smart_input,
    .smart_cell.smart_multiline textarea.smart_input,
    .smart_cell.smart_multiline .form-control.smart_input {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        height: auto !important;
        min-height: 32px !important;
        line-height: 1.2 !important;
        top: 0;
    }

.smart_wrap > :not(label):not(.smart_caption),
.smart_wrap .smart_value {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-overflow: clip;
}

.smart_section_header {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 8px 0 4px 0;
    padding: 6px 0 2px 0;
    font-size: 12px;
    font-weight: 700;
    color: #526171;
    border-top: 1px solid #e6eaee;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-sizing: border-box;
}

.smart_hidden {
    display: none !important;
}

.smart_cell > div:has(.btn) {
    position: relative;
    top: 1px;
}

.smart_buttons_cell {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    min-height: auto !important;
}

.smart_buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    height: 100%;
}

    .smart_buttons .btn {
        flex: 0 0 auto;
        margin: 0 !important;
    }

.smart_cell.smart_has_input {
    background: white;
}

.smart_buttons_cell {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
}

.smart_commands {
    position: relative;
    top: 1px;
    white-space: normal;
}

    .smart_commands .input-group {
        flex-wrap: wrap;
        gap: 4px;
    }

    .smart_commands .btn,
    .smart_commands .dropdown,
    .smart_commands .form-control,
    .smart_commands .custom-select {
        margin: 0 !important;
    }


@media (max-width: 900px) {
    .smart_cell {
        min-height: 38px;
        padding: 4px 6px;
    }

        .smart_cell > label,
        .smart_cell > .smart_caption {
            font-size: 11px;
            line-height: 11px;
        }

        .smart_value,
        .smart_cell > :not(label):not(.smart_caption):not(.smart_row):not(.smart_section_header) {
            font-size: 13px;
            line-height: 14px;
            min-height: 14px;
        }

    .smart_input,
    input.smart_input,
    select.smart_input,
    textarea.smart_input,
    .form-control.smart_input {
        height: 14px !important;
        min-height: 14px !important;
        line-height: 14px !important;
        font-size: 13px !important;
    }

    .smart_cell.smart_multiline {
        min-height: 56px;
    }
}

@media (max-width: 600px) {
    .smart_cell {
        min-height: 36px;
        padding: 4px 5px;
        border-radius: 3px;
    }

        .smart_cell > label,
        .smart_cell > .smart_caption {
            font-size: 11px;
            line-height: 11px;
        }

        .smart_value,
        .smart_cell > :not(label):not(.smart_caption):not(.smart_row):not(.smart_section_header) {
            font-size: 13px;
            line-height: 14px;
            min-height: 14px;
        }

    .smart_input,
    input.smart_input,
    select.smart_input,
    textarea.smart_input,
    .form-control.smart_input {
        height: 14px !important;
        min-height: 14px !important;
        line-height: 14px !important;
        font-size: 13px !important;
    }

    .smart_cell.smart_multiline {
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .smart_grid {
        --smart-gap: 2px;
    }

    .smart_row {
        gap: var(--smart-gap);
        overflow: hidden;
    }

    .smart_cell {
        min-width: 0 !important;
        max-width: 100%;
        min-height: 34px;
        padding: 3px 4px;
        border-radius: 3px;
    }

        .smart_cell > label,
        .smart_cell > .smart_caption {
            font-size: 10px;
            line-height: 10px;
        }

        .smart_value,
        .smart_cell > :not(label):not(.smart_caption):not(.smart_row):not(.smart_section_header) {
            font-size: 12px;
            line-height: 13px;
            min-height: 13px;
        }

    .smart_input,
    input.smart_input,
    select.smart_input,
    textarea.smart_input,
    .form-control.smart_input {
        height: 13px !important;
        min-height: 13px !important;
        line-height: 13px !important;
        font-size: 12px !important;
    }

    .smart_cell.smart_multiline {
        min-height: 44px;
    }

    .smart_wrap > :not(label):not(.smart_caption),
    .smart_wrap .smart_value {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}
