/* Grid.js + Tabler card-table integration */

.vb-admin-table {
    --vb-table-font-size: 0.875rem;
    --vb-table-line-height: 1.4;
}

.vb-admin-static-table {
    --vb-table-font-size: 0.875rem;
    --vb-table-line-height: 1.4;
}

.vb-admin-table .gridjs-container {
    width: 100% !important;
    color: inherit;
    overflow: visible;
}

.vb-admin-table .gridjs-head {
    display: none;
}

.vb-admin-table .gridjs-wrapper {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: auto;
    max-width: 100%;
    min-height: 12rem;
    /* Room below last row so dropdown menus are not clipped */
    padding-bottom: 9rem;
    -webkit-overflow-scrolling: touch;
}

.vb-admin-table .gridjs-table {
    width: 100% !important;
    table-layout: fixed;
    margin-bottom: 0;
}

/* Unified table typography */
.vb-admin-table .gridjs-table th.gridjs-th,
.vb-admin-table .gridjs-table td.gridjs-td,
.vb-admin-table .btn-sm,
.vb-admin-table .dropdown-item,
.vb-admin-table .badge,
.vb-admin-table .status,
.vb-admin-table .gridjs-summary,
.vb-admin-table .gridjs-pagination .gridjs-pages button {
    font-size: var(--vb-table-font-size) !important;
}

.vb-admin-table .gridjs-table th.gridjs-th,
.vb-admin-table .gridjs-table td.gridjs-td {
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: var(--tblr-border-width) var(--tblr-border-style) var(--tblr-border-color) !important;
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    background: transparent !important;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--vb-table-font-size) !important;
    line-height: var(--vb-table-line-height) !important;
}

/* All cell content uses the same font size — weight/color may vary */
.vb-admin-table .gridjs-table td.gridjs-td :where(
    small, .small, code, kbd, pre, strong, b, span, div, a, p, li, em,
    h1, h2, h3, h4, h5, h6,
    .fw-semibold, .fw-medium, .fw-bold,
    .text-secondary, .text-muted, .parent-category,
    .audit-entity, .audit-action, .audit-timestamp
),
.vb-admin-table .gridjs-table td.gridjs-td [class*="fs-"] {
    font-size: inherit !important;
    line-height: inherit;
}

.vb-admin-static-table .table thead th,
.vb-admin-static-table .table tbody td {
    font-size: var(--vb-table-font-size) !important;
    line-height: var(--vb-table-line-height) !important;
}

.vb-admin-static-table .table tbody td :where(
    small, .small, code, kbd, pre, strong, b, span, div, a, p, li, em,
    h1, h2, h3, h4, h5, h6,
    .fw-semibold, .fw-medium, .fw-bold,
    .text-secondary, .text-muted
),
.vb-admin-static-table .table tbody td [class*="fs-"] {
    font-size: inherit !important;
    line-height: inherit;
}

.vb-admin-table .gridjs-table th.gridjs-th {
    font-weight: var(--tblr-font-weight-medium, 600);
    color: var(--tblr-secondary);
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    text-align: left;
}

.vb-admin-table .gridjs-table tr:last-child td.gridjs-td {
    border-bottom: 0 !important;
}

.vb-admin-table .gridjs-table tr:hover td.gridjs-td {
    background-color: var(--tblr-hover-bg, rgba(0, 0, 0, 0.02)) !important;
}

