/*
 * Tabel modern -- satu berkas untuk SEMUA tabel (Bootstrap .table dan DataTables).
 * Muat sesudah bootstrap/adminlte/dataTables (paling akhir di <head>), bersama
 * pill-buttons.css. Ubah tampilan seluruh aplikasi lewat variabel di :root.
 *
 * Prinsip: tanpa garis vertikal (table-bordered tak lagi "kotak-kotak"),
 * header ringan huruf kecil kapital, zebra dihapus diganti hover halus,
 * sel lebih lega, sudut membulat, kontrol DataTables ikut gaya pill.
 * Hanya CSS: perilaku DataTables (sort, cari, paginasi, responsive) tak berubah.
 */
:root {
    --tbl-text: #1e293b;
    --tbl-muted: #64748b;
    --tbl-border: #e6ebf3;
    --tbl-head-bg: #f5f7fb;
    --tbl-head-fg: #52627e;
    --tbl-hover: #eef5fb;
    --tbl-accent: #17a2b8;
    --tbl-radius: 14px;
}

/* ---------- tabel dasar ---------- */
.table,
table.dataTable {
    color: var(--tbl-text);
    border-collapse: separate !important;
    border-spacing: 0;
    border: 1px solid var(--tbl-border) !important;
    border-radius: var(--tbl-radius);
}

.table th,
.table td,
table.dataTable th,
table.dataTable td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border: 0 !important;
    border-bottom: 1px solid var(--tbl-border) !important;
}

.table-sm th,
.table-sm td {
    padding: 0.5rem 0.75rem;
}

.table tbody tr:last-child > td,
table.dataTable tbody tr:last-child > td {
    border-bottom: 0 !important;
}

/* header */
.table thead th,
table.dataTable thead th,
table.dataTable thead td {
    background: var(--tbl-head-bg);
    color: var(--tbl-head-fg);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--tbl-border) !important;
}

.table thead tr:first-child th:first-child,
table.dataTable thead tr:first-child th:first-child { border-top-left-radius: calc(var(--tbl-radius) - 1px); }
.table thead tr:first-child th:last-child,
table.dataTable thead tr:first-child th:last-child { border-top-right-radius: calc(var(--tbl-radius) - 1px); }
.table tbody tr:last-child td:first-child,
table.dataTable tbody tr:last-child td:first-child { border-bottom-left-radius: calc(var(--tbl-radius) - 1px); }
.table tbody tr:last-child td:last-child,
table.dataTable tbody tr:last-child td:last-child { border-bottom-right-radius: calc(var(--tbl-radius) - 1px); }

/* zebra -> polos; hover halus */
.table-striped tbody tr:nth-of-type(odd),
table.dataTable.stripe tbody tr.odd { background-color: transparent; }
.table-hover tbody tr:hover,
table.dataTable.table-hover tbody tr:hover,
table.dataTable tbody tr:hover { background-color: var(--tbl-hover); }

/* ---------- kontrol DataTables ---------- */
div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
    border: 1px solid var(--tbl-border);
    border-radius: 50rem;
    padding: 0.3rem 0.9rem;
    background-color: #fff;
}
div.dataTables_wrapper div.dataTables_filter input:focus,
div.dataTables_wrapper div.dataTables_length select:focus {
    outline: 0;
    border-color: var(--tbl-accent);
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.18);
}
div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_length,
div.dataTables_wrapper div.dataTables_filter { color: var(--tbl-muted); font-size: 0.875rem; }

/* paginasi pill */
div.dataTables_wrapper .pagination { gap: 0.25rem; }
div.dataTables_wrapper .page-item .page-link {
    border: 0;
    border-radius: 50rem !important;
    min-width: 2.1rem;
    text-align: center;
    color: var(--tbl-head-fg);
    background: transparent;
}
div.dataTables_wrapper .page-item .page-link:hover { background: var(--tbl-hover); }
div.dataTables_wrapper .page-item.active .page-link { background: var(--tbl-accent); color: #fff; }
div.dataTables_wrapper .page-item.disabled .page-link { color: #b6c0d1; background: transparent; }

/* ruang antara kontrol dan tabel */
div.dataTables_wrapper > .row:first-child { margin-bottom: 0.75rem; }
div.dataTables_wrapper > .row:last-child { margin-top: 0.75rem; }

/* tabel responsif: scroll horizontal tanpa memotong sudut */
.table-responsive { border-radius: var(--tbl-radius); }

/* ---------- badge status: pill, serasi dengan tombol pill ---------- */
.badge {
    border-radius: 50rem;
    padding: 0.35em 0.75em;
    font-weight: 600;
    letter-spacing: 0.01em;
}
