/* =========================
   GLOBAL RESET & BODY
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  color: #333;
}

/* =========================
   SIDEBAR STYLES
   ========================= */
#sidebar {
  width: min(320px, 85vw); /* ✅ Fleksible: maksimal 320px atau 85% layar */
  height: 100dvh; /* ✅ Dynamic viewport height - lebih baik di mobile */
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 1000;
  transform: translateX(0);
  border-right: 1px solid #eaeaea;
  top: 40px; /* ⬅️ TAMBAHKAN INI */
  height: calc(100vh - 40px); /* ⬅️ SESUAIKAN TINGGI */
}

.sidebar-hidden {
  transform: translateX(calc(-100% - 10px));
}

.toggle-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #1a2a6c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s;
  z-index: 1001;
}

.toggle-btn:hover {
  background: #0d1a4a;
  transform: scale(1.1);
}

.sidebar-hidden .sidebar-tab {
  display: flex;
  right: -40px;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to right, #1a2a6c, #b21f1f);
  color: white;
}

.sidebar-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-tab {
  position: absolute;
  top: 50%;
  right: -60px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
  padding: 15px 10px;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  color: white;
  transition: all 0.3s ease;
  z-index: 1001;
}

.sidebar-tab:hover {
  right: -55px;
  background: linear-gradient(135deg, #0d1a4a, #8a1919);
}

.tab-text {
  font-size: 0.8rem;
  margin-top: 5px;
  font-weight: 500;
}

.sidebar-content {
  padding: 20px;
  overflow-y: auto;
  height: calc(100% - 70px);
  background: #f9fafb;
}

/* Efek saat sidebar aktif */
#sidebar:not(.sidebar-hidden) {
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}


/* Responsive design untuk sidebar */
@media (max-width: 768px) {
  #sidebar {
    width: 100%;
    height: 70vh;
    bottom: 0;
    top: auto;
    transform: translateY(0);
    left: 0;
  }
  
  .sidebar-hidden {
    transform: translateY(110%); /* ⬅️ Geser 10% lebih jauh */
    opacity: 0; /* ⬅️ Sembunyikan sepenuhnya */
    pointer-events: none; /* ⬅️ Nonaktifkan interaksi */
  }

  #sidebar:not(.sidebar-hidden) {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  
  .sidebar-tab {
    top: -60px;
    right: 20px;
    left: auto;
    width: 80px;
    height: 60px;
    border-radius: 8px 8px 0 0;
    transform: none;
    flex-direction: row;
    padding: 10px 15px;
  }
  
  .sidebar-tab span {
    margin-right: 8px;
  }
  
  .sidebar-tab:hover {
    top: -65px;
  }
  
  .close-btn {
    background: rgba(0, 0, 0, 0.2);
  }
}

/* Scrollbar khusus sidebar */
.sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #1a2a6c, #b21f1f);
  border-radius: 10px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #0d1a4a, #8a1919);
}
/*Tambah Tag Kejadian*/
/* Scrollbar khusus */
h2 {
  text-align: center;
  margin-bottom: 20px;
}

.treeview-box, textarea {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  min-height: 60px;
  max-height: 150px;
  overflow-y: auto;
  resize: vertical;
  width: 100%;
  font-size: 14px;
}

ul.treeview {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

ul.treeview ul {
  margin-left: 20px;
  display: none;
}

.expandable > label::before {
  content: "▶ ";
  cursor: pointer;
}

.expanded > label::before {
  content: "▼ ";
}

input[type=checkbox] {
  margin-right: 5px;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}
/* ===== Bagian Donasi ===== */
#donationSection {
  margin-top: 30px;                /* Jarak atas dari form */
  text-align: center;              /* Teks dan gambar di tengah */
  border-top: 1px solid #ccc;      /* Garis pemisah atas */
  padding-top: 20px;               /* Jarak dalam dari border */
  padding-bottom: 20px;            /* Jarak bawah */
  background-color: #f9f9f9;       /* Background ringan */
  border-radius: 8px;              /* Sudut membulat */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* Bayangan lembut */
}

