/* Ajustes próprios do IntegraData; o CSS distribuído do AdminLTE permanece intacto. */
.app-wrapper {
    grid-template-columns: auto minmax(0, 1fr);
}

.app-main, .app-content, .card, .card-body, .chart-container,
.row > *, .mobile-cell-value {
    min-width: 0;
}

.chart-container {
    width: 100%;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}

.page-toolbar h3, .card-title, .modal-title, .alert, .info-box-text {
    overflow-wrap: anywhere;
}

.info-box-text {
    white-space: normal;
}

.pagination {
    flex-wrap: wrap;
    gap: .25rem;
}

.sidebar-menu .nav-link p {
    white-space: normal;
}

.sidebar-menu .nav-link {
    align-items: center;
}

.table-mobile-cards .mobile-cell-value {
    overflow-wrap: anywhere;
}

.demo-banner {
    white-space: normal;
    line-height: 1.4;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: var(--lte-sidebar-width);
        max-width: var(--lte-sidebar-width);
    }

    .sidebar-expand-lg.sidebar-open .sidebar-overlay {
        position: fixed;
        height: 100dvh;
    }

    .app-sidebar .sidebar-wrapper {
        overscroll-behavior: contain;
    }

    .app-header .nav-link, .sidebar-menu .nav-link {
        min-height: 44px;
    }
}

@media (max-width: 767.98px) {
    .app-content-header h3 {
        font-size: 1.4rem;
        line-height: 1.3;
    }

    .page-toolbar > * {
        width: 100%;
    }

    .page-toolbar .text-end {
        text-align: left !important;
    }

    .page-toolbar .action-group {
        justify-content: flex-start;
    }

    .action-group .btn {
        flex: 1 1 auto;
        white-space: normal;
    }

    .card-header.d-flex, .modal-footer, .d-flex.justify-content-center {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .card-header .card-title {
        float: none;
    }

    .modal-dialog {
        --bs-modal-margin: .5rem;
    }

    .modal-content {
        max-height: calc(100dvh - 1rem);
    }

    .modal-body {
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .modal-fullscreen .modal-content {
        max-height: 100dvh;
    }

    .modal-header, .modal-footer {
        flex-shrink: 0;
    }

    .modal-header .btn-close {
        flex-shrink: 0;
        min-width: 44px;
        min-height: 44px;
    }

    .modal-body summary {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .modal-body summary::before {
        content: '▸';
        margin-inline-end: .35rem;
    }

    .modal-body details[open] > summary::before {
        content: '▾';
    }

    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px;
    }

    .btn:not(.btn-close), .page-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: normal;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }

    .modal-body pre, .modal-body code {
        overflow-wrap: anywhere;
        white-space: pre-wrap;
    }

    .alert {
        white-space: normal;
    }

    .dropdown-menu {
        max-width: calc(100vw - 1rem);
    }

    .app-footer {
        font-size: .875rem;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 575.98px) {
    .app-header > .container-fluid {
        padding-inline: .5rem;
        flex-wrap: nowrap;
        gap: .25rem;
    }

    .demo-banner-details {
        display: none;
    }

    .demo-banner {
        margin-inline: .25rem !important;
        font-size: .8rem;
    }

    .app-content, .app-content-header {
        padding-inline: 0 !important;
    }

    .card-body {
        padding: 1rem;
    }

    .page-toolbar .action-group, .page-toolbar form, .page-toolbar .btn {
        width: 100%;
    }

    .table-mobile-cards {
        display: block;
        width: 100%;
        border: 0;
        margin-bottom: 1rem;
    }

    .table-mobile-cards thead {
        position: absolute !important;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .table-mobile-cards tbody {
        display: grid;
        gap: .75rem;
    }

    .table-mobile-cards tbody tr {
        display: block;
        border: 1px solid var(--bs-border-color);
        border-radius: .5rem;
        background: var(--bs-body-bg);
        overflow: hidden;
    }

    .table-mobile-cards tbody td {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        gap: .75rem;
        align-items: start;
        padding: .75rem;
        border: 0;
        border-bottom: 1px solid var(--bs-border-color);
        white-space: normal !important;
        max-width: none !important;
        box-shadow: none;
        background: transparent;
    }

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--bs-secondary-color);
        overflow-wrap: anywhere;
    }

    .table-mobile-cards tbody td:last-child {
        border-bottom: 0;
    }

    .table-mobile-cards tbody td[colspan] {
        display: block;
    }

    .table-mobile-cards tbody td[colspan]::before {
        content: none;
    }

    .table-mobile-cards .badge {
        max-width: 100%;
        text-align: left;
        white-space: normal;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .table-mobile-cards .btn {
        width: 100%;
        gap: .35rem;
    }

    .table-mobile-cards .mobile-cell-value > * {
        max-width: 100%;
    }

    #modalLogs .table-mobile-cards tbody td {
        grid-template-columns: minmax(0, 1fr);
        gap: .25rem;
    }

    .error-page {
        padding: 1rem;
    }
}
