
/* Tables */
.app-shell .table-responsive {
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* The original theme pulls tables outside their card with negative margins.
 * Keep every table aligned to the same content edge as the card around it. */
.app-shell .card-table > .table-responsive {
    width: 100%;
    margin: 0;
}

.app-shell table,
.app-shell .table {
    width: 100%;
    margin: 0;
    color: var(--ui-text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    background: transparent;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: none;
}

.app-shell .table > thead > tr > th,
.app-shell table > thead > tr > th,
.app-shell table > tbody > tr:first-child > th {
    height: 56px;
    padding: 12px 24px;
    color: var(--ui-text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: normal;
    background: var(--ui-surface-soft);
    border-bottom: 1px solid var(--ui-border);
    white-space: nowrap;
}

/* Use small paired carets, independent of the legacy icon font's baseline. */
.app-shell table.dataTable thead > tr > th.sorting,
.app-shell table.dataTable thead > tr > th.sorting_asc,
.app-shell table.dataTable thead > tr > th.sorting_desc,
.app-shell table.dataTable thead > tr > th.sorting_asc_disabled,
.app-shell table.dataTable thead > tr > th.sorting_desc_disabled {
    padding-right: 38px !important;
}

.app-shell table.dataTable thead .sorting::before,
.app-shell table.dataTable thead .sorting::after,
.app-shell table.dataTable thead .sorting_asc::before,
.app-shell table.dataTable thead .sorting_asc::after,
.app-shell table.dataTable thead .sorting_desc::before,
.app-shell table.dataTable thead .sorting_desc::after,
.app-shell table.dataTable thead .sorting_asc_disabled::before,
.app-shell table.dataTable thead .sorting_asc_disabled::after,
.app-shell table.dataTable thead .sorting_desc_disabled::before,
.app-shell table.dataTable thead .sorting_desc_disabled::after {
    top: 50%;
    right: 12px;
    bottom: auto;
    width: 5px;
    height: 5px;
    content: "";
    border-top: 1px solid currentColor;
    border-left: 1px solid currentColor;
    color: #6f8295;
    font-size: 11px;
    line-height: 10px;
    text-align: center;
    opacity: .28;
    pointer-events: none;
}

.app-shell table.dataTable thead .sorting::before,
.app-shell table.dataTable thead .sorting_asc::before,
.app-shell table.dataTable thead .sorting_desc::before,
.app-shell table.dataTable thead .sorting_asc_disabled::before,
.app-shell table.dataTable thead .sorting_desc_disabled::before {
    transform: translateY(-5px) rotate(45deg);
}

.app-shell table.dataTable thead .sorting::after,
.app-shell table.dataTable thead .sorting_asc::after,
.app-shell table.dataTable thead .sorting_desc::after,
.app-shell table.dataTable thead .sorting_asc_disabled::after,
.app-shell table.dataTable thead .sorting_desc_disabled::after {
    transform: translateY(2px) rotate(225deg);
}

.app-shell table.dataTable thead .sorting_asc::before,
.app-shell table.dataTable thead .sorting_desc::after {
    opacity: 1;
}

.app-shell table.dataTable thead .sorting_asc_disabled::before,
.app-shell table.dataTable thead .sorting_desc_disabled::after {
    opacity: 0;
}

.app-shell .table > tbody > tr > td,
.app-shell table > tbody > tr > td {
    height: 48px;
    padding: 12px 24px;
    border-top: 1px solid var(--ui-border-soft);
    border-bottom: 0;
    vertical-align: middle;
    line-height: 1.5;
}

.app-shell .table > tbody > tr:first-child > td,
.app-shell table > tbody > tr:first-child > td {
    border-top: 0;
}

.app-shell .table > tbody > tr:hover,
.app-shell table > tbody > tr:hover {
    background: var(--ui-surface-soft);
}

.app-shell table.dataTable thead th.sorting_asc,
.app-shell table.dataTable thead th.sorting_desc {
    color: #212121;
}

.app-shell table th.dt-head-right,
.app-shell table td.dt-body-right {
    text-align: right;
}

.app-shell .dataTables_wrapper .dataTables_filter input,
.app-shell .dataTables_wrapper .dataTables_length select {
    min-height: 38px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #cfd9e4;
    border-radius: var(--ui-radius);
}

/* Keep every admin table's controls fixed while only its rows scroll. */
.app-shell .ui-column-options {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
    gap: 8px 22px;
}

.app-shell .ui-column-option {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0;
    gap: 8px;
    color: var(--ui-text-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
}

.app-shell .ui-column-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    accent-color: var(--ui-accent);
    cursor: pointer;
}

.app-shell-admin .table-responsive {
    padding: 18px;
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
    overflow-x: auto;
}

.app-shell-admin .table-responsive .dataTables_wrapper {
    min-width: 0;
}

.app-shell-admin .table-responsive .dataTables_wrapper > .mdl-grid {
    display: grid;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 14px;
}

.app-shell-admin .table-responsive .dataTables_wrapper > .mdl-grid:first-child {
    grid-template-columns: minmax(130px, auto) minmax(220px, 320px);
    align-items: center;
    justify-content: space-between;
}

.app-shell-admin .table-responsive .dataTables_wrapper > .mdl-grid:last-child {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin-top: 14px;
}

.app-shell-admin .table-responsive .dataTables_wrapper > .mdl-grid > .mdl-cell {
    width: auto;
    min-width: 0;
    margin: 0;
}

.app-shell-admin .table-responsive .dataTables_length label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    color: var(--ui-text-muted);
    font-size: 13px;
    font-weight: 620;
    gap: 7px;
}

.app-shell-admin .table-responsive .dataTables_length select {
    width: 66px;
    margin: 0;
}

.app-shell-admin .table-responsive .dataTables_wrapper .dataTables_filter {
    width: 100%;
    text-align: left;
}

.app-shell-admin .table-responsive .dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--ui-text-muted);
    font-size: 13px;
    font-weight: 620;
    text-align: left;
    white-space: nowrap;
    gap: 10px;
}