#donationSection p {
  font-size: 14px;
  color: #333;
  margin: 10px 0;                  /* Jarak antar paragraf */
}

#donationSection img {
  width: 200px;                     /* Lebar gambar QR code */
  height: auto;                     /* Tinggi menyesuaikan rasio */
  max-width: 100%;                  /* Responsive, tidak melebihi container */
  display: block;
  margin: 10px auto;                /* Tengah horizontal */
  border-radius: 6px;               /* Sudut gambar sedikit membulat */
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* Bayangan lembut di gambar */
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  #donationSection {
    padding: 15px;
  }

  #donationSection img {
    width: 150px;                   /* QR code lebih kecil di mobile */
  }

  #donationSection p {
    font-size: 13px;
  }
}
/* ============================================= */
/* ENHANCED MEDIA QUERIES */
/* ============================================= */

/* Tablet */
@media (max-width: 1024px) {
  .charts-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .login-container {
    min-height: auto;
    padding: 40px 20px;
  }
  
  .login-form {
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .admin-tabs {
    flex-direction: column;
    gap: 5px;
  }
  
  .tab-btn {
    border-radius: 5px;
    margin-right: 0;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  /* Improve table readability on mobile */
  table {
    font-size: 14px;
  }
  
  th, td {
    padding: 8px 10px;
  }
}

/* Very Small Mobile */
@media (max-width: 360px) {
  .login-form {
    padding: 15px;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .header-left {
    flex-direction: column;
    gap: 10px;
  }
}

/* =========================
   MAIN HEADER STYLING
   ========================= */
#main-content header {
  background: linear-gradient(to right, #1a2a6c, #b21f1f) !important;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1000;
}

/* Logo styling */
#main-content header .logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

#main-content header .logo i {
  font-size: 24px;
}

/* Navigation styling - Clean minimalis */
#main-content header nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 15px;
}

#main-content header nav a {
  color: #fff !important;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

#main-content header nav a:hover {
  background: rgba(255, 255, 255, 0);
  color: #fff !important;
}

/* Responsive design */
@media (max-width: 768px) {
  #main-content header {
    flex-direction: column;
    gap: 10px;
    padding: 10px 15px;
  }
  
  #main-content header nav ul {
    gap: 10px;
  }
  
  #main-content header nav ul li a {
    padding: 6px 12px;
    font-size: 14px;
  }
}

/* =========================
   MAIN CONTENT AREA
   ========================= */
#main-content {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}



/* =========================
   MAP CONTAINER
   ========================= */
#map-container {
  flex: 1;
  position: relative;
}

#map {
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* =========================
   FORM STYLING
   ========================= */
.container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  padding: 25px;
  margin-top: 20px;
}

h1 {
  text-align: center;
  color: #1a2a6c;
  margin-bottom: 20px;
  font-size: 28px;
  padding-bottom: 15px;
  border-bottom: 2px solid #fdbb2d;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1a2a6c;
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
  background: #f9f9f9;
}

