@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

body {
   font-family: 'Poppins', sans-serif;
   background-color: #f5f5f5;
   color: #003D22;
   min-height: 100vh;
   display: flex;
   flex-direction: column;
}

.main-content {
   flex: 1;
   padding-bottom: 50px;
}

.container {
   max-width: 800px;
   padding: 20px;
   width: 100%;
   margin: 0 auto;
}

h1 {
   text-align: center;
   color: #003D22;
   margin-bottom: 30px;
   font-weight: 600;
}

/* Kode Pelanggan Form */
.kodepelanggan-form {
   background: transparent;
   padding: 30px;
   border-radius: 8px;
   text-align: center;
   margin-bottom: 40px;
}

.kodepelanggan-form h2 {
   margin-bottom: 20px;
   color: #003D22;
   font-weight: 500;
}

.kodepelanggan-form input {
   width: 100%;
   max-width: 300px;
   padding: 12px 15px;
   border: 2px solid #003D22;
   border-radius: 5px;
   font-size: 16px;
   margin: 10px 0 20px 0;
   font-family: 'Poppins', sans-serif;
   display: block;
   margin-left: auto;
   margin-right: auto;
   color: #003D22;
}

.kodepelanggan-form input:focus {
   outline: none;
   border-color: #003D22;
}

.kodepelanggan-form button {
   background: #DAEFE6;
   color: #003D22;
   padding: 12px 30px;
   border: 2px solid #003D22;
   border-radius: 5px;
   font-size: 16px;
   cursor: pointer;
   font-family: 'Poppins', sans-serif;
   font-weight: 500;
   transition: all 0.3s;
   display: block;
   margin: 0 auto;
   width: 100%;
   max-width: 300px;
}

.kodepelanggan-form button:hover {
   background: #003D22;
   color: #DAEFE6;
}

#message {
   margin-top: 15px;
   padding: 10px;
   border-radius: 5px;
}

.error {
   background: #ffebee;
   color: #c62828;
   border: 1px solid #ffcdd2;
}

.success {
   background: #e8f5e8;
   color: #2e7d32;
   border: 1px solid #c8e6c9;
}

.loading {
   background: #e3f2fd;
   color: #1976d2;
   border: 1px solid #bbdefb;
}

/* Dashboard */
.dashboard {
   background: white;
   border-radius: 8px;
   border: 2px solid #003D22;
   overflow: hidden;
   margin-top: 20px;
   margin-bottom: 40px;
}

.welcome {
   background: #003D22;
   color: white;
   padding: 20px;
   display: block;
}

.welcome-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 15px;
}

.welcome h3 {
   font-weight: 500;
   color: white;
   margin: 0;
}

.logout-btn {
   background: #DAEFE6;
   color: #003D22;
   border: 2px solid #DAEFE6;
   padding: 8px 15px;
   border-radius: 4px;
   cursor: pointer;
   font-family: 'Poppins', sans-serif;
   font-size: 14px;
   transition: all 0.3s;
   width: fit-content;
}

.logout-btn:hover {
   background: transparent;
   color: #DAEFE6;
   border-color: #DAEFE6;
}

/* Tabs */
.tabs {
   display: flex;
   background: #DAEFE6;
}

.tab-btn {
   flex: 1;
   background: none;
   border: none;
   padding: 15px;
   font-family: 'Poppins', sans-serif;
   font-size: 16px;
   cursor: pointer;
   transition: background 0.3s;
   color: #003D22;
}

.tab-btn.active {
   background: white;
   color: #003D22;
   font-weight: 500;
}

.tab-btn:hover {
   background: rgba(0, 61, 34, 0.1);
}

.tab-btn.active:hover {
   background: white;
}

/* Tab Content */
.tab-content {
   padding: 30px;
   min-height: 400px;
}

.tab-content h4 {
   margin-bottom: 20px;
   color: #003D22;
   font-weight: 500;
}

/* Form Bayar */
.form-bayar {
   max-width: 500px;
   margin: 0 auto;
   display: flex;
   flex-direction: column;
   align-items: center;
}

.form-group {
   margin-bottom: 20px;
   width: 100%;
   max-width: 400px;
}

.form-group label {
   display: block;
   margin-bottom: 5px;
   font-weight: 500;
   color: #003D22;
}