html[data-bs-theme=dark] .vb-admin-table .gridjs-table tr:hover td.gridjs-td {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* card-table edge padding */
.vb-admin-table .gridjs-table tr td:first-child,
.vb-admin-table .gridjs-table tr th:first-child {
    padding-left: 1.25rem;
}

.vb-admin-table .gridjs-table tr td:last-child,
.vb-admin-table .gridjs-table tr th:last-child {
    padding-right: 1.25rem;
}

/* Column widths (desktop) */
.vb-admin-table .vb-col-select {
    width: 2.75rem;
    text-align: center;
}

.vb-admin-table .vb-col-select .form-check {
    display: flex;
    justify-content: center;
    margin: 0;
}

.vb-admin-table .vb-col-id { width: 3.25rem; }
.vb-admin-table .vb-col-title { width: 26%; }
.vb-admin-table .vb-col-type { width: 6.75rem; }
.vb-admin-table .vb-col-content {
    width: 18%;
    min-width: 0;
}
.vb-admin-table .vb-col-comment {
    width: 24%;
    min-width: 0;
}
.vb-admin-table .vb-col-parent {
    width: 6rem;
    min-width: 5.5rem;
    max-width: 7rem;
}
.vb-admin-table .vb-col-recipients { width: 6.5rem; }
.vb-admin-table .vb-col-status { width: 8.5rem; min-width: 8.5rem; }
.vb-admin-table .vb-col-date { width: 8rem; min-width: 7rem; }

/* Audit log — percentage widths so columns fill the table */
.vb-audit-log-page .vb-admin-table .gridjs-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
}
.vb-audit-log-page .vb-admin-table .vb-col-date {
    width: 14% !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap;
}
.vb-audit-log-page .vb-admin-table .vb-col-date .audit-timestamp {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.vb-admin-table .vb-col-user {
    width: 12rem;
    min-width: 12rem;
    max-width: 14rem;
}
.vb-audit-log-page .vb-admin-table .vb-col-user {
    width: 18% !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 0.75rem !important;
    overflow: visible;
}
.vb-audit-log-page .vb-admin-table .vb-col-user .audit-user-cell {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}
.vb-audit-log-page .vb-admin-table .vb-col-user .audit-user-cell .fw-semibold,
.vb-audit-log-page .vb-admin-table .vb-col-user .audit-user-cell small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vb-audit-log-page .vb-admin-table .vb-col-user .vb-table-avatar {
    flex-shrink: 0;
    margin-right: 0.5rem;
}
.vb-admin-table .vb-col-entity {
    width: 8.5rem;
    min-width: 8.5rem;
    max-width: 10rem;
}
.vb-audit-log-page .vb-admin-table .vb-col-entity {
    width: 14% !important;
    min-width: 0 !important;
    max-width: none !important;
}
.vb-admin-table .vb-col-details {
    min-width: 10rem;
    width: 22%;
    max-width: 20rem;
}
.vb-admin-table .vb-col-details .audit-details-cell {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vb-admin-table .vb-col-audit-action {
    min-width: 9.5rem;
    max-width: 13rem;
}
.vb-audit-log-page .vb-admin-table .vb-col-audit-action {
    width: 26% !important;
    min-width: 0 !important;
    max-width: none !important;
}
.vb-admin-table .vb-col-audit-action .status {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    justify-content: flex-start;
}
.vb-audit-log-page .vb-admin-table .vb-col-audit-action .status {
    white-space: nowrap;
    word-break: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vb-admin-table .vb-col-ip {
    width: 8.5rem;
    min-width: 8.5rem;
    max-width: 9.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
}
.vb-audit-log-page .vb-admin-table .vb-col-ip {
    width: 10% !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* Comments admin — 4-column layout: Date, Type, Comment, Actions */
.vb-comments-admin-page .vb-admin-table .gridjs-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
}
.vb-comments-admin-page .vb-admin-table .vb-col-date {
    width: 9.5rem !important;
    min-width: 9.5rem !important;
    max-width: none !important;
}
.vb-comments-admin-page .vb-admin-table .vb-col-date.gridjs-td,
.vb-comments-admin-page .vb-admin-table th.vb-col-date {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
}
.vb-comments-admin-page .vb-admin-table .vb-col-type {
    width: 7.5rem !important;
    min-width: 7rem !important;
    max-width: 8.5rem !important;
}
.vb-comments-admin-page .vb-admin-table .vb-col-comment {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}
.vb-comments-admin-page .vb-admin-table .vb-col-comment.gridjs-td,
.vb-comments-admin-page .vb-admin-table th.vb-col-comment {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
}
.vb-comments-admin-page .vb-admin-table .vb-col-actions {
    width: 8.75rem !important;
    min-width: 8.75rem !important;
    max-width: 8.75rem !important;
}
.vb-comments-admin-page .vb-admin-table td.vb-col-actions {
    vertical-align: bottom !important;
}
.vb-comments-admin-page .vb-admin-table .vb-col-actions .dropdown {
    display: inline-flex;
    align-items: flex-end;
}
.vb-admin-table .vb-col-actions {
    width: 8.75rem;
    min-width: 8.75rem;
    max-width: 8.75rem;
    text-align: center;
    overflow: visible;
}

.vb-admin-table td.gridjs-td.vb-col-actions,
.vb-admin-table th.gridjs-th.vb-col-actions {
    overflow: visible !important;
}

.vb-admin-table .vb-col-actions .dropdown,
.vb-table-actions-dropdown {
    display: inline-flex;
    justify-content: center;
    position: relative;
}

.vb-admin-table .vb-col-actions .dropdown {
    display: inline-flex;
    justify-content: center;
    position: relative;
    width: auto;
    max-width: none;
}

/* Actions dropdown button — Tabler chevron, no clipped Bootstrap caret */
.vb-table-actions-dropdown .dropdown-toggle.vb-table-toolbar-btn {
    width: auto;
    min-width: 7.75rem;
    max-width: 7.75rem;
    justify-content: space-between !important;
    gap: 0.5rem;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    overflow: visible;
}

.vb-table-actions-dropdown .dropdown-toggle::after {
    display: none !important;
}

.vb-table-actions-label {
    flex: 1 1 auto;
    text-align: left;
}

.vb-table-actions-chevron {
    flex: 0 0 auto;
    font-size: 0.875rem;
    line-height: 1;
    opacity: 0.75;
}

.vb-table-actions-dropdown .dropdown-menu {
    z-index: 1060;
    min-width: 9rem;
    margin-top: 0.125rem;
}

/* Title / user avatars — fixed square size for images and initials */
.vb-admin-table .vb-table-avatar,
.vb-admin-static-table .vb-table-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.5rem;
    width: 2.5rem !important;
    height: 2.5rem !important;
    min-width: 2.5rem !important;
    max-width: 2.5rem !important;
    min-height: 2.5rem !important;
    max-height: 2.5rem !important;
    margin-right: 0.625rem;
    border-radius: var(--tblr-border-radius, 0.375rem);
    overflow: hidden;
    background: var(--tblr-bg-surface-secondary, rgba(255, 255, 255, 0.06));
    box-shadow: inset 0 0 0 1px var(--tblr-border-color-translucent, rgba(255, 255, 255, 0.08));
}

.vb-admin-table .vb-table-avatar img,
.vb-admin-static-table .vb-table-avatar img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover;
}

.vb-admin-table .vb-table-avatar-initials,
.vb-admin-static-table .vb-table-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.75rem !important;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--vb-brand-purple, #8b5cf6);
}