input:focus, select:focus, textarea:focus {
  border-color: #1a2a6c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 42, 108, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button {
  background: linear-gradient(to right, #1a2a6c, #b21f1f);
  color: white;
  padding: 14px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

button:hover {
  background: linear-gradient(to right, #0d1a4a, #8a1919);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#preview {
  display: block;
  max-width: 100%;
  margin-top: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

#message {
  margin-top: 20px;
  padding: 15px;
  text-align: center;
  border-radius: 6px;
  font-weight: 500;
}

.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}


/* =========================
   ABSOLUTE BOX: NAVIGASI
   ========================= */
#navigasiMenu {
  background: rgba(255, 254, 254, 0.747); /* Warna latar semi transparan */
  border-radius: 8px;                     /* Sudut membulat */
  overflow-y: auto;                        /* Scroll jika konten tinggi */
  box-shadow: 0 2px 12px rgba(0,0,0,0.3); /* Bayangan halus */
  font-size: 14px;                        /* Ukuran teks */
  color: #333;                            /* Warna teks */
  padding: 15px;                          /* Spasi dalam box */
  line-height: 1.5;                       /* Jarak antar baris */
  max-width: 340px;                       /* Lebar maksimal */
  max-height: 400px;                      /* Tinggi maksimal */
  position: absolute;                     /* Supaya mengambang di atas peta */
  top: 66px;                              /* Atur jarak dari atas */
  right: 0px;                            /* Atur jarak dari kanan */
  z-index: 2000;                          /* Supaya muncul di atas elemen lain */
  display: none;                          /* Default tersembunyi */
}
#navigasiMenu .close-btn {
  background: none;        /* Hilangkan background */
  border: none;            /* Hilangkan border */
  font-size: 16px;         /* Ukuran ikon */
  font-weight: bold;       /* Tebalkan ✖ */
  cursor: pointer;         /* Ubah cursor jadi pointer */
  color: #333;             /* Warna ikon */
  position: absolute;      /* Posisi bebas */
  top: 8px;                /* Jarak dari atas box */
  right: 8px;              /* Jarak dari kanan box */
  transition: color 0.2s;  /* Animasi saat hover */
}

#navigasiMenu .close-btn:hover {
  color: rgb(62, 0, 177);              /* Jadi merah saat hover */
}
/* =========================
   LAPORAN KEUANGAN
   ========================= */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f7fa;
}

/* Sidebar / Box */
#financeBox {
  position: fixed;
  overflow-y: auto;                        /* Scroll jika konten tinggi */
  top: 66px;
  right: 0px;
  width: 320px;
  max-width: 340px;                       /* Lebar maksimal */
  max-height: 400px;                      /* Tinggi maksimal */
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  display: none; /* ⬅️ TAMBAHKAN INI - disembunyikan saat pertama load */
  flex-direction: column;
  overflow: hidden;
  z-index: 3000;
}

/* Header */
#financeBox .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: linear-gradient(to right, #1a2a6c, #b21f1f);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

#financeBox .header button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  top: 8px;                /* Jarak dari atas box */
  right: 8px;              /* Jarak dari kanan box */
  transition: color 0.2s;  /* Animasi saat hover */
  padding: 10px 15px;
}

/* Konten */
#financeBox .content {
  padding: 10px 15px;
  flex: 1;
  overflow-y: auto;
  color: #333;
}

/* Label & Input */
#financeBox label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  font-weight: 500;
}

#financeBox input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
}

/* Tombol tampilkan */
#financeBox button.showBtn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(to right, #1a2a6c, #b21f1f);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
  transition: 0.2s;
}

#financeBox button.showBtn:hover {
  background: linear-gradient(to right, #0d1a4a, #8a1919);
}

/* Daftar PDF */
.pdf-list a {
  display: block;
  padding: 8px;
  margin-bottom: 8px;
  background: #f0f0f0;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  transition: 0.2s;
}

.pdf-list a:hover {
  background: #e0e0e0;
}

/* Custom Scrollbar */
#financeBox .content::-webkit-scrollbar {
  width: 10px;
}

#financeBox .content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

#financeBox .content::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #1a2a6c, #b21f1f);
  border-radius: 6px;
}

#financeBox .content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #0d1a4a, #8a1919);
}

/* =========================
   GLOBAL CHAT BOX
   ========================= */
#chat-box {
  position: fixed;                     /* Tetap menempel di layar meski scroll */
  bottom: 20px;                        /* Jarak dari bawah layar */
  right: 20px;                         /* Jarak dari kanan layar */
  width: 320px;                        /* Lebar box */
  max-height: 400px;                   /* Tinggi maksimal box */
  background: rgba(255, 255, 255, 0.95); /* Latar putih agak transparan */
  border-radius: 10px;                 /* Sudut melengkung */
  box-shadow: 0 4px 15px rgba(0,0,0,0.25); /* Bayangan agar terlihat mengambang */
  display: flex;                       /* Supaya anak elemen bisa diatur kolom */
  flex-direction: column;              /* Susun header, form, dan list chat ke bawah */
  overflow: hidden;                    /* Potong konten yang keluar dari box */
  z-index: 3000;                       /* Pastikan di atas elemen lain */
}