.form-group select,
.form-group input {
   width: 100%;
   padding: 12px 15px;
   border: 2px solid #ddd;
   border-radius: 5px;
   font-size: 16px;
   font-family: 'Poppins', sans-serif;
}

.form-group select:focus,
.form-group input:focus {
   outline: none;
   border-color: #003D22;
}

.form-group small {
   color: #7f8c8d;
   font-size: 14px;
   margin-top: 5px;
   display: block;
}

.submit-btn {
   background: #DAEFE6;
   color: #003D22;
   padding: 15px 30px;
   border: 2px solid #003D22;
   border-radius: 5px;
   font-size: 16px;
   cursor: pointer;
   font-family: 'Poppins', sans-serif;
   font-weight: 500;
   transition: all 0.3s;
   width: 100%;
   max-width: 400px;
   margin-top: 10px;
}

.submit-btn:hover {
   background: #003D22;
   color: #DAEFE6;
}

/* Payment Info Section */
.info-rekening-section {
   margin-bottom: 25px;
}

.payment-info {
   background: #f0f8f5;
   border: 1px solid #003D22;
   border-radius: 5px;
   padding: 15px;
   margin-bottom: 20px;
}

.payment-header {
   color: #003D22;
   margin-bottom: 15px;
   font-weight: 500;
   font-size: 16px;
}

.bank-info {
   background: white;
   border: 1px solid #DAEFE6;
   border-radius: 4px;
   padding: 12px;
   margin-bottom: 10px;
}

.bank-info:last-child {
   margin-bottom: 0;
}

.bank-info p {
   margin: 2px 0;
   font-size: 14px;
   color: #003D22;
}

.bank-info p strong {
   color: #003D22;
   font-weight: 600;
}

.payment-image {
   margin-top: 10px;
   text-align: center;
}

.payment-img {
   max-width: 250px;
   max-height: 250px;
   border-radius: 8px;
   border: 2px solid #DAEFE6;
   cursor: pointer;
   transition: transform 0.2s, box-shadow 0.2s;
}

