﻿.ec-compact-grid {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.ec-grid-row {
    display: grid;
    align-items: stretch;
    min-height: 68px;
}

.ec-grid-head {
    min-height: 54px;
    background: linear-gradient(135deg, var(--active-color-focus), var(--active-color));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ec-grid-cell {
    display: flex;
    align-items: center;
    justify-content: end;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    line-height: 1.35;
}

    .ec-grid-cell:last-child {
        border-right: 0;
    }

.ec-grid-body .ec-grid-row:nth-child(odd) {
    background: var(--odd-row-background);
}

/*.ec-grid-body .ec-grid-row:last-child .ec-grid-cell {
    border-bottom: 0;
}*/

.ec-grid-body .ec-grid-row {
    position: relative;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    .ec-grid-body .ec-grid-row:hover {
        background: #fff;
    }

    .ec-grid-body .ec-grid-row.ec-selected {
        font-weight: 700;
        background: var(--active-color-light);
        box-shadow: inset 5px 0 0 var(--active-color), var(--row-shadow);
    }
    .ec-grid-body .ec-grid-row.ec-active {
        background: var(--bg2);
        box-shadow: inset 5px 0 0 var(--color-green), var(--row-shadow);
    }

.ec-select-cell {
    justify-content: center;
}

.ec-check {
    appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid #b8c7d6;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

    .ec-check.ec-disabled {
        border: 2px solid #ddd;
        cursor: default;
    }

    .ec-check::after {
        content: "";
        width: 6px;
        height: 11px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg) scale(0);
        margin-top: -2px;
        transition: transform 0.16s ease;
    }

    .ec-check:checked {
        background: var(--active-color);
        border-color: var(--active-color);
        box-shadow: 0 0 0 4px rgba(51, 117, 170, 0.16);
    }

        .ec-check:checked::after {
            transform: rotate(45deg) scale(1);
        }

    .ec-check:focus-visible {
        outline: 3px solid rgba(51, 117, 170, 0.28);
        outline-offset: 2px;
    }

.ec-value {
    color: var(--text-color);
}

.ec-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.ec-badge-low {
    color: var(--color-green);
    background: rgba(79, 163, 106, 0.13);
}

.ec-badge-medium {
    color: var(--color-orange);
    background: rgba(243, 156, 18, 0.14);
}

.ec-badge-high {
    color: var(--color-red);
    background: rgba(217, 74, 74, 0.13);
}

.ec-protection {
    color: var(--active-color-focus);
}

@media (max-width: 760px) {
    .ec-compact-grid {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .ec-grid-body {
        display: grid;
        gap: 12px;
    }

    .ec-grid-row {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 0 12px;
        min-height: 0;
        padding: 14px;
        background: #fff !important;
        border: 1px solid var(--border-color);
        border-radius: 18px;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    }

/*        .ec-grid-row.ec-selected {
            border-color: rgba(51, 117, 170, 0.45);
            background: var(--active-color-light) !important;
            box-shadow: inset 4px 0 0 var(--active-color), 0 12px 30px rgba(51, 117, 170, 0.13);
        }*/

    .ec-grid-cell {
        min-width: 0;
        padding: 8px 0;
        border-right: 0;
    }

        .ec-grid-cell:last-child {
            border-bottom: 0;
        }

    .ec-select-cell {
        grid-row: 1 / span 4;
        align-items: flex-start;
        justify-content: center;
        padding-top: 12px;
    }

    .ec-grid-cell:not(.ec-select-cell) {
        display: grid;
        grid-template-columns: minmax(108px, 43%) 1fr;
        gap: 10px;
        align-items: center;
    }

        .ec-grid-cell:not(.ec-select-cell)::before {
            content: attr(data-title);
            font-size: 12px;
            font-weight: 700;
            color: var(--muted-color);
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

    .ec-value {
        text-align: right;
        font-size: 14px;
    }

    .ec-badge {
        justify-self: end;
        white-space: normal;
        text-align: right;
    }

    .ec-grid-head {
        display: none;
    }
}

@media (max-width: 390px) {
    .ec-grid-head {
        display: none;
    }

    .ec-grid-row {
        grid-template-columns: 36px 1fr;
        padding: 12px;
        gap: 0 8px;
    }

    .ec-grid-cell:not(.ec-select-cell) {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .ec-value,
    .ec-badge {
        justify-self: start;
        text-align: left;
    }
}

.ec-selection-blocked .ec-grid-cell {
    opacity: 0.72;
}

.ec-check:disabled {
    opacity: 0.45;
}