/* =========================
   HEADER CHAT
   ========================= */
#chat-box .box-header {
  background: linear-gradient(to right, #1a2a6c, #b21f1f); /* Warna gradient biru → merah */
  color: white;                          /* Teks putih */
  padding: 12px 15px;                    /* Spasi dalam header */
  display: flex;                         /* Gunakan flex untuk atur posisi */
  justify-content: space-between;        /* Judul di kiri, tombol di kanan */
  align-items: center;                   /* Vertikal rata tengah */
}

#chat-box .box-header h2 {
  font-size: 16px;                       /* Ukuran teks judul */
  font-weight: 600;                      /* Tebal sedang */
}

#chat-box .box-header .close-btn {
  background: transparent;               /* Tombol tanpa background */
  border: none;                          /* Hilangkan border default */
  color: white;                          /* Warna ikon X putih */
  font-size: 18px;                       /* Ukuran ikon X */
  cursor: pointer;                       /* Ubah cursor jadi tangan */
}

/* =========================
   FORM INPUT CHAT
   ========================= */
#komentarForm {
  padding: 10px;                         /* Spasi dalam form */
  display: flex;                         /* Gunakan flexbox */
  flex-direction: column;                /* Input di atas, tombol di bawah */
  gap: 8px;                              /* Jarak antar elemen */
}

#komentarForm textarea {
  resize: none;                          /* Nonaktifkan resize manual */
  padding: 10px;                         /* Spasi dalam textarea */
  border-radius: 6px;                    /* Sudut melengkung */
  border: 1px solid #ddd;                /* Border abu tipis */
  font-size: 14px;                       /* Ukuran teks input */
  min-height: 60px;                      /* Tinggi minimal */
}

#komentarForm button {
  background: linear-gradient(to right, #1a2a6c, #b21f1f); /* Tombol gradient */
  color: white;                          /* Teks putih */
  border: none;                          /* Hilangkan border default */
  border-radius: 6px;                    /* Sudut melengkung */
  padding: 10px;                         /* Spasi dalam tombol */
  font-size: 14px;                       /* Ukuran teks tombol */
  font-weight: 600;                      /* Teks agak tebal */
  cursor: pointer;                       /* Ubah cursor jadi tangan */
  transition: background 0.2s;           /* Animasi halus saat hover */
}

#komentarForm button:hover {
  background: linear-gradient(to right, #0d1a4a, #8a1919); /* Gradient lebih gelap saat hover */
}

/* =========================
   DAFTAR CHAT
   ========================= */
#komentarList {
  flex: 1;                               /* Isi ruang sisa di box */
  padding: 10px;                         /* Spasi dalam list chat */
  overflow-y: auto;                      /* Scroll vertikal kalau banyak pesan */
  font-size: 14px;                       /* Ukuran teks pesan */
  line-height: 1.4;                      /* Jarak antar baris pesan */
}

/* Pesan umum (user lain) */
#komentarList .chat-item {
  margin-bottom: 10px;                   /* Jarak antar chat */
  padding: 8px;                          /* Spasi dalam chat bubble */
  border-radius: 6px;                    /* Sudut melengkung */
  background: #f5f7fa;                   /* Warna abu muda */
}

/* Pesan sendiri (me) */
#komentarList .chat-item.me {
  background: #d4edda;                   /* Warna hijau muda */
  text-align: right;                     /* Rata kanan */
}



/* =========================
   FLOATING BOX: KONTROL PETA
   (WARNA DISESUAIKAN DENGAN GLOBAL CHAT BOX)
   ========================= */
