/* ==========================================================================
   Responsive table — универсальный стиль для адаптивных таблиц
   Класс: .responsive-table

   Десктоп: таблица как обычно
   Мобилка: скрыть таблицу (.d-none-mobile), показать карточки (.mobile-card)
   ========================================================================== */

/* --- Мобильные карточки --- */
@media (max-width: 767.98px) {

    .mobile-card {
        border: 1px solid #dee2e6;
        border-radius: .375rem;
        background: #fff;
        margin-bottom: .75rem;
        overflow: hidden;
    }

    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8f9fa;
        padding: .5rem .75rem;
        border-bottom: 1px solid #dee2e6;
        font-weight: 500;
    }

    .mobile-card-header .d-flex {
        flex-shrink: 0;
    }

    .mobile-card-body {
        padding: 0;
    }

    .mobile-card-body .table {
        margin-bottom: 0;
    }

    .mobile-card-body .table td {
        padding: .375rem .75rem;
        vertical-align: middle;
    }

    .mobile-card-body .table td:first-child {
        font-weight: 500;
        width: 40%;
    }

    .mobile-card-buttons {
        display: flex;
        gap: .5rem;
        padding: .5rem .75rem;
    }

    .mobile-card-buttons button,
    .mobile-card-buttons a.btn {
        white-space: nowrap;
    }

    /* --- Responsive table: стековая раскладка на мобилке --- */
    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody tr {
        display: block;
        margin-bottom: .75rem;
        border: 1px solid #dee2e6;
        border-radius: .375rem;
    }

    .responsive-table td {
        display: flex;
        align-items: center;
        padding: .375rem .75rem;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 500;
        flex-shrink: 0;
        width: 40%;
    }

    .responsive-table td > input,
    .responsive-table td > select,
    .responsive-table td > div {
        flex: 1;
        min-width: 0;
    }
}
