body {
    background-color: #f8f9fa;
}

.table th {
    font-size: 0.85rem;
    white-space: nowrap;
}

.table td {
    font-size: 0.85rem;
    white-space: nowrap;
}

.filter-bar {
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
}

/* ---- Chart container ---- */
.chart-container {
    position: relative;
    height: 400px;
}

/* ---- Scrollable table area ---- */
.dt-scroll {
    max-height: calc(100vh - 260px);
    overflow: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #868e96 #e9ecef;
}

.dt-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.dt-scroll::-webkit-scrollbar-track {
    background: #e9ecef;
}

.dt-scroll::-webkit-scrollbar-thumb {
    background: #868e96;
    border-radius: 5px;
}

.dt-scroll::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

.dt-scroll::-webkit-scrollbar-corner {
    background: #e9ecef;
}

/* DataTables overrides: don't let it constrain table width */
.dt-scroll table.dataTable {
    width: auto !important;
    min-width: 100%;
}

.dt-scroll .dataTables_wrapper {
    overflow: visible;
}

/* ---- Sticky header ---- */
.dt-scroll table.dataTable thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.dt-scroll table.dataTable thead tr:first-child th {
    background: #fff;
}

/* Opaque colored section headers */
.dt-scroll table.dataTable thead tr:first-child th.tf-header {
    background: #cfe2ff;
}

.dt-scroll table.dataTable thead tr:first-child th.l14-header {
    background: #fff3cd;
}

.dt-scroll table.dataTable thead tr:nth-child(2) th {
    background: #fff;
    border-bottom: 2px solid #adb5bd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* ---- Sticky left columns ---- */
.dt-scroll table.dataTable tbody td:nth-child(1),
.dt-scroll table.dataTable thead th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
}

.dt-scroll table.dataTable tbody td:nth-child(2),
.dt-scroll table.dataTable thead th:nth-child(2) {
    position: sticky;
    z-index: 3;
}

/* Corners: highest z-index */
.dt-scroll table.dataTable thead tr th:nth-child(1),
.dt-scroll table.dataTable thead tr th:nth-child(2) {
    z-index: 7;
    background: #fff;
}

/* Solid backgrounds for sticky body cells */
.dt-scroll table.dataTable tbody tr td:nth-child(1),
.dt-scroll table.dataTable tbody tr td:nth-child(2) {
    background: #fff;
}

.dt-scroll table.dataTable.table-striped tbody tr:nth-of-type(even) td:nth-child(1),
.dt-scroll table.dataTable.table-striped tbody tr:nth-of-type(even) td:nth-child(2) {
    background: #f2f2f2;
}

.dt-scroll table.dataTable.table-hover tbody tr:hover td:nth-child(1),
.dt-scroll table.dataTable.table-hover tbody tr:hover td:nth-child(2) {
    background: #e9ecef;
}

/* Shadow on sticky column edge */
.dt-scroll table td:nth-child(2),
.dt-scroll table th:nth-child(2) {
    box-shadow: 3px 0 5px -2px rgba(0, 0, 0, 0.15);
}

/* ---- Column visibility dropdown ---- */
.col-vis-dropdown {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px 0;
    min-width: 180px;
}

.col-vis-dropdown .dropdown-item {
    font-size: 0.82rem;
    padding: 3px 12px;
    cursor: pointer;
}

.col-vis-dropdown .dropdown-item input {
    margin-right: 6px;
    cursor: pointer;
}