#map-controls {
  position: absolute;                /* Box mengambang di atas peta */
  top: 66px;                         /* Jarak dari atas layar */
  right: 0px;                       /* Jarak dari sisi kanan layar */
  z-index: 2000;                     /* Pastikan selalu di atas elemen lain */
  background: rgba(255, 255, 255, 0.945); /* Latar putih semi transparan */
  border-radius: 10px;               /* Membulatkan seluruh sudut box */
  padding: 15px;                     /* Jarak dalam box */
  box-shadow: 0 4px 15px rgba(0,0,0,0.25); /* Bayangan lembut seperti chat box */
  max-width: 340px;                  /* Lebar maksimal box */
  max-height: 75vh;                  /* Tinggi maksimal agar tidak menutupi peta */
  overflow-y: auto;                  /* Jika konten panjang, tampil scroll vertikal */
  font-family: "Segoe UI", Arial, sans-serif; /* Font teks box */
  display: none;                     /* Default disembunyikan, ditampilkan lewat script */
}

/* ===== Header Box (judul & tombol close) ===== */
#map-controls .box-header {
  display: flex;                       /* Supaya judul dan tombol sejajar horizontal */
  justify-content: space-between;      /* Judul di kiri, tombol close di kanan */
  align-items: center;                 /* Vertikal center */
  margin-bottom: 12px;                 /* Jarak bawah header */
  border-bottom: 2px solid #ccc;       /* Garis pemisah lembut */
  padding-bottom: 6px;                 /* Ruang bawah konten header */
  background: linear-gradient(to right, #1a2a6c, #b21f1f); /* Gradient tema utama */
  color: white;                        /* Warna teks putih */
  border-radius: 6px 6px 0 0;          /* Sudut atas membulat */
}

#map-controls .box-header h3 {
  margin: 0;                            /* Hilangkan margin default */
  font-size: 18px;                      /* Ukuran teks judul */
  font-weight: 600;                     /* Tebal sedang */
  color: white;                         /* Warna teks */
  padding-left: 10px;                   /* Geser teks ke kanan sedikit */
}

#map-controls .close-btn {
  background: transparent;              /* Tombol tanpa background */
  border: none;                         /* Hilangkan border default */
  font-size: 18px;                      /* Ukuran ikon close */
  cursor: pointer;                      /* Pointer saat hover */
  color: white;                         /* Warna putih sesuai chat box */
}

/* ===== Tampilkan Marker & Heatmap sejajar horizontal (BAGIAN ATAS) ===== */
#map-controls .toggle-group {
  display: flex;                 /* Tampilkan sejajar */
  align-items: center;           /* Rata vertikal tengah */
  gap: 20px;                     /* Jarak antar label */
  margin-top: 8px;
  margin-bottom: 10px;
}

#map-controls .toggle-group label {
  display: flex;
  align-items: center;
  gap: 6px;                      /* Jarak antara checkbox dan teks */
  font-weight: 500;
  color: #1a2a6c;
  cursor: pointer;
  user-select: none;
}

/* Checkbox gaya modern */
#map-controls .toggle-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1a2a6c;         /* Warna biru sesuai tema */
  cursor: pointer;
}

/* ===== Label & Input ===== */
#map-controls label {
  font-size: 14px;                      /* Ukuran teks label */
  font-weight: 500;                     /* Tebal sedang */
  color: #1a2a6c;                       /* Warna tema biru tua */
  display: block;                       /* Tampil di baris baru (default untuk form) */
  margin-top: 10px;                     /* Jarak atas label */
  margin-bottom: 5px;                   /* Jarak bawah label */
}



#map-controls input:focus,
#map-controls select:focus {
  border-color: #b21f1f;                /* Saat fokus, border merah gradient */
  outline: none;                        /* Hilangkan outline default browser */
}

/* ===== Tombol utama (seperti Terapkan Filter, Reset, dll.) ===== */
#map-controls button {
  background: linear-gradient(to right, #1a2a6c, #b21f1f); /* Gradient biru ke merah */
  color: #fff;                           /* Teks putih */
  border: none;                          /* Hilangkan border */
  border-radius: 6px;                    /* Sudut membulat */
  padding: 7px 12px;                     /* Ruang dalam tombol */
  cursor: pointer;                       /* Pointer saat hover */
  margin-top: 6px;                       /* Jarak atas tombol */
  font-size: 14px;                       /* Ukuran teks tombol */
  transition: background 0.2s ease;      /* Animasi halus saat hover */
}

