/* Listagens operacionais que se adaptam sem criar rolagem horizontal. */
.adaptive-list-table {
    width: 100%;
    table-layout: fixed;
}

.adaptive-list-table th,
.adaptive-list-table td {
    min-width: 0;
    overflow-wrap: anywhere;
}

.adaptive-list-table td::before {
    display: none;
}

.adaptive-list-table .badge {
    max-width: 100%;
    white-space: normal;
}

.adaptive-auto-table th,
.adaptive-auto-table td {
    width: auto !important;
    min-width: 0 !important;
}

.adaptive-auto-table thead th {
    white-space: normal !important;
}

.adaptive-auto-table .adaptive-action-column {
    width: 9rem !important;
}

.adaptive-auto-table .adaptive-compact-column {
    width: 7.5rem !important;
}

.adaptive-record-kicker,
.adaptive-list-actions,
.adaptive-date-grid {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.adaptive-record-kicker {
    margin-bottom: .35rem;
    color: #64748b;
    font-size: .75rem;
}

.adaptive-record-number {
    color: #0f172a;
    font-size: 1rem;
}

.adaptive-record-divider {
    width: 2rem;
    margin: .55rem 0;
    border-top: 2px solid #d9e6ec;
}

.adaptive-date-grid {
    align-items: stretch;
}

.adaptive-date-grid > span {
    display: flex;
    min-width: 0;
    flex: 1 1 4.5rem;
    flex-direction: column;
}

.adaptive-date-grid small {
    color: #64748b;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.adaptive-wrap-text {
    display: block;
    overflow-wrap: anywhere;
}

.adaptive-list-actions {
    justify-content: center;
}

.adaptive-list-actions form {
    display: inline-flex;
    margin: 0;
}

.adaptive-list-actions .btn {
    min-width: 32px;
    border-radius: 7px !important;
}

.adaptive-companies-table .empresa-selecao-coluna {
    width: 3.5rem;
}

.adaptive-companies-table th:nth-last-child(4) {
    width: 34%;
}

.adaptive-companies-table th:nth-last-child(3) {
    width: 18%;
}

.adaptive-companies-table th:nth-last-child(2) {
    width: auto;
}

.adaptive-companies-table th:last-child {
    width: 12rem;
}

.adaptive-process-table th:nth-child(1) {
    width: 17%;
}

.adaptive-process-table th:nth-child(2) {
    width: 28%;
}

.adaptive-process-table th:nth-child(3) {
    width: 24%;
}

.adaptive-process-table th:nth-child(4) {
    width: 19%;
}

.adaptive-process-table th:nth-child(5) {
    width: 12%;
}

.adaptive-service-order-table th:nth-child(1) {
    width: 20%;
}

.adaptive-service-order-table th:nth-child(2) {
    width: 22%;
}

.adaptive-service-order-table th:nth-child(3) {
    width: 23%;
}

.adaptive-service-order-table th:nth-child(4) {
    width: 13%;
}

.adaptive-service-order-table th:nth-child(5) {
    width: 13%;
}

.adaptive-service-order-table th:nth-child(6) {
    width: 9%;
}

@media (max-width: 991.98px) {
    .adaptive-list-table,
    .adaptive-list-table tbody {
        display: block;
        width: 100%;
    }

    .adaptive-list-table thead {
        display: none;
    }

    .adaptive-list-table tbody {
        padding: .75rem;
    }

    .adaptive-list-table tbody > tr {
        position: relative;
        display: grid;
        overflow: hidden;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: .75rem;
        border: 1px solid #dce7ed;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 5px 16px rgba(15, 50, 63, .06);
    }

    .adaptive-list-table tbody > tr:last-child {
        margin-bottom: 0;
    }

    .adaptive-list-table tbody > tr > td {
        display: block;
        width: auto !important;
        padding: .75rem !important;
        border: 0 !important;
        border-bottom: 1px solid #edf2f7 !important;
        background: transparent;
        text-align: left !important;
    }

    .adaptive-list-table tbody > tr > td:nth-last-child(2) {
        border-bottom: 0 !important;
    }

    .adaptive-list-table tbody > tr > td::before {
        display: block;
        margin-bottom: .35rem;
        color: #64748b;
        content: attr(data-label);
        font-size: .67rem;
        font-weight: 900;
        letter-spacing: .055em;
        text-transform: uppercase;
    }

    .adaptive-list-table .adaptive-primary-cell,
    .adaptive-list-table .adaptive-actions-cell,
    .adaptive-list-table .adaptive-empty-cell,
    .adaptive-list-table .adaptive-full-cell {
        grid-column: 1 / -1;
    }

    .adaptive-list-table .adaptive-primary-cell {
        border-left: 4px solid #169c8c !important;
        background: linear-gradient(135deg, #f7fcfb 0%, #fff 72%);
    }

    .adaptive-list-table .adaptive-actions-cell {
        border-bottom: 0 !important;
        background: #f8fafc;
    }

    .adaptive-list-table .adaptive-select-cell {
        grid-column: 1 / -1;
        padding-bottom: .35rem !important;
    }

    .adaptive-list-table .adaptive-full-cell::before,
    .adaptive-list-table .adaptive-empty-cell::before {
        display: none;
    }

    .adaptive-list-actions {
        justify-content: flex-start;
    }

    .adaptive-list-actions .btn {
        min-width: 38px;
        min-height: 36px;
    }

    .adaptive-list-table tbody > tr.table-danger,
    .adaptive-list-table tbody > tr.is-danger-row {
        background: #fff7f7;
    }

    .adaptive-list-table tbody > tr.table-warning,
    .adaptive-list-table tbody > tr.is-warning-row {
        background: #fffdf5;
    }
}

@media (max-width: 575.98px) {
    .adaptive-list-table tbody {
        padding: .55rem;
    }

    .adaptive-list-table tbody > tr {
        grid-template-columns: minmax(0, 1fr);
        border-radius: 10px;
    }

    .adaptive-list-table tbody > tr > td,
    .adaptive-list-table .adaptive-primary-cell,
    .adaptive-list-table .adaptive-actions-cell,
    .adaptive-list-table .adaptive-empty-cell,
    .adaptive-list-table .adaptive-full-cell,
    .adaptive-list-table .adaptive-select-cell {
        grid-column: 1;
    }

    .adaptive-list-table tbody > tr > td:nth-last-child(2) {
        border-bottom: 1px solid #edf2f7 !important;
    }

    .adaptive-list-table tbody > tr > td:last-child {
        border-bottom: 0 !important;
    }
}
