:root {
    --fs-stat-title: clamp(0.95rem, 0.6rem + 1.2vw, 1.45rem);
    --fs-stat-sub: clamp(0.72rem, 0.55rem + 0.6vw, 0.85rem);
    --fs-stat-header: clamp(0.85rem, 0.65rem + 0.75vw, 1.05rem);
    --fs-stat-table: clamp(0.72rem, 0.58rem + 0.55vw, 0.85rem);
    --fs-stat-badge: clamp(0.68rem, 0.55rem + 0.45vw, 0.78rem);
}

.header-statistik-title {
    font-size: var(--fs-stat-title);
    line-height: 1.25;
}

.header-statistik-sub {
    font-size: var(--fs-stat-sub);
    line-height: 1.45;
}

.filter-tahun-label {
    font-size: var(--fs-stat-sub);
}

.filter-tahun-select {
    font-size: var(--fs-stat-sub);
    padding: 0.28rem 0.65rem;
    min-width: 90px;
}

.btn-cetak-responsive {
    font-size: var(--fs-stat-sub);
    padding: 0.28rem 0.75rem;
}

.card-header-title {
    font-size: var(--fs-stat-header);
    line-height: 1.3;
}

.card-header-sub {
    font-size: var(--fs-stat-badge);
    line-height: 1.3;
    display: block;
    margin-top: 2px;
}

/* ── Styling Tabel & Border ───────────────────────────── */
.tabel-statistik {
    font-size: var(--fs-stat-table);
    border-collapse: collapse;
    width: 100%;
}

.tabel-statistik th, 
.tabel-statistik td {
    border: 1px #000000 solid !important;
    padding: clamp(0.35rem, 0.7vw, 0.55rem) clamp(0.45rem, 0.8vw, 0.75rem);
    vertical-align: middle;
}

.tabel-statistik th {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.label-tahun-sub {
    color: #000000;
    font-size: var(--fs-stat-badge);
}

.cell-no {
    font-size: var(--fs-stat-table);
}

.cell-qanun {
    font-size: var(--fs-stat-table);
    white-space: normal;
    word-break: break-word;
}

.cell-kasus {
    font-size: var(--fs-stat-table);
    white-space: normal;
}

.cell-lk, .cell-pr, .cell-total {
    font-size: var(--fs-stat-table);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cell-keterangan {
    font-size: calc(var(--fs-stat-table) * 0.95);
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.cell-footer-total {
    font-size: var(--fs-stat-table);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ── Pengaturan Responsif Tablet & Mobile ────── */
.table-responsive {
    border: 0;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    overflow-x: auto !important;
}

.card-statistik {
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .tabel-statistik {
        min-width: 480px;
    }
    #tabel-cambuk {
        min-width: 580px;
    }
}

@media (max-width: 767.98px) {
    .header-statistik-sub {
        margin-bottom: 0.5rem !important;
    }

    .filter-statistik-container {
        margin-top: 1rem !important;
        padding-top: 0.5rem !important;
        border-top: 1px dashed #e2e8f0;
    }

    .main-statistik-wrapper {
        padding-top: 0.75rem !important;
        padding-bottom: 1.5rem !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .card-body {
        padding: 0.75rem 0.65rem !important;
    }

    .tabel-statistik {
        min-width: 440px;
    }

    #tabel-cambuk {
        min-width: 540px;
    }

    .tabel-statistik th, 
    .tabel-statistik td {
        padding: 0.35rem 0.45rem !important;
    }
}

@media (max-width: 575.98px) {
    .main-statistik-wrapper {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    .card-statistik {
        border-radius: 0.5rem !important;
    }

    .filter-tahun-select {
        min-width: 75px;
    }
}

/* ── Mode Cetak (Print) Bersih ────────────────────────── */
@media print {
    body {
        background: #ffffff;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    header, nav, #sidebar, .d-print-none, footer, .form-select, .form-label {
        display: none !important;
    }
    main {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .tabel-statistik th {
        color: #000000 !important;
        background-color: #e2e8f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