.payment-img:hover {
   transform: scale(1.02);
   box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Tagihan Section */
.tagihan-section {
   margin-bottom: 30px;
}

.tagihan-header {
   color: #003D22;
   margin-bottom: 20px;
   font-weight: 500;
}

.tagihan-item {
   background: #fff9e6;
   border: 1px solid #003D22;
   border-radius: 5px;
   padding: 15px;
   margin-bottom: 10px;
}

.tagihan-item h5 {
   color: #003D22;
   margin-bottom: 8px;
   font-weight: 500;
}

.tagihan-item p {
   color: #2d5a3d;
   margin: 3px 0;
   font-size: 14px;
}

/* Riwayat Section */
.riwayat-section {
   max-height: 400px;
   overflow-y: auto;
}

.riwayat-item {
   background: #f8f9fa;
   border: 1px solid #dee2e6;
   border-radius: 5px;
   padding: 15px;
   margin-bottom: 10px;
}

.riwayat-item h5 {
   color: #495057;
   margin-bottom: 8px;
   font-weight: 500;
}

.riwayat-item p {
   margin: 3px 0;
   font-size: 14px;
   color: #6c757d;
}

.status-lunas {
   color: #28a745;
   font-weight: 500;
}

.status-pending {
   color: #ffc107;
   font-weight: 500;
}

.status-belum {
   color: #dc3545;
   font-weight: 500;
}

/* Payment Proof Display */
.bukti-pembayaran {
   margin-top: 10px;
   padding: 10px;
   background: #f8f9fa;
   border-radius: 5px;
   border: 1px solid #e9ecef;
}

.bukti-pembayaran p {
   margin-bottom: 8px;
   color: #495057;
   font-weight: 500;
}

.bukti-thumbnail {
   max-width: 150px;
   max-height: 150px;
   border-radius: 5px;
   cursor: pointer;
   transition: transform 0.2s, box-shadow 0.2s;
   border: 2px solid #dee2e6;
}

.bukti-thumbnail:hover {
   transform: scale(1.05);
   box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Image Modal */
.image-modal {
   display: none;
   position: fixed;
   z-index: 1000;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0,0,0,0.8);
   animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
   position: relative;
   margin: auto;
   padding: 20px;
   width: 90%;
   max-width: 800px;
   height: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
}

.modal-content img {
   max-width: 100%;
   max-height: 90%;
   border-radius: 8px;
   box-shadow: 0 4px 20px rgba(0,0,0,0.3);
   animation: slideIn 0.3s ease-in-out;
}

.close-modal {
   position: absolute;
   top: 15px;
   right: 25px;
   color: white;
   font-size: 35px;
   font-weight: bold;
   cursor: pointer;
   z-index: 1001;
   transition: color 0.2s;
}

.close-modal:hover {
   color: #ccc;
}

@keyframes fadeIn {
   from { opacity: 0; }
   to { opacity: 1; }
}

@keyframes slideIn {
   from { 
       opacity: 0;
       transform: scale(0.8);
   }
   to { 
       opacity: 1;
       transform: scale(1);
   }
}

/* Pengumuman Section */
.pengumuman-container {
   background: #e8f5e8;
   border: 1px solid #003D22;
   border-radius: 8px;
   padding: 15px;
   margin: 15px 0;
}

.pengumuman-title {
   color: #003D22;
   margin-bottom: 15px;
   font-size: 18px;
   font-weight: 600;
}

.pengumuman-item {
   background: white;
   border-radius: 6px;
   padding: 12px;
   margin-bottom: 10px;
   border-left: 4px solid #003D22;
}

.pengumuman-item:last-child {
   margin-bottom: 0;
}

.pengumuman-item h5 {
   color: #003D22;
   margin-bottom: 5px;
   font-size: 16px;
   font-weight: 500;
}

.pengumuman-date {
   color: #666;
   font-size: 12px;
   margin-bottom: 8px;
   font-style: italic;
}

.pengumuman-content {
   color: #2d5a3d;
   font-size: 14px;
   line-height: 1.4;
   margin: 0;
}

/* Total Iuran Section */
.total-iuran-container {
   background: #f0f8f5;
   border: 1px solid #003D22;
   border-radius: 8px;
   padding: 15px;
   margin: 15px 0;
}

.total-iuran-title {
   color: #003D22;
   margin-bottom: 15px;
   font-size: 18px;
   font-weight: 600;
}

/* Pengeluaran Section */
.pengeluaran-section {
   max-height: 500px;
   overflow-y: auto;
}

.pengeluaran-item {
   background: #fff9f0;
   border: 1px solid #e67e22;
   border-radius: 5px;
   padding: 15px;
   margin-bottom: 10px;
   border-left: 4px solid #e67e22;
}

.pengeluaran-item h5 {
   color: #d35400;
   margin-bottom: 8px;
   font-weight: 500;
   font-size: 16px;
}

.pengeluaran-item p {
   margin: 3px 0;
   font-size: 14px;
   color: #8e5c2a;
}

.pengeluaran-date {
   color: #666;
   font-size: 13px;
   font-weight: 500;
}

.pengeluaran-amount {
   color: #c0392b;
   font-weight: 600;
   font-size: 15px;
}

.pengeluaran-category {
   background: #fdf2e9;
   color: #d35400;
   padding: 3px 8px;
   border-radius: 12px;
   font-size: 12px;
   font-weight: 500;
   display: inline-block;
   margin-top: 5px;
}

/* Total Pemasukan Section */
.total-pemasukan-container {
   background: white;
   border: 1px solid #ddd;
   padding: 15px;
   margin: 15px 0;
}

.total-pemasukan-title {
   color: #333;
   margin-bottom: 15px;
   font-size: 16px;
   font-weight: 500;
}

.pemasukan-total-item {
   display: flex;
   justify-content: space-between;
   padding: 8px 0;
   border-bottom: 1px solid #f0f0f0;
}

.pemasukan-total-item:last-child {
   border-bottom: none;
}

.pemasukan-name {
   color: #333;
   font-weight: normal;
   font-size: 14px;
}

.pemasukan-total-amount {
   color: #333;
   font-weight: 500;
   font-size: 14px;
}

.pemasukan-grand-total {
   display: flex;
   justify-content: space-between;
   padding: 10px 0;
   border-top: 2px solid #ddd;
   margin-top: 10px;
}

.pemasukan-grand-total-label {
   font-weight: 600;
   font-size: 14px;
}

.pemasukan-grand-total-amount {
   font-weight: 600;
   font-size: 14px;
}

/* Total Pengeluaran Section */
.total-pengeluaran-container {
   background: white;
   border: 1px solid #ddd;
   padding: 15px;
   margin: 15px 0;
}

.total-pengeluaran-title {
   color: #333;
   margin-bottom: 15px;
   font-size: 16px;
   font-weight: 500;
}

/* Net Balance Section */
.net-balance-container {
   background: white;
   border: 1px solid #ddd;
   padding: 15px;
   margin: 15px 0;
}

.net-balance-title {
   color: #333;
   margin-bottom: 15px;
   font-size: 16px;
   font-weight: 500;
}

.balance-amount {
   font-size: 18px;
   font-weight: 600;
   margin-bottom: 15px;
}

.balance-positive {
   color: #28a745;
}

.balance-negative {
   color: #dc3545;
}

.balance-breakdown {
   display: flex;
   justify-content: space-between;
   font-size: 14px;
}

.balance-item {
   display: flex;
   flex-direction: column;
}

.balance-label {
   color: #666;
   margin-bottom: 5px;
   font-size: 13px;
}

.balance-value {
   font-weight: 500;
}

.pengeluaran-total-item {
   display: flex;
   justify-content: space-between;
   padding: 8px 0;
   border-bottom: 1px solid #f0f0f0;
}

.pengeluaran-total-item:last-child {
   border-bottom: none;
}

.kategori-name {
   color: #333;
   font-weight: normal;
   font-size: 14px;
}

.pengeluaran-total-amount {
   color: #333;
   font-weight: 500;
   font-size: 14px;
}

.pengeluaran-grand-total {
   display: flex;
   justify-content: space-between;
   padding: 10px 0;
   border-top: 2px solid #ddd;
   margin-top: 10px;
}

.pengeluaran-grand-total-label {
   font-weight: 600;
   font-size: 14px;
}

.pengeluaran-grand-total-amount {
   font-weight: 600;
   font-size: 14px;
}

.total-items-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 12px;
   margin-bottom: 15px;
}