html[data-bs-theme=dark] .vb-admin-table .vb-table-avatar-initials,
html[data-bs-theme=dark] .vb-admin-static-table .vb-table-avatar-initials {
    color: #c4b5fd;
}

/* Type + status pills — consistent sizing and readable text */
.vb-admin-table .status,
.vb-dashboard .status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 5.75rem;
    padding: 0.25rem 0.55rem;
    font-size: var(--vb-table-font-size) !important;
    font-weight: 600;
    line-height: var(--vb-table-line-height);
    white-space: nowrap;
    justify-content: flex-start;
}

.vb-admin-table .vb-col-type .status,
.vb-admin-table .vb-col-status .status {
    min-width: 5.75rem;
    justify-content: flex-start;
}

html[data-bs-theme=light] .vb-dashboard .status-success {
    color: #1a7f37;
    background: rgba(26, 127, 55, 0.12);
}

html[data-bs-theme=light] .vb-dashboard .status-success .status-dot {
    background: #1a7f37;
}

html[data-bs-theme=light] .vb-dashboard .status-secondary {
    color: #57606a;
    background: rgba(87, 96, 106, 0.12);
}

html[data-bs-theme=light] .vb-dashboard .status-secondary .status-dot {
    background: #57606a;
}

html[data-bs-theme=light] .vb-dashboard .status-info {
    color: #0559a8;
    background: rgba(6, 89, 168, 0.12);
}