#map-controls button:hover {
  background: linear-gradient(to right, #0d1a4a, #8a1919); /* Hover lebih gelap */
}

/* ===== Tombol mini (diseragamkan dengan tombol "Cari" lokasi) ===== */
/* Semua tombol 🔍 kecil (jenis kejadian, tanggal, jam, kata kunci, dsb)
   dibuat sama seperti tombol pencarian lokasi agar tampilan seragam. */
#map-controls .mini-btn,
#map-controls #searchBtn {
  background: linear-gradient(to right, #1a2a6c, #b21f1f); /* Gradient sama */
  color: #fff;                          /* Warna teks putih */
  border: none;                         /* Hilangkan border default */
  border-radius: 6px;                   /* Membulat */
  padding: 7px 12px;                    /* Ruang dalam tombol */
  cursor: pointer;                      /* Pointer saat hover */
  font-size: 14px;                      /* Ukuran teks */
  transition: background 0.2s ease, transform 0.1s ease; /* Animasi hover/klik */
  display: inline-block;                /* Supaya bisa sejajar */
  margin-top: 5px;                      /* Jarak atas kecil */
}

#map-controls .mini-btn:hover,
#map-controls #searchBtn:hover {
  background: linear-gradient(to right, #0d1a4a, #8a1919); /* Hover lebih gelap */
  transform: translateY(-1px);          /* Efek naik saat hover */
}

#map-controls .mini-btn:active,
#map-controls #searchBtn:active {
  transform: translateY(0);             /* Kembali saat ditekan */
}

/* ===== Checkbox alignment fix ===== */
/* Supaya checkbox (misal: Tampilkan Marker, Heatmap, dll) sejajar vertikal dengan teks */
#map-controls input[type="checkbox"] {
  vertical-align: middle;        /* Sejajarkan checkbox ke tengah teks */
  margin-right: 6px;             /* Jarak antara checkbox dan teks */
  transform: scale(1.15);        /* Sedikit perbesar agar lebih proporsional */
  accent-color: #1a2a6c;         /* Warna centang biru sesuai tema utama */
}

/* Gunakan flex agar label dan checkbox selalu sejajar tengah */
#map-controls label {
  display: inline-flex;           /* Jadikan satu baris dengan isi */
  align-items: center;            /* Sejajarkan vertikal di tengah */
  gap: 6px;                       /* Jarak antar elemen di dalam label */
}

/* ===== Statistik filter ===== */
#map-controls #filter-stats {
  background: #f5f7fa;                  /* Background abu muda */
  border: 1px solid #ddd;               /* Border tipis */
  border-radius: 8px;                   /* Sudut membulat */
  padding: 8px;                         /* Ruang dalam box statistik */
}

#map-controls #filter-stats h4 {
  margin: 0 0 8px 0;                    /* Margin bawah 8px */
  font-size: 15px;                      /* Ukuran teks judul statistik */
  font-weight: 600;                     /* Tebal sedang */
}

/* ===== Loading spinner (animasi lingkaran berputar) ===== */
#map-controls .loading-spinner {
  border: 3px solid #f3f3f3;            /* Border abu muda (background) */
  border-top: 3px solid #1a2a6c;        /* Warna spinner biru utama */
  border-radius: 50%;                   /* Bentuk lingkaran */
  width: 20px;                          /* Diameter lingkaran */
  height: 20px;                         /* Tinggi lingkaran */
  animation: spin 1s linear infinite;   /* Animasi rotasi terus-menerus */
  display: inline-block;                /* Bisa sejajar dengan teks */
  vertical-align: middle;               /* Sejajar vertikal */
}

/* ===== Animasi rotasi spinner ===== */
@keyframes spin {
  0% { transform: rotate(0deg); }       /* Awal rotasi */
  100% { transform: rotate(360deg); }   /* Rotasi penuh */
}