.app-shell-admin .table-responsive .dataTables_filter input {
    width: 100%;
    min-width: 0;
    margin: 0;
}

/* DataTables Bootstrap 5 puts the table inside .dt-row > .col-sm-12.
 * Scroll that column, not the toolbar/pagination or a legacy MDL wrapper. */
.app-shell .dataTables_wrapper > .dt-row {
    display: block;
    min-width: 0;
    margin: 16px 0 0;
}

.app-shell .dataTables_wrapper > .dt-row > .col-sm-12 {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    border-top: 1px solid var(--ui-border);
    border-bottom: 1px solid var(--ui-border);
    border-radius: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-shell-admin .table-responsive table.dataTable {
    min-width: max-content;
    border: 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.app-shell-admin .table-responsive table.dataTable th,
.app-shell-admin .table-responsive table.dataTable td {
    text-align: left;
    white-space: nowrap;
}

.page-admin-users #table_1 th:first-child,
.page-admin-users #table_1 td:first-child {
    min-width: 244px;
}

.app-shell-admin .table-responsive table.dataTable tbody .btn {
    min-height: 32px;
    margin: 2px 4px 2px 0;
    padding: 5px 9px;
    color: var(--ui-admin-dark) !important;
    font-size: 13px;
    line-height: 1.3;
    background: transparent;
    border-color: transparent;
    border-radius: var(--ui-radius-pill);
    box-shadow: none;
    text-align: center;
    vertical-align: middle;
}

.app-shell-admin .table-responsive table.dataTable tbody .btn-brand-accent {
    color: #c62828 !important;
    background: transparent;
    border-color: transparent;
}

.app-shell-admin .table-responsive table.dataTable tbody .btn:hover,
.app-shell-admin .table-responsive table.dataTable tbody .btn:focus {
    background: var(--ui-primary-soft);
}

.app-shell-admin .table-responsive table.dataTable tbody .btn-brand-accent:hover,
.app-shell-admin .table-responsive table.dataTable tbody .btn-brand-accent:focus {
    background: #ffebee;
}

.app-shell-admin .table-responsive table.dataTable tbody .btn:not(.disabled):active {
    box-shadow: none;
}

.app-shell-admin .table-responsive table.dataTable tbody .btn.disabled,
.app-shell-admin .table-responsive table.dataTable tbody .btn:disabled {
    color: #757575 !important;
    background: transparent;
    box-shadow: none;
}

.app-shell-admin .table-responsive .dataTables_info,
.app-shell-admin .table-responsive .dataTables_paginate {
    padding: 0;
    color: var(--ui-text-muted);
    font-size: 12px;
}

.app-shell-admin .table-responsive .dataTables_paginate .paginate_button,
.app-shell-admin .table-responsive .dataTables_paginate .mdl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    margin: 2px;
    padding: 0 11px;
    color: var(--ui-text-muted) !important;
    line-height: 1;
    text-align: center;
    background: #fff;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-pill);
    box-shadow: none;
}

.app-shell-admin .table-responsive .dataTables_paginate .paginate_button.current,
.app-shell-admin .table-responsive .dataTables_paginate .mdl-button--raised {
    color: var(--ui-primary-dark) !important;
    background: var(--ui-primary-soft);
    border-color: transparent;
}

.app-shell-admin .table-responsive .dataTables_paginate .paginate_button.disabled,
.app-shell-admin .table-responsive .dataTables_paginate .mdl-button.disabled {
    color: #a4b0bd !important;
    background: #f7f9fb;
    cursor: not-allowed;
}

/* Announcement bodies may contain several paragraphs and line breaks. Keep
 * the management list compact; the edit screen remains the full-content view. */
.page-admin-announcements table.dataTable tbody td:last-child {
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-admin-announcements table.dataTable tbody td:last-child > p {
    display: inline;
    margin: 0;
}

.page-admin-announcements table.dataTable tbody td:last-child > p + p::before {
    content: " · ";
}

.page-admin-announcements table.dataTable tbody td:last-child br {
    display: none;
}

/* Keep list actions in normal flow so they never cover rows or pagination. */
.app-shell .fbtn-container {
    position: static;
    display: flex;
    width: 100%;
    margin: 16px 0 0;
    justify-content: flex-end;
    transform: none !important;
}

.app-shell .fbtn-brand-accent {
    color: #fff;
    background: var(--ui-accent);
}

.app-shell .fbtn-brand-accent:hover,
.app-shell .fbtn-brand-accent:focus {
    color: #fff;
    background: var(--ui-accent-dark);
}
