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

.main-content,
.container,
.container-fluid,
.card,
.card-body {
    min-width: 0;
    max-width: 100%;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    table-layout: fixed;
}

.table-responsive > .table th,
.table-responsive > .table td {
    max-width: 1px;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    vertical-align: top;
}

.table-responsive > .table h6,
.table-responsive > .table p,
.table-responsive > .table span:not(.badge),
.table-responsive > .table small {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.table-responsive > .table .badge {
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
}

.table-responsive > .table .btn {
    white-space: nowrap;
}

.table-compact th,
.table-compact td {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.8125rem;
}

.cell-question {
    width: 32%;
}

.cell-answer {
    width: 22%;
}

.cell-code {
    width: 8rem;
}

.cell-short {
    width: 7rem;
}

.cell-number {
    width: 5.5rem;
}

.cell-date {
    width: 9rem;
}

.cell-status {
    width: 7rem;
}

.cell-actions {
    width: 8rem;
    text-align: center;
}

.cell-check {
    width: 5rem;
    text-align: center;
}

.cell-wide {
    width: 24%;
}

.cell-wrap,
.text-wrap-anywhere {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

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

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.table-search {
    position: relative;
    width: min(100%, 22rem);
}

.table-search .table-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #8392ab;
    font-size: 0.8rem;
    pointer-events: none;
}

.table-search .form-control {
    padding-left: 2.2rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

.filter-count {
    color: #8392ab;
    font-size: 0.78rem;
    font-weight: 600;
}

.admin-list-table .item-title {
    color: #344767;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.25rem;
}

.admin-list-table .item-subtitle,
.admin-list-table .item-meta {
    color: #67748e;
    font-size: 0.75rem;
    line-height: 1.35;
    margin: 0;
}

.admin-list-table .item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.table-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.table-code {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.28rem 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 0.45rem;
    background: #f8f9fa;
    color: #344767;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.75rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.table-metric {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4.75rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background: #f8f9fa;
    text-align: center;
}

.table-metric strong {
    color: #344767;
    font-size: 1rem;
    line-height: 1;
}

.table-metric span {
    color: #8392ab;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.table-scroll-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: 7rem;
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background: #f8f9fa;
}

.filter-empty-row {
    display: none;
}

@media (max-width: 767.98px) {
    .table-card-mobile {
        overflow-x: visible;
    }

    .table-card-mobile > .table {
        border-collapse: separate;
        border-spacing: 0 0.75rem;
    }

    .table-card-mobile > .table thead {
        display: none;
    }

    .table-card-mobile > .table tbody tr {
        display: block;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        overflow: hidden;
    }

    .table-card-mobile > .table tbody td {
        display: grid;
        grid-template-columns: minmax(7rem, 34%) 1fr;
        gap: 0.75rem;
        max-width: none;
        width: 100% !important;
        min-height: 2.35rem;
        padding: 0.65rem 0.75rem !important;
        border: 0 !important;
        border-bottom: 1px solid #f1f3f5 !important;
        text-align: left !important;
    }

    .table-card-mobile > .table tbody td::before {
        content: attr(data-label);
        color: #344767;
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0;
    }

    .table-card-mobile > .table tbody td:last-child {
        border-bottom: 0 !important;
    }

    .table-card-mobile > .table tbody td[colspan] {
        display: block;
        text-align: center !important;
    }

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

    .table-card-mobile .table-actions {
        justify-content: flex-start;
    }

    .table-toolbar {
        align-items: stretch;
    }

    .table-search {
        width: 100%;
    }
}
