html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.wrapper {
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.wrapper::before {
    display: none !important;
}

.main {
    min-width: 0;
    width: 100%;
    overflow: visible;
}

.content {
    min-width: 0;
    width: 100%;
}

.card,
.modal-content,
.records-panel,
.crud-card {
    max-width: 100%;
}

.card-body,
.records-panel .card-body,
.crud-card .card-body,
.crud-page .card-body {
    min-width: 0;
}

.table,
.dataTables_wrapper {
    width: 100% !important;
}

.table-responsive,
.dataTables_wrapper,
.records-panel .card-body,
.crud-table-card .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dataTables_wrapper .row {
    min-width: 0;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    max-width: 100%;
}

img {
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .wrapper {
        display: flex;
        align-items: stretch;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .main {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        overflow: visible !important;
    }

    .content {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .container-fluid {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .top-navbar {
        min-height: 60px;
        padding: 0 10px;
    }

    .main {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding-top: 60px;
        overflow: visible !important;
    }

    .dashboard-page .main {
        min-width: 0 !important;
        width: 100% !important;
    }

    .dashboard-page .content {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: visible !important;
    }

    .dashboard-page .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
    }

    .dashboard-hero {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow: hidden !important;
        background: linear-gradient(135deg, #153d77 0%, #2f6fd5 100%) !important;
    }

    .dashboard-hero::after {
        display: none !important;
    }

    .dashboard-hero-content,
    .dashboard-hero-panel,
    .kpi-card,
    .records-panel {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .dashboard-hero-actions {
        width: 100%;
    }

    .dashboard-hero-actions .btn {
        min-width: 0;
        white-space: normal;
    }

    .dashboard-hero h1,
    .dashboard-hero p,
    .hero-panel-copy {
        overflow-wrap: anywhere;
    }

    .sidebar-content {
        top: 0;
        height: 100vh;
    }

    .navbar-brand-panel {
        gap: 8px;
        min-width: 0;
    }

    .navbar-icon-link {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .navbar-user-button {
        min-height: 38px;
        border-radius: 12px;
    }

    .content {
        padding-top: 14px !important;
        padding-bottom: 16px !important;
    }

    .card-header,
    .records-panel .card-header,
    .crud-page .card-header,
    .crud-card .card-header {
        padding: 16px !important;
    }

    .card-body,
    .records-panel .card-body,
    .crud-page .card-body,
    .crud-card .card-body {
        padding: 16px !important;
    }

    .records-panel,
    .crud-card,
    .crud-page .card {
        border-radius: 12px;
    }

    .records-panel .card-header .btn,
    .crud-table-card .card-header .btn {
        width: 100%;
    }

    .modal-dialog {
        margin: 10px;
    }

    .modal-header,
    .modal-body,
    .crud-page .modal-header,
    .crud-page .modal-body {
        padding: 16px !important;
    }

    .modal .row > [class*="col-"] {
        margin-bottom: 10px;
    }

    .records-panel .table {
        min-width: 860px;
    }

    .records-panel .dataTables_wrapper {
        max-width: 100%;
    }

    .records-panel .dataTables_wrapper .dt-buttons .btn {
        margin-bottom: 6px;
    }

    .table {
        min-width: 680px;
    }

    .dataTables_wrapper .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dt-buttons,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: left;
        margin: 6px 0;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
    }

    .footer .row {
        gap: 8px;
    }

    .footer .col-8,
    .footer .col-4 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        text-align: left !important;
    }
}

@media (max-width: 420px) {
    .navbar-brand-logo {
        width: 38px;
        height: 38px;
    }

    .navbar-brand-logo img {
        width: 30px;
        height: 30px;
    }

    .navbar-actions {
        gap: 4px;
    }
}