html[data-bs-theme=light] .vb-dashboard .status-info .status-dot {
    background: #0559a8;
}

html[data-bs-theme=light] .vb-dashboard .status-warning {
    color: #9a6700;
    background: rgba(154, 103, 0, 0.12);
}

html[data-bs-theme=light] .vb-dashboard .status-warning .status-dot {
    background: #9a6700;
}

html[data-bs-theme=light] .vb-dashboard .status-danger {
    color: #c53030;
    background: rgba(197, 48, 48, 0.12);
}

html[data-bs-theme=light] .vb-dashboard .status-danger .status-dot {
    background: #c53030;
}

html[data-bs-theme=dark] .vb-dashboard .status-success {
    color: #3dd68c;
    background: rgba(47, 179, 68, 0.18);
}

html[data-bs-theme=dark] .vb-dashboard .status-success .status-dot {
    background: #3dd68c;
}

html[data-bs-theme=dark] .vb-dashboard .status-secondary {
    color: #adbac7;
    background: rgba(173, 186, 199, 0.12);
}

html[data-bs-theme=dark] .vb-dashboard .status-secondary .status-dot {
    background: #adbac7;
}

html[data-bs-theme=dark] .vb-dashboard .status-info {
    color: #79c0ff;
    background: rgba(66, 153, 225, 0.18);
}

html[data-bs-theme=dark] .vb-dashboard .status-info .status-dot {
    background: #79c0ff;
}

html[data-bs-theme=dark] .vb-dashboard .status-warning {
    color: #f0b429;
    background: rgba(240, 180, 41, 0.16);
}

html[data-bs-theme=dark] .vb-dashboard .status-warning .status-dot {
    background: #f0b429;
}

html[data-bs-theme=dark] .vb-dashboard .status-danger {
    color: #ff7b72;
    background: rgba(214, 57, 57, 0.18);
}

html[data-bs-theme=dark] .vb-dashboard .status-danger .status-dot {
    background: #ff7b72;
}

