﻿.smart-form {
    --smart-gap: 4px;
    --smart-border: #d8dde3;
    --smart-bg: #f8f9fa;
    --smart-bg-input: #ffffff;
    --smart-text: #24384a;
    --smart-value-text: #1d2c3a;
    --smart-content-offset-y: 0px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr)); /* XL */
    gap: var(--smart-gap);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

    .smart-form > .sf-item {
        grid-column: span 1;
        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-form > .sf-item[data-span="1"] {
            grid-column: span 1;
        }

        .smart-form > .sf-item[data-span="2"] {
            grid-column: span 2;
        }

        .smart-form > .sf-item[data-span="3"] {
            grid-column: span 3;
        }

        .smart-form > .sf-item[data-span="4"] {
            grid-column: span 4;
        }

        .smart-form > .sf-item[data-span="5"] {
            grid-column: span 5;
        }

        .smart-form > .sf-item[data-span="6"] {
            grid-column: span 6;
        }

        .smart-form > .sf-item[data-span="7"] {
            grid-column: span 7;
        }

        .smart-form > .sf-item[data-span="8"] {
            grid-column: span 8;
        }

        .smart-form > .sf-item[data-span="9"] {
            grid-column: span 9;
        }

        .smart-form > .sf-item[data-span="10"] {
            grid-column: span 10;
        }

        .smart-form > .sf-item[data-span="11"] {
            grid-column: span 11;
        }

        .smart-form > .sf-item[data-span="12"] {
            grid-column: span 12;
        }

        .smart-form > .sf-item::before {
            content: attr(data-label);
            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;
            position: relative;
            top: var(--smart-content-offset-y);
        }

        .smart-form > .sf-item:not([data-label])::before,
        .smart-form > .sf-item[data-label=""]::before {
            display: none;
        }

        .smart-form > .sf-item[data-label] > .sf-group,
        .smart-form > .sf-item[data-label] > .form-control,
        .smart-form > .sf-item[data-label] > input:not([type=checkbox]):not([type=radio]),
        .smart-form > .sf-item[data-label] > select,
        .smart-form > .sf-item[data-label] > textarea,
        .smart-form > .sf-item[data-label] > .smart_value {
            margin-top: 1px;
        }

        .smart-form > .sf-item.sf-has-input {
            background: var(--smart-bg-input);
        }

        .smart-form > .sf-item.sf-readonly,
        .smart-form > .sf-item.sf-disabled {
            background: var(--smart-bg);
        }

        .smart-form > .sf-item > :not(.sf-group),
        .smart-form > .sf-item > .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: var(--smart-content-offset-y);
        }

        .smart-form > .sf-item > .form-control,
        .smart-form > .sf-item > input:not([type=checkbox]):not([type=radio]),
        .smart-form > .sf-item > select,
        .smart-form > .sf-item > textarea,
        .smart-form > .sf-item > .smart_input:not(input[type=checkbox]):not(input[type=radio]) {
            display: block;
            width: 100%;
            min-width: 0;
            max-width: 100%;
            height: 15px !important;
            min-height: 15px !important;
            line-height: 15px !important;
            margin: 2px 0px !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: var(--smart-content-offset-y);
        }

            .smart-form > .sf-item > .form-control:focus,
            .smart-form > .sf-item > input:not([type=checkbox]):not([type=radio]):focus,
            .smart-form > .sf-item > select:focus,
            .smart-form > .sf-item > textarea:focus,
            .smart-form > .sf-item > .smart_input:not(input[type=checkbox]):not(input[type=radio]):focus {
                border: 0 !important;
                outline: 0 !important;
                box-shadow: none !important;
                background: transparent !important;
            }

        .smart-form > .sf-item.sf-multiline {
            min-height: 64px;
        }

            .smart-form > .sf-item.sf-multiline > :not(.sf-group),
            .smart-form > .sf-item.sf-multiline > .smart_value,
            .smart-form > .sf-item.sf-multiline > .form-control,
            .smart-form > .sf-item.sf-multiline > textarea,
            .smart-form > .sf-item.sf-multiline > .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-form > .sf-item.sf-wrap > :not(.sf-group),
        .smart-form > .sf-item.sf-wrap > .smart_value {
            white-space: normal;
            overflow-wrap: anywhere;
            word-break: break-word;
            text-overflow: clip;
        }

    .smart-form .sf-group {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        align-items: center;
        width: 100%;
        min-width: 0;
        position: relative;
        top: var(--smart-content-offset-y);
    }

        .smart-form .sf-group > .form-control,
        .smart-form .sf-group > input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]),
        .smart-form .sf-group > select,
        .smart-form .sf-group > textarea,
        .smart-form .sf-group > .smart_input:not(input[type=checkbox]):not(input[type=radio]) {
            flex: 1 1 auto;
            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: 0;
        }

            .smart-form .sf-group > .form-control:focus,
            .smart-form .sf-group > input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]):focus,
            .smart-form .sf-group > select:focus,
            .smart-form .sf-group > textarea:focus,
            .smart-form .sf-group > .smart_input:not(input[type=checkbox]):not(input[type=radio]):focus {
                border: 0 !important;
                outline: 0 !important;
                box-shadow: none !important;
                background: transparent !important;
            }

        .smart-form .sf-group > .sf-addon {
            flex: 0 0 auto;
            margin: 0;
            padding: 0;
            border: 0;
            background: transparent;
            color: var(--smart-value-text);
            font-size: 14px;
            line-height: 15px;
            min-height: 15px;
            white-space: nowrap;
            position: relative;
            top: 0;
        }

    .smart-form .sf-item.sf-item-buttons {
        grid-column: span 2;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
        min-height: auto !important;
    }

    .smart-form .sf-actions {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
    }

        .smart-form .sf-actions .btn,
        .smart-form .sf-actions button,
        .smart-form .sf-actions input[type=button],
        .smart-form .sf-actions input[type=submit] {
            flex: 0 0 auto;
            margin: 0 !important;
        }

    /* CHECKBOX */
    .smart-form .sf-item.sf-checkbox {
        background: var(--smart-bg-input);
    }

        .smart-form .sf-item.sf-checkbox .smart_commands {
            display: flex;
            align-items: center;
            min-height: 15px;
            position: relative;
            top: var(--smart-content-offset-y);
        }

        .smart-form .sf-item.sf-checkbox input[type="checkbox"] {
            appearance: auto !important;
            -webkit-appearance: checkbox !important;
            position: relative;
            top: 0;
            left: 2px;
            width: 14px !important;
            height: 14px !important;
            min-width: 14px !important;
            min-height: 14px !important;
            margin: 0 !important;
            padding: 0 !important;
            border: initial !important;
            outline: initial !important;
            box-shadow: none !important;
            background: transparent !important;
        }

        .smart-form .sf-item.sf-checkbox label,
        .smart-form .sf-item.sf-checkbox span {
            margin-left: 6px;
            position: relative;
            top: 0;
        }