.total-item {
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 15px 12px;
   background: white;
   border-radius: 8px;
   border-left: 4px solid #DAEFE6;
   text-align: center;
   box-shadow: 0 2px 4px rgba(0,0,0,0.1);
   transition: transform 0.2s ease;
}

.total-item:hover {
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.jenis-name {
   color: #003D22;
   font-weight: 500;
   font-size: 14px;
   margin-bottom: 8px;
}

.total-amount {
   color: #2d5a3d;
   font-weight: 700;
   font-size: 16px;
}

.grand-total {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 12px;
   background: #003D22;
   color: white;
   border-radius: 6px;
   margin-top: 8px;
}

.grand-total-label {
   font-weight: 600;
   font-size: 16px;
}

.grand-total-amount {
   font-weight: 700;
   font-size: 18px;
   color: #DAEFE6;
}


/* Footer Spacing */
.footer-spacing {
   height: 60px;
}

/* Responsive */
@media (max-width: 768px) {
   .container {
       padding: 15px;
   }
   
   .main-content {
       padding-bottom: 30px;
   }
  
   .welcome {
       flex-direction: column;
       gap: 10px;
       text-align: center;
   }
  
   .tab-content {
       padding: 20px;
   }
  
   .kodepelanggan-form {
       padding: 20px;
   }
   
   .pengumuman-item h5 {
       font-size: 15px;
   }
   
   .total-items-grid {
       grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
       gap: 8px;
   }
   
   .pengeluaran-total-items-grid {
       grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
       gap: 8px;
   }

   .pemasukan-total-items-grid {
       grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
       gap: 8px;
   }
   
   .total-item {
       padding: 12px 8px;
   }
   
   .pengeluaran-total-item,
   .pemasukan-total-item {
       padding: 12px 8px;
   }
   
   .jenis-name,
   .kategori-name,
   .pemasukan-name {
       font-size: 13px;
   }
   
   .total-amount,
   .pengeluaran-total-amount,
   .pemasukan-total-amount {
       font-size: 14px;
   }

   .balance-breakdown {
       flex-direction: column;
       gap: 10px;
   }

   .balance-amount {
       font-size: 20px;
   }
   
   .grand-total {
       padding: 10px;
   }
   
   .grand-total-label {
       font-size: 15px;
   }
   
   .grand-total-amount {
       font-size: 16px;
   }

   .bukti-thumbnail {
       max-width: 120px;
       max-height: 120px;
   }

   .modal-content {
       padding: 10px;
   }

   .close-modal {
       font-size: 30px;
       top: 10px;
       right: 15px;
   }
   
   .dashboard {
       margin-bottom: 30px;
   }
}