/* ===== Responsive untuk layar kecil (mobile) ===== */
@media (max-width: 600px) {
  #map-controls {
    top: auto;                          /* Hilangkan posisi atas */
    bottom: 20px;                       /* Geser ke bawah layar */
    right: 50%;                         /* Geser ke tengah */
    transform: translateX(50%);         /* Koreksi posisi tengah */
    width: 90%;                         /* Lebar hampir penuh layar */
    max-height: 60vh;                   /* Tinggi maksimal lebih kecil */
  }
}




/* =========================
   POPUP / TOOLTIP STYLES (Info Laporan setiap marker & Berkomentar)
   ========================= */

/* === Popup Wrapper === */
.leaflet-popup-content-wrapper {
  background: rgba(255, 254, 254, 0.911);         /* Latar belakang popup */
  border-radius: 8px;                     /* Sudut membulat */
  overflow-y: auto;                        /* Scroll vertikal jika konten overflow */
  box-shadow: 0 2px 12px rgba(0,0,0,0.3); /* Bayangan popup */
  font-size: 14px;                        /* Ukuran font default */
  color: #333;                            /* Warna teks default */
  line-height: 1.5;                       /* Jarak antar baris */
  max-width: 310px;                        /* Lebar maksimum popup */
  max-height: 400px;                       /* Tinggi maksimum popup sebelum scroll muncul */
}

/* === Judul Jenis Laporan === */
.leaflet-popup-content-wrapper strong.jenis {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
  color: #1a2a6c;
}

/* === Paragraf Informasi === */
.leaflet-popup-content-wrapper p {
  margin: 5px 0;
  font-size: 14px;
  color: #333;
}

/* === Nama Pelapor === */
.leaflet-popup-content-wrapper span.nama {
  font-weight: 600;
}

/* === Badge Akun Resmi === */
.leaflet-popup-content-wrapper span.official-badge {
  color: #28a745;
  font-weight: bold;
  margin-left: 5px;
}

/* === Deskripsi Laporan - Tampilkan dengan line breaks === */
.leaflet-popup-content-wrapper .deskripsi {
  white-space: pre-line; /* Menghormati line breaks */
  display: block;
  margin-top: 5px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 3px solid #1a2a6c;
  font-size: 14px;
  line-height: 1.4;
}

/* === Tag Kejadian - Tampilkan dengan line breaks dan format rapi === */
.leaflet-popup-content-wrapper .tag-autofill {
  white-space: pre-line; /* Menghormati line breaks */
  display: block;
  margin-top: 5px;
  padding: 8px;
  background: #e8f4fd;
  border-radius: 4px;
  border-left: 3px solid #007bff;
  font-size: 13px;
  line-height: 1.4;
}

/* === Foto Laporan === */
.leaflet-popup-content-wrapper .foto {
  max-width: 100%;
  margin: 10px 0;
  border-radius: 6px;
  display: block;
  border: 1px solid #ddd;
}

/* === Box Komentar === */
.leaflet-popup-content-wrapper .komentar-box {
  margin-top: 10px;
}

/* === Daftar Komentar === */
.leaflet-popup-content-wrapper .komentar-list {
  max-height: 120px;                      /* Tinggi maksimal box komentar */
  overflow-y: auto;                        /* Scroll vertikal jika konten overflow */
  padding: 8px;                            /* Jarak isi box komentar */
  resize: vertical;                        /* Bisa diubah tingginya */
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f9f9f9;
  font-size: 13px;
  margin-bottom: 10px;
}