/* LG = 8 */
@media (max-width: 1199.98px) {
    .smart-form {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

        .smart-form .sf-item.sf-item-buttons {
            grid-column: span 2 !important;
        }
}

/* MD = 6 */
@media (max-width: 991.98px) {
    .smart-form {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

        .smart-form > .sf-item {
            min-height: 38px;
            padding: 4px 6px;
        }

            .smart-form > .sf-item::before {
                font-size: 11px;
                line-height: 11px;
            }

            .smart-form > .sf-item > :not(.sf-group),
            .smart-form > .sf-item > .smart_value {
                font-size: 13px;
                line-height: 14px;
                min-height: 14px;
            }

            .smart-form > .sf-item > .form-control,
            .smart-form > .sf-item > input:not([type=checkbox]):not([type=radio]),
            .smart-form > .sf-item > select,
            .smart-form > .sf-item > textarea,
            .smart-form > .sf-item > .smart_input:not(input[type=checkbox]):not(input[type=radio]),
            .smart-form .sf-group > .form-control,
            .smart-form .sf-group > input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]),
            .smart-form .sf-group > select,
            .smart-form .sf-group > textarea,
            .smart-form .sf-group > .smart_input:not(input[type=checkbox]):not(input[type=radio]) {
                height: 14px !important;
                min-height: 14px !important;
                line-height: 14px !important;
                font-size: 13px !important;
            }

            .smart-form > .sf-item.sf-multiline {
                min-height: 56px;
            }

        .smart-form .sf-item.sf-item-buttons {
            grid-column: span 2 !important;
        }
}

