/* Compact, clean layout for all DataTables pages */
:root {
    --table-font-size: 0.82rem;
    --table-header-font-size: 0.78rem;
    --table-small-font-size: 0.72rem;
}

html {
    font-size: 15px;
}

body {
    background-color: #f8fafc;
}

main.container,
main.container-fluid {
    max-width: 98%;
}

h1, h2, h3 {
    letter-spacing: -0.02em;
}

/* Page header */
.d-flex.align-items-center.justify-content-between.mb-3 h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

/* DataTables controls */
.dataTables_wrapper {
    font-size: 0.86rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    font-size: 0.82rem;
    padding: 0.25rem 0.45rem;
    height: calc(1.5em + 0.55rem + 2px);
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.8rem;
}

.dataTables_wrapper .paginate_button.page-item .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.table-responsive {
    background: #ffffff;
    border-radius: 0.55rem;
    padding: 0.65rem;
    box-shadow: 0 0.15rem 0.75rem rgba(15, 23, 42, 0.06);
}

/* Main compact table style */
table#tblData,
table.dataTable {
    font-size: var(--table-font-size);
    line-height: 1.25;
    margin-bottom: 0 !important;
}

table#tblData thead th,
table.dataTable thead th {
    font-size: var(--table-header-font-size);
    font-weight: 700;
    text-transform: none;
    vertical-align: middle;
    white-space: nowrap;
    padding: 0.42rem 0.45rem !important;
    background-color: #f1f5f9;
    color: #1e293b;
}

table#tblData tbody td,
table.dataTable tbody td {
    padding: 0.35rem 0.45rem !important;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

/* Allow audit text to be readable but still compact */
table#tblData tbody td small,
table.dataTable tbody td small {
    font-size: var(--table-small-font-size);
    line-height: 1.1;
}

/* Action column */
table#tblData tbody td:last-child,
table.dataTable tbody td:last-child {
    overflow: visible;
    text-overflow: clip;
    max-width: 280px;
    white-space: normal;
}

table#tblData .btn,
table.dataTable .btn {
    font-size: 0.72rem;
    padding: 0.18rem 0.38rem;
    line-height: 1.25;
    border-radius: 0.28rem;
}

table#tblData .btn .bi,
table.dataTable .btn .bi {
    font-size: 0.76rem;
}

table#tblData .btn-group,
table.dataTable .btn-group {
    gap: 0.15rem;
}

table#tblData .btn-group > .btn,
table.dataTable .btn-group > .btn {
    border-radius: 0.28rem !important;
}

/* Badges and status labels */
table#tblData .badge,
table.dataTable .badge {
    font-size: 0.68rem;
    padding: 0.26em 0.45em;
}

/* Reduce overly long form/table text while keeping details available by horizontal scroll */
.table td,
.table th {
    word-break: normal;
}

/* Details/Edit/Delete cards */
.card,
.form-control,
.form-select,
.btn {
    font-size: 0.9rem;
}

.form-label {
    font-size: 0.86rem;
    font-weight: 600;
}

/* Mobile: keep the layout readable */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .table-responsive {
        padding: 0.4rem;
    }

    table#tblData tbody td,
    table.dataTable tbody td {
        max-width: 150px;
    }
}
