﻿/* ==========================================================================
   Базовая структура страницы
   ========================================================================== */
.page-content {
    display: flex;
    justify-content: flex-start;
    position: fixed;
    margin-top: 3px;
    width: 100%;
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

/* Контейнеры для таблиц (разные модификаторы ширины) */
.table-container {
    margin-top: 0;
    max-height: 730px;
    min-width: 900px;
}

.table-container-medium {
    margin-top: 0;
    max-height: 730px;
    max-width: 1225px;
    min-width: 700px;
}

.table-container-mini {
    margin-top: 0;
    max-height: 730px;
    max-width: 1225px;
    min-width: 250px;
}

/* ==========================================================================
   Компонент таблицы (.table-solid)
   ========================================================================== */
.table-solid {
    position: relative;
    margin-right: 5px;
    min-width: 300px;
    height: calc(100vh - 500px);
    max-height: calc(100vh - 500px);
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
}

    /* Внутренние элементы таблицы */
    .table-solid table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .table-solid th {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 12px !important;
        background-color: #f8fafc !important;
        color: #475569 !important;
        border-bottom: 2px solid #3b82f6 !important;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .table-solid td {
        padding: 8px 10px !important;
        color: #1e293b !important;
        font-size: 0.85rem;
        vertical-align: middle;
    }

    .table-solid td,
    .table-solid span {
        font-weight: 500;
    }

        /* Контраст для заблокированных полей и длинного текста */
        .table-solid td:disabled,
        .table-solid .text-truncate {
            color: #0f172a !important;
        }

    /* Строки таблицы и интерактивность */
    .table-solid tbody tr {
        border-bottom: 1px solid #e2e8f0;
        transition: all 0.2s ease;
    }

        /* Эффект hover (объединен в одно правило) */
        .table-solid tbody tr:hover:not(.selected-row) {
            background-color: #f1f5f9 !important;
            box-shadow: inset 4px 0 0 #3b82f6;
        }

    /* Состояние выбора (активная строка) */
    .table-solid tr.selected-row,
    .table-solid tr:active {
        background-color: #cadef7 !important;
        box-shadow: inset 4px 0 0 #3b82f6;
    }




.thead-primary,
.thead-primary th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #cdd2d7 !important;
    color: var(--ui-text-dark) !important;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--ui-border-dark) !important;
}

.bg-steel {
    background-color: #cdd2d7 !important;
}

/* ==========================================================================
   СТРОГИЕ ПЛОТНЫЕ ТАБЛИЦЫ (Плотный интерфейс)
   ========================================================================== */
.table-solid-modal {
    border: 1px solid var(--ui-border-dark);
    border-radius: 8px;
    overflow: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 210px;
    max-height: 330px;
    position: relative;
    background-color: var(--ui-bg-white);
}

    .table-solid-modal table {
        width: 100%;
        margin-bottom: 0;
        border-collapse: collapse; /* Строгое схлопывание границ, никаких зазоров */
    }

.table-solid-modal tbody tr {
    border-bottom: 1px solid var(--ui-border-default);
}

    .table-solid-modal tbody tr:hover {
        background-color: #f1f5f9 !important; /* Четкий контрастный ховер */
    }

/* Минимальная высота строк для отображения больших массивов данных */
.table-solid-modal td {
    padding: 6px 10px !important;
    vertical-align: middle;
    font-size: 0.85rem;
}

    .table-solid-modal td:disabled,
    .table-solid-modal .text-truncate {
        color: var(--ui-text-dark) !important;
        font-weight: 600;
    }

.table-solid-modal select {
    border: 1px solid var(--ui-border-dark);
    border-radius: 4px;
    padding: 2px 6px;
    background-color: var(--ui-bg-white);
    color: var(--ui-text-input);
    font-weight: 600;
}

.table-solid-modal .form-control:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 2px var(--ui-primary-focus);
}






/* ==========================================================================
   Адаптивность (Мобильные устройства)
   ========================================================================== */
@media (max-width: 640px) {
    .page-content {
        flex-direction: column;
    }

    .table-container,
    .table-container-medium,
    .table-container-mini {
        position: relative;
        margin-top: 10px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .table-solid {
        display: block;
        margin-right: 0;
        top: 0;
        width: 100%;
        max-width: 100vw;
        height: auto;
        max-height: 290px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        /* Предотвращаем сжатие колонок и перенос текста на мобильных */
        .table-solid table {
            white-space: nowrap;
        }

    .table-mobile {
        max-height: 610px;
    }
}