/* SM = 4 */
@media (max-width: 767.98px) {
    .smart-form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

        .smart-form > .sf-item {
            min-height: 36px;
            padding: 4px 5px;
            border-radius: 3px;
        }

            .smart-form > .sf-item::before {
                font-size: 11px;
                line-height: 11px;
            }

            .smart-form > .sf-item > :not(.sf-group),
            .smart-form > .sf-item > .smart_value {
                font-size: 13px;
                line-height: 14px;
                min-height: 14px;
            }

        .smart-form .sf-item.sf-item-buttons {
            grid-column: span 2 !important;
        }
}

/* XSM = 3 */
@media (max-width: 575.98px) {
    .smart-form {
        --smart-gap: 2px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

        .smart-form > .sf-item {
            min-width: 0 !important;
            max-width: 100%;
            min-height: 34px;
            padding: 3px 4px;
            border-radius: 3px;
        }

            .smart-form > .sf-item::before {
                font-size: 10px;
                line-height: 10px;
            }

            .smart-form > .sf-item > :not(.sf-group),
            .smart-form > .sf-item > .smart_value {
                font-size: 12px;
                line-height: 13px;
                min-height: 13px;
            }

            .smart-form > .sf-item > .form-control,
            .smart-form > .sf-item > input:not([type=checkbox]):not([type=radio]),
            .smart-form > .sf-item > select,
            .smart-form > .sf-item > textarea,
            .smart-form > .sf-item > .smart_input:not(input[type=checkbox]):not(input[type=radio]),
            .smart-form .sf-group > .form-control,
            .smart-form .sf-group > input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]),
            .smart-form .sf-group > select,
            .smart-form .sf-group > textarea,
            .smart-form .sf-group > .smart_input:not(input[type=checkbox]):not(input[type=radio]) {
                height: 13px !important;
                min-height: 13px !important;
                line-height: 13px !important;
                font-size: 12px !important;
            }

            .smart-form > .sf-item.sf-multiline {
                min-height: 44px;
            }

            .smart-form > .sf-item.sf-wrap > :not(.sf-group),
            .smart-form > .sf-item.sf-wrap > .smart_value {
                white-space: normal;
                overflow-wrap: anywhere;
                word-break: break-word;
            }

        .smart-form .sf-item.sf-item-buttons {
            grid-column: span 2 !important;
        }
}
.smart-form .sf-item.sf-checkbox input[type="checkbox"] {
    top: 1px;
    left: 3px;
    transform: scale(1.1);
    padding-bottom:0px;
}

/* PULSANTE RICERCA */
.smart-form > .sf-item.sf-search {
    min-height: 42px;
    height: 42px;
    padding: 1px 33px 1px 6px;
    display: block;
    position: relative;
    overflow: hidden;
}

    .smart-form > .sf-item.sf-search::before {
        display: block;
        position: absolute;
        top: 3px;
        left: 6px;
        right: 33px;
        height: 12px;
        line-height: 12px;
        margin: 0 4px 0 0;
        font-size: 12px;
        z-index: 1;
    }

    .smart-form > .sf-item.sf-search .sf-group {
        width: 100%;
        height: 100%;
        min-height: 0;
        margin-top: 0;
        top: 0;
        display: block;
        overflow: hidden;
    }

        .smart-form > .sf-item.sf-search .sf-group > .form-control,
        .smart-form > .sf-item.sf-search .sf-group > input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]) {
            display: block;
            width: 100%;
            height: 100% !important;
            min-height: 0 !important;
            line-height: 15px !important;
            margin: 0 !important;
            padding: 14px 0 0 0 !important;
            top: 0 !important;
            border-radius: 0 !important;
            box-sizing: border-box;
        }

    .smart-form > .sf-item.sf-search > .btn,
    .smart-form > .sf-item.sf-search > input[type=button],
    .smart-form > .sf-item.sf-search > input[type=submit] {
        position: absolute;
        top: 1px !important;
        right: 1px;
        bottom: 1px;
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        height: auto !important;
        min-height: 0 !important;
        line-height: normal !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid #cfd6de !important;
        border-radius: 3px !important;
        display: block !important;
        box-sizing: border-box;
        background-color: #e9ecef !important;
        background-image: url(../img/search_black.png) !important;
        background-repeat: no-repeat !important;
        background-position: center center !important;
        background-size: 28px 28px !important;
        padding-left: 0 !important;
        overflow: hidden;
        z-index: 2;
    }