/* === Form Komentar === */
.leaflet-popup-content-wrapper .form-komentar textarea {
  width: 100%;                             /* Lebar penuh form */
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  resize: vertical;                        /* Bisa diubah tingginya */
  min-height: 60px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

/* === Fokus pada Textarea === */
.leaflet-popup-content-wrapper .form-komentar textarea:focus {
  border-color: #1a2a6c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 42, 108, 0.2);
}

/* === Tombol Kirim Komentar === */
.leaflet-popup-content-wrapper .form-komentar button.btn-kirim {
  background: linear-gradient(to right, #1a2a6c, #b21f1f);
  color: white;
  padding: 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}

/* === Hover Tombol Kirim === */
.leaflet-popup-content-wrapper .form-komentar button.btn-kirim:hover {
  background: linear-gradient(to right, #0d1a4a, #8a1919);
  transform: translateY(-1px);
  box-shadow: 0 5px 8px rgba(0,0,0,0.15);
}

/* === Ujung Segitiga Popup === */
.leaflet-popup-tip {
  background: white;
}

/* === Scrollbar Khusus Daftar Komentar === */
.leaflet-popup-content-wrapper .komentar-list::-webkit-scrollbar {
  width: 6px;
}

.leaflet-popup-content-wrapper .komentar-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 6px;
}

.leaflet-popup-content-wrapper .komentar-list::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #1a2a6c, #b21f1f);
  border-radius: 6px;
}

.leaflet-popup-content-wrapper .komentar-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #0d1a4a, #8a1919);
}

/* =========================
   FILTER & RANGE SLIDER
   ========================= */
.filter-section {
  margin-bottom: 20px;
}

.filter-section label {
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
}

.filter-section select, .filter-section input[type="range"] {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
}

.range-value {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
}

/* =========================
   HEATMAP LEGEND
   ========================= */
.heatmap-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  background: rgba(255,255,255,0.9);
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.heatmap-legend h4 {
  margin-bottom: 5px;
  color: #1a2a6c;
}

.heatmap-legend div {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.heatmap-legend span {
  display: inline-block;
  width: 20px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
}

/* =========================
   ADMIN PANEL / DASHBOARD
   ========================= */
.admin-container {
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
}

.admin-table th {
  background: linear-gradient(to right, #1a2a6c, #b21f1f);
  color: white;
  font-weight: 600;
}

.admin-table tr:hover {
  background: rgba(26,42,108,0.1);
}

/* =========================
   BADGE / STATUS STYLING
   ========================= */
.badge {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  display: inline-block;
}

.badge-success {
  background-color: #28a745;
}

.badge-warning {
  background-color: #ffc107;
}

.badge-danger {
  background-color: #dc3545;
}

/* =========================
   LOADING SPINNER
   ========================= */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #1a2a6c;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* =========================
   CUSTOM TOAST / MESSAGE
   ========================= */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1a2a6c;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   NOTIFICATION / ALERT BOX
   ========================= */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #b21f1f;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.notification.success {
  background: #28a745;
}

.notification.error {
  background: #dc3545;
}

.notification.show {
  opacity: 1;
}
/* ============================================= */
/* SIDEBAR TAB - POSISI FIXED DI LUAR SIDEBAR */
/* ============================================= */

.sidebar-tab {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
  padding: 15px 10px;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  color: white;
  transition: all 0.3s ease;
  z-index: 1001; /* Lebih tinggi dari sidebar */
}

.sidebar-tab:hover {
  padding-left: 15px;
  background: linear-gradient(135deg, #0d1a4a, #8a1919);
}

.tab-text {
  font-size: 12px;
  margin-top: 5px;
  font-weight: 500;
}

/* Responsive untuk sidebar tab */
@media (max-width: 1024px) {
  .sidebar-tab {
    width: 55px;
    padding: 13px 8px;
  }
}

@media (max-width: 768px) {
  .sidebar-tab {
    width: 50px;
    padding: 12px 7px;
  }
}

@media (max-width: 576px) {
  .sidebar-tab {
    width: 45px;
    padding: 10px 6px;
    font-size: 14px;
  }
  
  .tab-text {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .sidebar-tab {
    width: 40px;
    padding: 8px 5px;
    font-size: 12px;
  }
  
  .tab-text {
    font-size: 10px;
  }
}
/* =========================
   FOOTER
   ========================= */
footer {
  background: #1a2a6c;
  color: white;
  padding: 15px 30px;
  text-align: center;
  font-size: 14px;
  position: relative;
  z-index: 10;
}
