﻿/* =========================================
   1. СТРАНИЦА И КОНТЕЙНЕРЫ
   ========================================= */
.page-content {
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    position: fixed;
    display: flex;
    justify-content: flex-start;
    margin-top: 3px;
    /* Фон заменен на плотный индустриальный нейтральный цвет */
    background: #cbd5e1;
}

.table-container {
    margin-top: 0px;
    max-height: 730px;
    min-width: 900px;
}

    .table-container table th.row-style {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        border-bottom: 0;
    }

    .table-container table td.row-style {
        display: flex;
        flex-direction: row;
        justify-content: center;
        padding-top: 19px !important;
        margin-left: 5px;
        margin-right: 5px;
    }

/* Модальная таблица (внутренний желоб) */
.table-solid-modal {
    margin-top: 5px;
    min-height: 210px;
    max-height: 300px;
    overflow: auto;
    position: relative;
    border-radius: 8px;
    /* Глубокое вдавленное поле */
    background: linear-gradient(180deg, #e2e8f0 0%, #edf2f7 100%);
    border: 1px solid #94a3b8;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* =========================================
   2. ГЛАВНАЯ ТАБЛИЦА: Монолитная панель
   ========================================= */
.table-solid {
    margin-right: 5px;
    min-width: 400px;
    position: relative;
    /* Объемный фон панели */
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9) !important;
    /* Физическая фаска рамки */
    border: 1px solid #94a3b8 !important;
    border-top-color: #ffffff !important;
    border-bottom-color: #64748b !important;
    border-radius: 12px !important;
    /* Жесткая падающая тень от панели */
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(0, 0, 0, 0.2) !important;
    overflow-y: auto;
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
}

    .table-solid table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    /* Ячейки данных */
    .table-solid td {
        color: #1e293b !important;
        font-size: 0.85rem;
        padding: 10px 12px !important;
        border-bottom: 1px solid #cbd5e1;
        vertical-align: middle;
    }

    /* Шапка таблицы (выступающая планка) */
    .table-solid th {
        background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0) !important;
        color: #334155 !important;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.75rem;
        padding: 12px !important;
        position: sticky;
        top: 0;
        z-index: 10;
        /* Объем шапки с нижним акцентным швом */
        border-bottom: 2px solid #3b82f6 !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 4px rgba(0, 0, 0, 0.08);
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    /* Выбранная строка: глубокое вдавливание с синей подсветкой */
    .table-solid tr.selected-row,
    .table-solid tr:active {
        background: linear-gradient(180deg, #cfe2ff 0%, #b6d4fe) !important;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), inset 4px 0 0 #2563eb !important;
    }

    /* Наведение на строку */
    .table-solid tr:hover:not(.selected-row) {
        background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0) !important;
        box-shadow: inset 4px 0 0 #3b82f6;
    }

    .table-solid td,
    .table-solid span {
        font-weight: 500;
    }

        .table-solid td [disabled],
        .table-solid td:has(:disabled),
        .table-solid .text-truncate {
            color: #0f172a !important;
        }

    .table-solid tbody tr {
        border-bottom: 1px solid #cbd5e1;
        transition: background 0.15s ease, box-shadow 0.15s ease;
    }

        .table-solid tbody tr:hover {
            box-shadow: inset 4px 0 0 #3b82f6;
        }

.table {
    --bs-table-bg: transparent !important;
}



/* --- Анимация вращения индикатора загрузки / Радара --- */
.spin {
    animation: rotate 1.2s infinite steps(8, end); /* Прерывистое тактическое вращение */
    color: var(--military-accent-amber, #d97706);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* =========================================
   3. АДАПТИВНЫЕ МЕХАНИЧЕСКИЕ КАРТОЧКИ (MOBILE)
   ========================================= */
@media (max-width: 640px) {
    .page-content {
        position: static;
        flex-direction: column;
        display: block;
        background: #cbd5e1;
        min-height: auto;
    }

    .table-container,
    .table-container-medium,
    .table-container-mini {
        width: 100% !important;
        min-width: 0% !important;
        max-width: 100% !important;
        margin-top: 5px;
        position: relative;
    }

    .table-solid {
        width: 100%;
        max-width: 100vw;
        overflow-x: auto;
        display: block;
        -webkit-overflow-scrolling: touch;
        height: auto;
        max-height: 400px;
        margin-right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

        .table-solid table {
            display: block;
            white-space: nowrap;
        }

    .card-table {
        display: block;
        width: 100%;
        margin-top: 8px;
        border: none !important;
        box-shadow: none !important;
    }

        .card-table thead {
            display: none;
        }

        .card-table tbody {
            display: flex;
            flex-direction: row;
            gap: 12px;
            padding: 6px 8px 14px 8px;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }

            .card-table tbody::-webkit-scrollbar {
                display: none;
            }

        /* Каждая карточка — отдельная физическая плитка */
        .card-table tr {
            display: flex;
            flex-direction: column;
            min-width: 240px;
            max-width: 260px;
            /* Объемная плитка */
            background: linear-gradient(180deg, #ffffff 0%, #edf2f7) !important;
            border-radius: 12px !important;
            padding: 10px 12px;
            /* Объемные тени карточки */
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 4px 10px rgba(0, 0, 0, 0.15);
            border: 1px solid #94a3b8 !important;
            border-top-color: #ffffff !important;
            border-bottom-color: #64748b !important;
            scroll-snap-align: center;
            position: relative;
            align-items: center;
            text-align: center;
            gap: 2px;
            text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
        }

        .card-table td {
            display: block;
            border: none !important;
            padding: 2px !important;
            margin: 2px !important;
            width: 100%;
            color: #334155;
            font-size: 0.8rem;
            line-height: 1.1;
        }

            .card-table td:nth-child(2) {
                order: -2;
                text-align: left;
                font-size: 0.75rem;
                font-weight: 600;
                color: #475569;
                margin-bottom: 2px !important;
            }

            .card-table td:last-child {
                position: absolute;
                top: 8px;
                right: 10px;
                font-size: 0.75rem;
                font-weight: 600;
                width: auto;
            }

            .card-table td:nth-child(3) {
                order: -1;
                font-weight: 700;
                color: #0f172a;
                font-size: 0.95rem;
                margin-bottom: 4px !important;
                padding-bottom: 4px !important;
                border-bottom: 1px solid #cbd5e1 !important;
            }

    /* Вдавленные плашки-бейджи */
    .badge-amount {
        display: inline-block !important;
        background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1) !important;
        padding: 2px 8px !important;
        border-radius: 4px;
        font-weight: 600;
        color: #334155;
        margin: 2px 1px !important;
        font-size: 0.75rem;
        border: 1px solid #94a3b8;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    .row-style {
        display: flex !important;
        justify-content: center;
        gap: 12px;
        width: 100%;
        margin-top: auto;
        padding-top: 6px !important;
        padding-bottom: 2px !important;
        border-top: none !important;
    }

    .card-table input[type="checkbox"] {
        transform: scale(0.85);
        margin: 0;
    }
}