.vb-dashboard .support-colored-status,
.vb-admin-table .support-colored-status {
    color: var(--status-color, #57606a);
    background: color-mix(in srgb, var(--status-color, #57606a) 14%, transparent);
}

.vb-dashboard .support-colored-status .status-dot,
.vb-admin-table .support-colored-status .status-dot {
    background: var(--status-color, #57606a);
}

/* Stat count badges (sent / success / failed) — readable in light + dark */
.vb-admin-table .vb-stat-badge,
.vb-dashboard .vb-stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0.2rem 0.5rem;
    font-size: var(--vb-table-font-size) !important;
    font-weight: 600;
    line-height: var(--vb-table-line-height);
    border-radius: var(--tblr-border-radius, 0.375rem);
    white-space: nowrap;
}

.vb-admin-table .vb-stat-badge-info,
.vb-dashboard .vb-stat-badge-info {
    color: #79c0ff;
    background: rgba(66, 153, 225, 0.18);
}

.vb-admin-table .vb-stat-badge-success,
.vb-dashboard .vb-stat-badge-success {
    color: #3dd68c;
    background: rgba(47, 179, 68, 0.18);
}

.vb-admin-table .vb-stat-badge-danger,
.vb-dashboard .vb-stat-badge-danger {
    color: #ff7b72;
    background: rgba(214, 57, 57, 0.18);
}

html[data-bs-theme=light] .vb-dashboard .vb-stat-badge-info {
    color: #0559a8;
    background: rgba(6, 89, 168, 0.12);
}

html[data-bs-theme=light] .vb-dashboard .vb-stat-badge-success {
    color: #1a7f37;
    background: rgba(26, 127, 55, 0.12);
}

html[data-bs-theme=light] .vb-dashboard .vb-stat-badge-danger {
    color: #c53030;
    background: rgba(197, 48, 48, 0.12);
}

/* Status dot visibility */
.vb-admin-table .status .status-dot,
.vb-dashboard .status .status-dot {
    flex-shrink: 0;
}

/* Sort header: label left, Tabler icon at right */
.vb-admin-table th:has(button.gridjs-sort) {
    position: relative;
    overflow: visible !important;
    vertical-align: middle;
}

.vb-admin-table .vb-th-sort-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.375rem;
}

.vb-admin-table .vb-th-sort-wrap .gridjs-th-content {
    display: block !important;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vb-admin-table button.gridjs-sort {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 1rem;
    float: none !important;
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem !important;
    max-width: 1rem !important;
    min-height: 1rem !important;
    max-height: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    vertical-align: middle;
    overflow: visible !important;
    background: transparent !important;
    background-image: none !important;
    background-size: 0 !important;
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-size: inherit !important;
    line-height: 1 !important;
    color: inherit !important;
}

.vb-admin-table button.gridjs-sort .ti {
    display: block;
    font-size: 0.875rem;
    line-height: 1;
    color: var(--tblr-secondary);
}

.vb-admin-table button.gridjs-sort-asc .ti,
.vb-admin-table button.gridjs-sort-desc .ti {
    color: var(--vb-brand-purple, #8b5cf6);
}

html[data-bs-theme=dark] .vb-admin-table button.gridjs-sort,
html[data-bs-theme=dark] .vb-admin-table button.gridjs-sort-neutral,
html[data-bs-theme=dark] .vb-admin-table button.gridjs-sort-asc,
html[data-bs-theme=dark] .vb-admin-table button.gridjs-sort-desc {
    filter: none !important;
    -webkit-filter: none !important;
    background-image: none !important;
}

html[data-bs-theme=dark] .vb-admin-table button.gridjs-sort .ti {
    color: var(--tblr-secondary);
}

html[data-bs-theme=dark] .vb-admin-table button.gridjs-sort-asc .ti,
html[data-bs-theme=dark] .vb-admin-table button.gridjs-sort-desc .ti {
    color: var(--vb-brand-purple, #a78bfa);
}

html[data-bs-theme=dark] .vb-admin-table .gridjs-table th.gridjs-th {
    background: transparent !important;
}

/* Override global dark gridjs header styles inside admin tables */
html[data-bs-theme=dark] .vb-admin-table .gridjs-th {
    background-color: transparent !important;
    color: var(--tblr-secondary) !important;
}

html[data-bs-theme=dark] .vb-admin-table .gridjs-pagination .gridjs-pages button {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--tblr-body-color) !important;
}

html[data-bs-theme=dark] .vb-admin-table .gridjs-pagination .gridjs-pages button:hover:not(:disabled):not(.gridjs-currentPage) {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

html[data-bs-theme=dark] .vb-admin-table .gridjs-pagination .gridjs-pages button.gridjs-currentPage {
    background-color: var(--vb-brand-purple) !important;
    border-color: var(--vb-brand-purple) !important;
    color: #fff !important;
}

/* Footer / pagination — Tabler-style */
.vb-admin-table .gridjs-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    width: 100% !important;
    padding: 0.75rem 1.25rem !important;
    border: 0 !important;
    border-top: var(--tblr-border-width) var(--tblr-border-style) var(--tblr-border-color) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.vb-admin-table .gridjs-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    width: 100%;
    margin: 0 !important;
    gap: 1rem;
}

.vb-admin-table .gridjs-summary {
    margin: 0 !important;
    color: var(--tblr-secondary) !important;
    flex: 1 1 auto;
}

.vb-admin-table .gridjs-pagination .gridjs-pages {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.vb-admin-table .gridjs-pagination .gridjs-pages button {
    margin: 0 !important;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.75rem !important;
    border: var(--tblr-border-width) solid var(--tblr-border-color) !important;
    border-radius: var(--tblr-border-radius) !important;
    background: transparent !important;
    color: var(--tblr-body-color) !important;
    line-height: 1;
    box-shadow: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.vb-admin-table .gridjs-pagination .gridjs-pages button:hover:not(:disabled):not(.gridjs-currentPage) {
    background-color: var(--tblr-hover-bg, rgba(0, 0, 0, 0.04)) !important;
    color: var(--tblr-body-color) !important;
}

.vb-admin-table .gridjs-pagination .gridjs-pages button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.vb-admin-table .gridjs-pagination .gridjs-pages button.gridjs-currentPage {
    background-color: var(--vb-brand-purple) !important;
    border-color: var(--vb-brand-purple) !important;
    color: #fff !important;
}

/* Search relocated to toolbar */
.vb-table-toolbar-search .gridjs-search::before,
.vb-table-toolbar-search .vb-grid-search::before,
.vb-admin-table .gridjs-search::before {
    content: none !important;
    display: none !important;
}

.vb-grid-search .vb-search-icon,
.vb-table-toolbar-search .vb-search-icon {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    color: var(--tblr-secondary);
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.vb-grid-search .vb-search-icon .ti,
.vb-table-toolbar-search .vb-search-icon .ti {
    font-size: 0.9375rem;
}

.vb-grid-search,
.vb-table-toolbar-search .gridjs-search,
.vb-table-toolbar-search .vb-grid-search {
    position: relative;
    width: 100%;
    float: none;
    margin: 0;
}

.vb-table-toolbar-search input.gridjs-input {
    width: 100%;
    max-width: none;
    height: 2.375rem !important;
    min-height: 2.375rem !important;
    font-size: 0.875rem !important;
    padding: 0 2.25rem 0 2rem !important;
}

.vb-table-toolbar-search .vb-search-clear {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: var(--tblr-border-radius-sm, 0.25rem);
    background: transparent;
    color: var(--tblr-secondary);
    cursor: pointer;
    line-height: 1;
}

.vb-table-toolbar-search .vb-search-clear[hidden] {
    display: none !important;
}

.vb-table-toolbar-search .vb-search-clear .ti {
    font-size: 0.875rem;
    line-height: 1;
}

.vb-table-toolbar-search .vb-search-clear:hover,
.vb-table-toolbar-search .vb-search-clear:focus-visible {
    color: var(--tblr-body-color);
    background: var(--tblr-hover-bg, rgba(0, 0, 0, 0.06));
}

html[data-bs-theme=light] .vb-table-toolbar-search .vb-search-clear:hover,
html[data-bs-theme=light] .vb-table-toolbar-search .vb-search-clear:focus-visible {
    background: rgba(27, 31, 36, 0.06);
    color: #24292f;
}

/* Tabler table-mobile-lg stacking (no horizontal scroll) */
@media (max-width: 991.98px) {
    .vb-admin-table .gridjs-wrapper {
        overflow-x: visible !important;
    }

    .vb-admin-table .gridjs-table {
        table-layout: auto !important;
    }

    .vb-admin-table .gridjs-table th.gridjs-th,
    .vb-admin-table .gridjs-table td.gridjs-td {
        overflow: visible !important;
        text-overflow: unset !important;
        white-space: normal;
    }

    /* Card-style stacked rows with visible borders */
    .vb-admin-table .gridjs-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.5rem 1rem 1rem;
    }

    .vb-admin-table .table-mobile-lg tbody tr {
        display: flex;
        flex-direction: column;
        border: var(--tblr-border-width) solid var(--tblr-border-color) !important;
        border-radius: var(--tblr-border-radius, 0.375rem);
        padding: 0.25rem 0;
        margin: 0;
        background: var(--tblr-bg-surface, #fff);
        overflow: hidden;
    }

    html[data-bs-theme=dark] .vb-admin-table .table-mobile-lg tbody tr {
        background: var(--tblr-bg-surface, var(--tblr-card-bg, #1a1d21));
    }

    .vb-admin-table .table-mobile-lg td.gridjs-td {
        border-bottom: 0 !important;
        border-top: 0 !important;
        padding: 0.625rem 1rem !important;
        width: 100% !important;
        max-width: none !important;
    }

    .vb-admin-table .table-mobile-lg td.vb-col-select {
        padding-bottom: 0.25rem !important;
    }

    .vb-admin-table .table-mobile-lg td[data-label]:before {
        display: block;
        margin-bottom: 0.4375rem;
        font-size: 0.6875rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        line-height: 1.2;
        text-transform: uppercase;
        color: var(--tblr-secondary);
    }

    .vb-admin-table .vb-col-id,
    .vb-admin-table .vb-col-title,
    .vb-admin-table .vb-col-type,
    .vb-admin-table .vb-col-content,
    .vb-admin-table .vb-col-comment,
    .vb-admin-table .vb-col-parent,
    .vb-admin-table .vb-col-recipients,
    .vb-admin-table .vb-col-status,
    .vb-admin-table .vb-col-date,
    .vb-admin-table .vb-col-user,
    .vb-admin-table .vb-col-entity,
    .vb-admin-table .vb-col-details,
    .vb-admin-table .vb-col-audit-action,
    .vb-admin-table .vb-col-ip,
    .vb-admin-table .vb-col-actions {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        text-align: left !important;
    }

    .vb-admin-table .vb-col-audit-action .status,
    .vb-admin-table .vb-col-user .audit-user-cell .fw-semibold,
    .vb-admin-table .vb-col-user .audit-user-cell small,
    .vb-admin-table .vb-col-date .audit-timestamp {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
    }

    .vb-admin-table .vb-col-actions .dropdown {
        display: block;
        width: 100%;
    }

    .vb-admin-table .vb-col-actions .btn.vb-table-toolbar-btn {
        width: 100%;
        justify-content: space-between !important;
    }
}

/* Table loading shell */
.vb-admin-table-shell {
    position: relative;
}

.vb-admin-table-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1rem;
    color: var(--tblr-secondary);
}

.vb-admin-table-loading[hidden] {
    display: none !important;
}

.vb-admin-table-shell.is-loading .vb-admin-table {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.vb-admin-table-shell.is-loading {
    min-height: 8rem;
}

/* Entity logs — compact 4-column layout (Time, User, Action, Actions) */
.vb-entity-logs-page .vb-entity-logs-table-card > .card-body {
    flex: 0 0 auto;
}

.vb-entity-logs-page .vb-admin-table .gridjs-wrapper {
    overflow-x: visible;
    min-height: 0;
    padding-bottom: 4rem;
}

.vb-entity-logs-page .vb-admin-table .gridjs-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
}

.vb-entity-logs-page .vb-admin-table .vb-col-date {
    width: 17% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.vb-entity-logs-page .vb-admin-table .vb-col-date .audit-timestamp {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.vb-entity-logs-page .vb-admin-table .vb-col-user {
    width: 30% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.vb-entity-logs-page .vb-admin-table .vb-col-user .audit-user-cell .fw-semibold,
.vb-entity-logs-page .vb-admin-table .vb-col-user .audit-user-cell small {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.vb-entity-logs-page .vb-admin-table .vb-col-audit-action {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

.vb-entity-logs-page .vb-admin-table .vb-col-audit-action .status {
    white-space: nowrap;
    word-break: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
}

.vb-entity-logs-page .vb-admin-table .vb-col-actions {
    width: 7.25rem !important;
    min-width: 7.25rem !important;
    max-width: 7.25rem !important;
}
