body {
    background-color: #f4f6f8;
}
.login-bg {
    background: linear-gradient(135deg, #e9f7ef 0%, #f4f6f8 100%);
}
.card {
    border-radius: 0.75rem;
}
.navbar-brand i {
    color: #ffd166;
}
.login-icon {
    font-size: 2.5rem;
}

/* =====================================================================
   TABEL — rapi & nyaman disentuh di HP (PWA/Chrome Android) maupun desktop
   ===================================================================== */
.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    color: #4b5563;
    white-space: nowrap;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}
.table td {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    vertical-align: middle;
}
.table td, .table th {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
}

/* Kolom yang isinya angka/tanggal/status jangan sampai patah baris ganjil */
.table td.text-end,
.table th.text-end {
    white-space: nowrap;
}

/* Bungkus scroll horizontal dengan sudut membulat rapi + indikator scroll
   halus (shadow di kanan) supaya user tahu ada konten tersembunyi */
.table-responsive {
    border-radius: 0.75rem;
    background:
        linear-gradient(to right, white 30%, rgba(255,255,255,0)),
        linear-gradient(to right, rgba(255,255,255,0), white 70%) 100% 0,
        radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.12), rgba(0,0,0,0)),
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.12), rgba(0,0,0,0)) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

/* Header tabel tetap terlihat saat scroll ke bawah (tinggi tabel panjang) */
.table-responsive .table thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 2;
}

/* Kolom pertama (biasanya Tanggal) tetap terlihat saat scroll horizontal
   di layar sempit, jadi konteks baris tidak hilang */
@media (max-width: 767.98px) {
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .table-sticky-col td:first-child,
    .table-sticky-col th:first-child {
        position: sticky;
        left: 0;
        z-index: 3;
        background-color: #fff;
        box-shadow: 2px 0 4px -2px rgba(0,0,0,.15);
    }
    .table-sticky-col thead th:first-child {
        z-index: 4;
        background-color: #f8f9fa;
    }
}

/* =====================================================================
   TOMBOL — target sentuh nyaman (min. ~40px) tanpa terasa raksasa
   ===================================================================== */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
}
.btn:not(.btn-sm):not(.btn-lg) {
    min-height: 42px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Tombol ikon-saja di dalam baris tabel (edit/hapus/lampiran): dibikin
   persegi rapi dan cukup besar untuk jempol, bukan gepeng kekecilan */
.table .btn-sm,
.btn-icon {
    min-width: 34px;
    min-height: 34px;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.table td:last-child .btn + .btn,
.table td:last-child form + .btn,
.table td:last-child .btn + form {
    margin-left: 0.35rem;
}

/* Grup tombol aksi di atas tabel (Tambah/Import/Export dsb):
   full-width & sejajar rapi di HP, sejajar horizontal di layar lebar */
.action-toolbar {
    width: 100%;
}
@media (max-width: 575.98px) {
    .action-toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }
    .action-toolbar > .d-flex {
        flex-direction: column;
        width: 100%;
    }
    .action-toolbar .btn {
        width: 100%;
    }
}

/* Form filter: field tanggal & tombol berpasangan 2 kolom di HP,
   bukan numpuk 1 kolom penuh supaya tidak kepanjangan ke bawah */
@media (max-width: 767.98px) {
    form.row.g-2 > [class*="col-md-"] {
        flex: 0 0 auto;
        width: 50%;
    }
    form.row.g-2 > .col-md-3 {
        width: 100%;
    }
}

.form-control, .form-select {
    min-height: 42px;
    border-radius: 0.5rem;
}

/* Pagination: target sentuh lebih besar & rapi di HP */
.pagination .page-link {
    min-width: 40px;
    text-align: center;
    border-radius: 0.5rem !important;
    margin: 0 0.15rem;
    font-weight: 500;
}

/* Badge status jenis dana sedikit lebih tegas & konsisten tinggi */
.table .badge {
    font-size: 0.72rem;
    padding: 0.4em 0.65em;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .table {
        font-size: 0.85rem;
    }
    .card-body {
        padding: 1rem;
    }
}

/* =====================================================================
   HEADER TABEL BISA DIKLIK UNTUK SORTING
   ===================================================================== */
.table th.sortable {
    padding: 0;
}
.table th.sortable .sort-link {
    display: block;
    width: 100%;
    padding: 0.85rem 0.9rem;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}
.table th.sortable .sort-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
    text-decoration: none;
}
.table th.sortable .sort-link i {
    font-size: 0.75rem;
    margin-left: 0.15rem;
    vertical-align: middle;
}
.table th.sort-active .sort-link {
    font-weight: 700;
}
.table th.sortable.text-end .sort-link {
    text-align: right;
}
.table th.sortable.text-center .sort-link {
    text-align: center;
}
