* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f6f9;
}

/* SIDEBAR */
.sidebar {
    width: 220px;
    height: 100vh;
    background: #2d89ef;
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px;
    color: white;
}

.sidebar a {
    display: block;
    color: white;
    padding: 10px 0;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar a:hover {
    background: rgba(255,255,255,0.1);
}

/* MAIN CONTENT */
.main {
    margin-left: 240px;
    padding: 20px;
    min-height: 100vh;
}

/* CARD */
.card {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* STAT BOX */
.stat-box {
    display: inline-block;
    width: 30%;
    background: white;
    padding: 15px;
    margin-right: 10px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: #2d89ef;
    color: white;
    padding: 10px;
}

td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

/* BUTTON */
button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background: #1f7a33;
}

/* STATUS */
.success {
    color: green;
}

.error {
    color: red;
}

/* =========================
   MOBILE RESPONSIVE FIX
========================= */
@media screen and (max-width: 768px) {

    body {
        overflow-x: hidden !important;
    }

    /* SIDEBAR */
    .sidebar {
        width: 100% !important;
        height: auto !important;
        position: relative !important;
        padding: 15px !important;
        text-align: center !important;
    }

    .sidebar img {
        width: 70px !important;
        height: 93x !important;
    }

    .sidebar h3 {
        margin-top: 10px !important;
    }

    .sidebar a {
        display: block !important;
        padding: 12px !important;
        margin: 5px 0 !important;
        border-radius: 8px !important;
        background: rgba(255,255,255,0.1) !important;
    }

    /* MAIN */
    .main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 10px !important;
    }

    /* CARD */
    .card {
        width: 100% !important;
        padding: 15px !important;
        margin-bottom: 15px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }

    /* STAT */
    .stat-box {
        width: 100% !important;
        display: block !important;
        margin-bottom: 10px !important;
    }

    /* TABLE */
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }

    th,
    td {
        font-size: 14px !important;
        padding: 8px !important;
    }

    /* FONT */
    h2 {
        font-size: 26px !important;
    }

    h3 {
        font-size: 20px !important;
    }

}

/* PAGINATION */
.page-btn {
    display: inline-block;
    padding: 8px 12px;
    margin: 3px;
    background: #2d89ef;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    min-width: 35px;
    text-align: center;
}

.page-btn:hover {
    background: #1b5fa7;
}

.page-btn.green {
    background: #28a745;
}

.page-btn.green:hover {
    background: #1e7a33;
}

/* =========================================
   REKAP ABSENSI BULANAN
========================================= */

.table-wrapper {
    overflow-x: auto;
}

.nama-col {
    position: sticky;
    left: 0;
    background: white;
    z-index: 2;
    min-width: 220px;
    text-align: left !important;
}

.status-box {

    width: 20px;
    height: 20px;

    border-radius: 4px;

    display: inline-block;
}

/* STATUS WARNA */

.hadir {
    background: #28a745;
}

.telat {
    background: #ffc107;
}

.izin {
    background: #17a2b8;
}

.sakit {
    background: #dc3545;
}

.alfa {
    background: #dee2e6;
}

/* LEGENDA */

.legend {

    display: flex;

    gap: 15px;

    flex-wrap: wrap;

    margin-top: 15px;
}

.legend-item {

    display: flex;

    align-items: center;

    gap: 5px;

    font-size: 14px;
}

/* FILTER */

.filter-box {

    display: flex;

    gap: 10px;

    flex-wrap: wrap;

    align-items: end;
}

.filter-box select,
.filter-box input {

    padding: 10px;

    border: 1px solid #ccc;

    border-radius: 8px;
}

/* TOTAL */

.total-box {

    font-weight: bold;

    color: #2d89ef;
}

/* TABLE */

table th,
table td {

    text-align: center;

    vertical-align: middle;
}

/* MOBILE */

@media screen and (max-width:768px) {

    .status-box {

        width: 16px;
        height: 16px;
    }

    table {

        font-size: 12px;
    }

    .nama-col {

        min-width: 160px;
    }

}

.tanggal-merah {

    background:#ffebee !important;

    color:#d32f2f !important;

    font-weight:bold;
}

.pagination {

    margin-top:20px;

    text-align:center;
}

.pagination a {

    display:inline-block;

    padding:8px 12px;

    margin:3px;

    background:#2d89ef;

    color:white;

    text-decoration:none;

    border-radius:5px;
}

.pagination a.active {

    background:#1b5fa7;
}

.btn-print,
.btn-pdf {

    display:inline-block;

    padding:10px 15px;

    border-radius:8px;

    text-decoration:none;

    color:white;

    font-size:14px;
}

.btn-print {

    background:#28a745;
}

.btn-pdf {

    background:#dc3545;
}


/* PRINT */

@media print {

    .sidebar,
    .filter-box,
    .legend,
    .pagination,
    .btn-print,
    .btn-pdf,
    .btn-back {

        display:none !important;
    }

    body {

        background:white;
    }

    .main {

        margin:0;
        padding:0;
    }

    table {

        font-size:10px;
    }

}

@media print {

    @page {

        size: landscape;

        margin: 10mm;
    }

    body {

        zoom: 70%;
    }

    .sidebar,
    .filter-box,
    .legend,
    .pagination,
    .btn-print,
    .btn-pdf,
    .btn-back {

        display:none !important;
    }

    .main {

        margin:0;
        padding:0;
        width:100%;
    }

    .card {

        box-shadow:none;
        border:none;
    }

    table {

        width:100%;

        min-width:unset;

        border-collapse:collapse;

        font-size:10px;
    }

    th,
    td {

        padding:4px;
    }

    .nama-col {

        min-width:140px;
    }

    .status-box {

        width:14px;
        height:14px;
    }

}

/* =========================================
   SLIP GAJI
========================================= */


table{

    width:100%;

    border-collapse:collapse;

    margin-bottom:15px;
}

th,
td{

    padding:6px;

    border-bottom:1px solid #ddd;
    
    text-align:left;
}

.label{

    width:35%;
    font-weight:bold;
    text-align:left;
}

.nilai{

    width:20px;
    text-align:right;
}