/* ─── Унифицированные таблицы для всех страниц со списками ─────────── */

.table-fp {
    width: 100%;
    background: var(--fp-surface);
    border-radius: var(--fp-radius);
    overflow: hidden;
    border: 1px solid var(--fp-border);
    box-shadow: var(--fp-shadow);
    margin-bottom: 0;
    font-size: 15px;
    border-collapse: separate;
    border-spacing: 0;
}

.table-fp thead {
    background: var(--fp-bg);
}

.table-fp thead th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fp-muted);
    padding: 14px 16px;
    border-bottom: 2px solid var(--fp-border);
    white-space: nowrap;
}

.table-fp tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--fp-border);
    vertical-align: middle;
    color: var(--fp-text);
}

.table-fp tbody tr:last-child td {
    border-bottom: none;
}

.table-fp tbody tr:hover {
    background: rgba(66, 99, 235, 0.04);
}

[data-bs-theme="dark"] .table-fp tbody tr:hover {
    background: rgba(92, 124, 250, 0.08);
}

.table-fp .col-actions {
    white-space: nowrap;
    text-align: right;
}

.table-fp .col-actions form,
.table-fp .col-actions .btn {
    display: inline-block;
    margin: 0 2px;
}


@media (max-width: 768px) {
    .table-fp {
        border: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    .table-fp-responsive {
        display: block;
        width: 100%;
        border: 0;
        box-shadow: none;
        background: transparent;
        overflow: visible;
    }

    .table-fp-responsive thead {
        display: none;
    }

    .table-fp-responsive tbody {
        display: block;
        width: 100%;
    }

    .table-fp-responsive tr {
        display: block;
        width: 100%;
        background: var(--fp-surface);
        border: 1px solid var(--fp-border);
        border-radius: 16px;
        padding: 14px 16px;
        margin-bottom: 14px;
        box-shadow: var(--fp-shadow);
    }

    .table-fp-responsive tr:hover {
        background: var(--fp-surface);
    }

    .table-fp-responsive td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;

        padding: 10px 0 !important;
        border-bottom: 1px solid var(--fp-border);

        text-align: right;
        min-width: 0;
        color: var(--fp-text);
    }

    .table-fp-responsive td:last-child {
        border-bottom: none;
        padding-bottom: 0 !important;
    }

    .table-fp-responsive td::before {
        content: attr(data-label);
        flex: 0 0 38%;

        text-align: left;
        font-size: 12px;
        font-weight: 700;
        color: var(--fp-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-right: 0;
    }

    .table-fp-responsive td > * {
        max-width: 62%;
        min-width: 0;
    }

    .code-inline,
    .code-tx {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .badge-status,
    .badge-mode {
        white-space: normal;
        text-align: center;
    }

    .table-fp-responsive .col-actions {
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px 6px;

        white-space: normal;
        text-align: right;
    }

    .table-fp-responsive .col-actions::before {
        flex: 0 0 38%;
        margin-right: auto;
        padding-top: 8px;
    }

    .table-fp-responsive .col-actions > * {
        max-width: none;
    }

    .table-fp-responsive .col-actions form {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
        flex-wrap: wrap;

        margin: 0;
    }

    .table-fp-responsive .col-actions .form-inline {
        display: inline-flex;
    }

    .table-fp-responsive .col-actions .btn {
        min-height: 38px;
        padding-left: 10px;
        padding-right: 10px;

        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .table-fp-responsive .col-actions .form-select,
    .table-fp-responsive .col-actions select {
        width: auto !important;
        min-width: 96px;
        max-width: 130px;
    }

    .table-fp-responsive .col-actions .form-select-sm {
        min-height: 38px;
    }

    .table-fp-responsive td[data-label="Режим"] .btn-mode-group {
        display: inline-flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 6px;

        max-width: 62%;
        background: transparent;
        border: 0;
        padding: 0;
    }

    .table-fp-responsive td[data-label="Режим"] .btn-mode {
        min-width: 38px;
        min-height: 34px;
        padding: 6px 8px;

        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Мин. количество в таблице товаров */
    .table-fp-responsive td[data-label="Мин."] form {
        max-width: 62%;
        display: flex;
        justify-content: flex-end;
        gap: 6px;
        margin: 0;
    }

    .table-fp-responsive td[data-label="Мин."] .form-control {
        max-width: 90px;
        min-height: 34px;
    }
}

.table-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--fp-muted);
    background: var(--fp-surface);
    border-radius: var(--fp-radius);
    border: 1px dashed var(--fp-border);
}

.table-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
    color: var(--fp-muted);
}