/* ============================================ */
/* COMPONENTS - REUSABLE STYLES                */
/* ============================================ */

/* ===== BODY ===== */
body {
    background: var(--color-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding-bottom: 80px;
}

/* ===== HEADER ===== */
.header-top {
    background: var(--color-primary-gradient);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header-top .back-btn {
    color: white;
    font-size: 20px;
    text-decoration: none;
}
.header-top .title {
    font-weight: 600;
    font-size: 18px;
}
.header-top .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-top .user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.header-top .user-name {
    font-weight: 600;
    font-size: 16px;
}
.header-top .user-nis {
    font-size: 12px;
    opacity: 0.8;
}
.header-top .btn-logout {
    color: white;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-size: 13px;
}
.header-top .btn-logout:hover {
    background: rgba(255,255,255,0.25);
}

/* ===== CARD ===== */
.card-witama {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    border: none;
}
.card-witama .card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
}
.card-witama .card-title i {
    margin-right: 8px;
    color: var(--color-primary);
}

/* ===== STAT GRID ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.stat-item {
    background: #f7fafc;
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
}
.stat-item .stat-icon {
    font-size: 22px;
    margin-bottom: 4px;
}
.stat-item .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}
.stat-item .stat-label {
    font-size: 11px;
    color: var(--color-text-secondary);
}
.stat-item.primary .stat-icon { color: var(--color-primary); }
.stat-item.success .stat-icon { color: var(--color-success); }
.stat-item.warning .stat-icon { color: var(--color-warning); }

/* ===== TABLE SPP ===== */
.table-spp {
    font-size: 13px;
    margin-bottom: 0;
}
.table-spp th {
    background: var(--color-primary-bg);
    font-weight: 600;
    color: var(--color-primary);
    border-color: #c8e6c9;
}
.table-spp td,
.table-spp th {
    padding: 8px 10px;
    vertical-align: middle;
}
.table-spp tfoot td {
    background: var(--color-primary-bg);
    font-weight: 600;
}

/* ===== SALDO BOX ===== */
.saldo-box {
    background: var(--color-primary-gradient);
    border-radius: var(--radius-md);
    padding: 16px;
    color: white;
    text-align: center;
    margin-bottom: 12px;
}
.saldo-box .saldo-label {
    font-size: 12px;
    opacity: 0.8;
}
.saldo-box .saldo-nominal {
    font-size: 28px;
    font-weight: 700;
}

/* ===== JAJAN ITEM ===== */
.jajan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.jajan-item:last-child {
    border-bottom: none;
}
.jajan-item .jajan-masuk {
    color: var(--color-success);
    font-weight: 600;
}
.jajan-item .jajan-keluar {
    color: var(--color-danger);
    font-weight: 600;
}

/* ===== TAGIHAN ITEM ===== */
.tagihan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.tagihan-item:last-child {
    border-bottom: none;
}
.tagihan-item .tagihan-info {
    flex: 1;
}
.tagihan-item .tagihan-nama {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
}
.tagihan-item .tagihan-jenis {
    font-size: 11px;
    color: var(--color-text-secondary);
}
.tagihan-item .tagihan-nominal {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-danger);
}
.tagihan-item .tagihan-status {
    font-size: 12px;
}

/* ===== RIWAYAT ITEM ===== */
.riwayat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.riwayat-item:last-child {
    border-bottom: none;
}
.riwayat-item .riwayat-info {
    flex: 1;
}
.riwayat-item .riwayat-jenis {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
}
.riwayat-item .riwayat-tanggal {
    font-size: 11px;
    color: var(--color-text-secondary);
}
.riwayat-item .riwayat-nominal {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-success);
}

/* ===== FILTER SECTION ===== */
.filter-section {
    background: var(--color-card);
    padding: 12px 16px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}
.filter-section select {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 14px;
    background: #f7fafc;
    width: 100%;
}
.filter-section select:focus {
    border-color: var(--color-primary);
    outline: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 20px 10px;
    color: var(--color-text-secondary);
}
.empty-state i {
    font-size: 32px;
    color: var(--color-border);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 13px;
    margin: 0;
}

/* ===== BADGE ===== */
.badge-primary {
    background: var(--color-primary) !important;
}
.badge-success {
    background: var(--color-success) !important;
}
.badge-danger {
    background: var(--color-danger) !important;
}
.badge-warning {
    background: var(--color-warning) !important;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-card);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    border-top: 1px solid var(--color-border);
    z-index: 200;
}
.bottom-nav .nav-item {
    text-align: center;
    color: #a0aec0;
    font-size: 10px;
    text-decoration: none;
    padding: 4px 12px;
    transition: color 0.3s;
}
.bottom-nav .nav-item i {
    font-size: 20px;
    display: block;
    margin-bottom: 2px;
}
.bottom-nav .nav-item.active {
    color: var(--color-primary);
}
.bottom-nav .nav-item:hover {
    color: var(--color-primary);
}

/* ============================================ */
/* RESPONSIVE                                  */
/* ============================================ */

@media (max-width: 480px) {
    .stat-grid {
        gap: 6px;
    }
    .stat-item {
        padding: 10px 6px;
    }
    .stat-item .stat-value {
        font-size: 15px;
    }
    .table-spp {
        font-size: 12px;
    }
    .table-spp td,
    .table-spp th {
        padding: 6px 6px;
    }
    .saldo-box .saldo-nominal {
        font-size: 22px;
    }
    .header-top .title {
        font-size: 16px;
    }
}

@media (max-width: 380px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .stat-item:last-child {
        grid-column: span 2;
    }
}