/* Widget tabloları — Bootstrap utility (CRM datatable: valent-datatable-crud.css) */
.valent-dashboard .table th.text-end,
.valent-dashboard .table td.text-end {
    text-align: right !important;
}

.valent-dashboard .table th.text-center,
.valent-dashboard .table td.text-center {
    text-align: center !important;
}

/* Tablo kaydırma — mobilde sütun sıkışmasını önle (DataTable hariç) */
.page-content .table-responsive,
.valent-dashboard .table-responsive,
.valent-page-dashboard .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.page-content .table-responsive > table.table:not(.dataTable),
.page-content .card-body .table-responsive > table.table:not(.dataTable),
.valent-dashboard .table-responsive > table.table:not(.dataTable),
.valent-page-dashboard .table-responsive > table.table:not(.dataTable) {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 100%;
    max-width: none;
}

/* Kart içi tablo (responsive sarmalayıcı yok) — yine sıkıştırma */
.page-content .card-body > table.table:not(.dataTable):not(.valent-bill-summary-table),
.valent-dashboard .card-body > table.table:not(.dataTable):not(.valent-bill-summary-table) {
    table-layout: auto !important;
    width: 100% !important;
    max-width: 100%;
}

/* Dashboard içerik düzeni — index.php referansı (1rem blok aralığı) */
.valent-dashboard {
    --valent-dash-gap: 1rem;
    display: flex;
    flex-direction: column;
    gap: var(--valent-dash-gap);
    width: 100%;
}

.valent-dashboard > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.valent-dash-grid {
    display: grid;
    gap: var(--valent-dash-gap);
    width: 100%;
    margin: 0;
}

.valent-dash-cell {
    min-width: 0;
}

/* Footer öncesi — page-container + layout-end.php */
.page-content > .page-container {
    flex: 1 0 auto;
    width: 100%;
    padding-bottom: var(--valent-dash-gap, 1rem);
}

body.valent-page-bulk-messaging .page-content > .page-container,
body.valent-page-compact-footer .page-content > .page-container {
    padding-bottom: 0;
}

.page-content > .footer {
    margin-top: auto !important;
    flex-shrink: 0;
}

.page-content .dataTables_wrapper,
.valent-dt-scroll-wrap .dataTables_wrapper {
    width: 100% !important;
    max-width: 100%;
}

.page-content .dataTables_scrollHeadInner {
    width: 100% !important;
    box-sizing: border-box;
}

/* index.php — ValentTablePagination (DataTable hariç) */
.valent-table-pagination {
    background: transparent;
    flex-shrink: 0;
}

.valent-table-pagination .pagination-boxed .page-link {
    min-width: 2rem;
    text-align: center;
}

[data-bs-theme=dark] .valent-table-pagination {
    border: none !important;
}

/* Mobil — tablo hücrelerinde dikey harf kırılmasını engelle */
@media (max-width: 767.98px) {
    .page-content .table-responsive > table.table:not(.dataTable) > :is(thead, tbody) > tr > :is(th, td):not([colspan]),
    .valent-dashboard .table-responsive > table.table:not(.dataTable) > :is(thead, tbody) > tr > :is(th, td):not([colspan]),
    .valent-page-dashboard .table-responsive > table.table:not(.dataTable) > :is(thead, tbody) > tr > :is(th, td):not([colspan]) {
        white-space: nowrap;
        vertical-align: middle;
    }

    .page-content .table-responsive > table.table:not(.dataTable) .badge,
    .valent-dashboard .table-responsive > table.table:not(.dataTable) .badge,
    .valent-page-dashboard .table-responsive > table.table:not(.dataTable) .badge {
        white-space: nowrap;
    }

    .table-responsive.valent-bill-table-scroll--editable > table.table > :is(thead, tbody) > tr > :is(th, td),
    .valent-page-package-billing .table-responsive.valent-bill-table-scroll--editable > table.table > :is(thead, tbody) > tr > :is(th, td) {
        white-space: normal;
    }
}
