/* ========== STYLE DASAR ========== */
body {
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    background: #f6f8fa;
    color: #222;
}

header {
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    color: white;
    padding: 15px;
    font-size: 1.3em;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* ========== FILTER ========== */
/* === Filter Inline Mobile First === */
.filter-inline-mobile {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    overflow-x: auto; /* jika layar kecil, bisa digeser horizontal */
    padding: 5px 0;
}

.filter-inline-mobile select,
.filter-inline-mobile .btn-primary {
    flex: 1;
    font-size: 14px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    min-width: 0; /* biar tidak meluber */
}

.filter-inline-mobile .btn-primary {
    background-color: #007bff;
    color: #fff;
    border: none;
    white-space: nowrap;
}

.filter-inline-mobile .btn-primary:active {
    background-color: #0056b3;
}


/* ========== LEGEND ========== */
.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9em;
    margin-top: 10px;
}
.legend .item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.icon {
    width: 20px;
    height: 20px;
}
.icon svg {
    width: 100%;
    height: 100%;
}

/* ========== TABEL ========== */
.table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 600px;
    border-radius: 8px;
}

thead th {
    background: #f1f5f9;
    font-size: 0.9em;
    padding: 10px 5px;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

tbody td {
    border: 1px solid #e2e8f0;
    text-align: center;
    padding: 8px;
    font-size: 0.9em;
}

td.nama {
    white-space: normal;
    word-wrap: break-word;
    max-width: 150px;
    text-align: left;
    font-weight: 600;
}

/* Ikon status */
.icon-cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Warna ikon */
.icon.bayar svg { stroke: #0b7a2b; }
.icon.belum svg { stroke: #b90b0b; }

/* ========== ALERT ========== */
.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95em;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    header { font-size: 1.1em; }

    .filter-row { flex-direction: column; align-items: stretch; }

    .filter-item select, .btn-primary, .btn-secondary {
        width: 100%;
    }

    table {
        font-size: 0.8em;
        min-width: unset;
    }

    td.nama { max-width: 120px; }
}

/* Badge jumlah tunggakan */
.badge-tunggakan {
    display: inline-block;
    background: #f87171;
    color: white;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
    font-weight: 600;
    white-space: nowrap;
}



.btn_green{
    padding: 10px 18px;
    font-size: 14px;
    background: #317441;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.25s ease;
    flex-shrink: 0;
}

.btn_green:hover {
    background: #1f4e2b;
}



.btn_orange {
    display: inline-flex;          /* aktifkan flex layout */
    align-items: center;           /* vertikal tengah */
    justify-content: center;       /* horizontal tengah */

    padding: 10px 18px;
    font-size: 14px;
    background: #8d6731;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.25s ease;
    flex-shrink: 0;
    text-align: center;            /* jaga teks tetap center untuk jaga-jaga */
}

.btn_orange:hover {
    background: #634823;
}


/* POPUP UPDATE IURAN */
/* === POPUP OVERLAY === */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

/* === POPUP BOX === */
.popup-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 20px 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: popupFade 0.25s ease-in-out;
}

@keyframes popupFade {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.popup-content h3 {
    margin-bottom: 8px;
    font-size: 18px;
    color: #333;
}

.popup-content p {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
}

/* === BUTTON STYLE === */
.popup-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.btn-popup {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Tombol warna */
.btn-success {
    background: #0b7a2b;
    color: #fff;
}
.btn-success:hover {
    background: #0d9737;
}

.btn-danger {
    background: #b90b0b;
    color: #fff;
}
.btn-danger:hover {
    background: #d01616;
}

.btn-cancel {
    background: #ccc;
    color: #333;
    width: 100%;
}
.btn-cancel:hover {
    background: #bbb;
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 480px) {
    .popup-content {
        width: 92%;
        padding: 18px 14px;
    }

    .popup-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .btn-popup {
        width: 100%;
        font-size: 14px;
        padding: 12px;
    }
}

/* ================= Menu Bar ================= */
/* Menu container */
.menu-top {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 8px; /* beri sedikit padding kiri & kanan supaya tombol paling kiri/kanan tidak kepotong */
    margin: 0;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    width: 100vw;      /* pastikan full width */
    box-sizing: border-box;
}

/* Tombol menu */
.menu-top a {
    flex: 0 0 auto;
    text-decoration: none;
    color: #282828;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
    transition: all 0.25s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Hover effect */
.menu-top a:hover {
    background-color: #2a9d8f;
    color: #fff;
}

/* Tombol yang aktif */
.menu-top a.active {
    background-color: #2a9d8f;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.25);
}

/* Hilangkan scrollbar default */
.menu-top::-webkit-scrollbar { display: none; }
.menu-top { -ms-overflow-style: none; scrollbar-width: none; }



/* ================= Filter Form ================= */
.filter-form {
    display: flex;
    flex-wrap: wrap; /* responsive */
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-form select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    transition: border-color 0.2s;
}

.filter-form select:focus {
    outline: none;
    border-color: #2a9d8f;
    box-shadow: 0 0 5px rgba(42, 157, 143, 0.3);
}

.filter-form button {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background-color: #2a9d8f;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.25s;
}

.filter-form button:hover {
    background-color: #21867a;
}

/* ================= Responsif Mobile ================= */
@media screen and (max-width: 768px) {

    .menu-top a {
        flex: 1 1 45%; /* dua tombol per baris */
        text-align: center;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-form select,
    .filter-form button {
        width: 100%;
    }
}


/* FOOTER */
.app-footer {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    box-shadow: 0 -2px 6px rgba(0,0,0,0.08);
    border-top: 1px solid #ddd;
    text-align: center;
    padding: 20px 10px;
    margin-top: 40px;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
}

.footer-title {
    font-weight: 600;
    font-size: 14px;
    color: #444;
    margin-bottom: 6px;
}

.footer-desc {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.footer-link {
    color: #0077cc;
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-powered {
    font-size: 12px;
    color: #777;
}

.footer-powered span {
    font-weight: 600;
    color: #0069d9;
}

/* Responsive HP */
@media screen and (max-width:480px){
    .app-footer {
        padding: 15px 8px;
        font-size: 12px;
    }
    .footer-title {
        font-size: 13px;
    }
    .footer-desc {
        font-size: 12px;
    }
}
