:root {
  --brown: #4a3428;
  --teal: #1a9aa8;
  --teal-dark: #0f7c88;
  --blue-link: #1a6ec7;
  --green-badge: #3d9d4a;
  --blue-badge: #2a6fb0;
  --text: #2b2b2b;
  --border: #e2e6e8;
  --bg: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--brown);
  color: #ddd;
  font-size: 12px;
  padding: 4px 16px;
}
.header {
  background: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 22px;
  color: #222;
}
.logo .mark {
  width: 22px; height: 22px;
  background: var(--teal);
  display: inline-block;
  clip-path: polygon(0 100%, 0 40%, 40% 40%, 40% 0, 100% 0, 100% 100%);
}
.login-link { color: var(--teal-dark); font-size: 14px; text-decoration: none; font-weight: 600; }

nav.mainnav {
  background: var(--teal);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 24px;
  font-size: 15px;
  flex-wrap: wrap;
  position: relative;
  z-index: 30;
}
nav.mainnav a {
  color: #fff;
  text-decoration: none;
  padding: 12px 0;
  display: inline-block;
  opacity: 0.92;
}
nav.mainnav a.active { font-weight: 700; opacity: 1; border-bottom: 3px solid #fff; }
nav.mainnav a:hover { opacity: 1; }

.nav-dropdown { position: relative; }
.nav-dropdown > a::after {
  content: "▾";
  font-size: 11px;
  margin-left: 5px;
  display: inline-block;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 100%;
  width: max-content;
  background: var(--teal-dark);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  z-index: 999;
  flex-direction: column;
  padding: 6px 0;
  overflow: hidden;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown-menu a {
  color: #fff;
  padding: 9px 18px;
  opacity: 1;
  white-space: nowrap;
  text-align: center;
  font-size: 13px;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: rgba(0,0,0,0.18); }

.breadcrumb {
  background: #eef0f2;
  border-bottom: 1px solid var(--border);
}
.breadcrumb-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 10px 20px;
  font-size: 14px;
  color: #666;
}
.breadcrumb a { color: var(--blue-link); text-decoration: none; }

.panel {
  max-width: 1300px;
  width: 100%;
  margin: 14px auto 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0 20px;
}
.panel-head {
  background: #eef7f8;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 6px;
}
.panel-head h1 {
  font-size: 14px;
  margin: 0;
  color: #444;
  font-weight: 600;
}
.panel-head .rilis {
  color: var(--green-badge);
  font-weight: 700;
  font-size: 13px;
}

.panel-head-center {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 22px 20px 22px;
  gap: 12px;
}
.panel-head-center .rilis-marquee {
  width: 100%;
  padding: 0;
}
.panel-head-center .rilis-marquee .marquee-track.rilis {
  color: var(--green-badge);
  font-weight: 700;
  font-size: 14.5px;
}
.panel-head-center .tahun-label {
  text-align: center;
  color: var(--green-badge);
  font-size: 14.5px;
}
.dataset-head .chart-box {
  margin: 4px 0 0;
}

.controls {
  display: flex;
  gap: 10px;
  padding: 24px 20px 10px;
  flex-wrap: wrap;
  align-items: center;
}
.controls input[type="text"] {
  flex: 1;
  min-width: 200px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 15px;
}
.controls select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 15px;
  background: #fff;
}
.btn-toc {
  background: var(--teal);
  color: #fff;
  border: none;
  height: 40px;
  padding: 0 16px;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-toc:hover { background: var(--teal-dark); }

.toggle-all { margin: 10px 20px 20px; }
.toggle-all button {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
}
.toggle-all button:hover { background: var(--teal-dark); }
.toc-controls { display: flex; gap: 10px; }
.toc-controls button:last-child { background: #4a7fa8; }
.toc-controls button:last-child:hover { background: #3d6b8f; }

.bab-list-toc {
  padding: 4px 20px 12px;
  font-size: 13px;
}
.bab-list-toc .bab-title { font-size: 13px; padding: 6px 4px; }
.bab-list-toc .dataset-list { padding-left: 24px; }
.bab-list-toc .dataset-item { font-size: 12.5px; padding: 3px 0; }

.bab-list { padding: 8px 20px; }
.bab { border-bottom: 1px solid #f0f0f0; position: relative; }

/* --- PERUBAHAN DESAIN ACCORDION (BAB) ELEGAN --- */
.bab-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  cursor: pointer;
  color: var(--blue-link);
  font-size: 15.5px;
  font-weight: 600;
  user-select: none;
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}
.bab-title .caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; 
  height: 28px;
  background-color: #f0f4f8; /* Lingkaran abu lembut */
  color: var(--teal);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.bab-title:hover { text-decoration: none; color: var(--teal-dark); }
.bab-title:hover .caret {
  background-color: var(--teal);
  color: #fff;
  transform: scale(1.1); /* Sedikit membesar saat disorot */
}
.bab.open .caret { 
  transform: rotate(90deg); /* Berputar ke bawah */
  background-color: var(--teal);
  color: #fff;
}
/* ----------------------------------------------- */

.dataset-list { display: none; padding: 2px 0 10px 30px; position: relative; }
.bab.open .dataset-list { display: block; }

/* --- Garis Penghubung Modern (Solid & Halus) --- */
.dataset-list::before {
  content: "";
  position: absolute;
  top: -6px;
  bottom: 0;
  left: 19px; 
  border-left: 2px solid #e6ecf0; /* Garis solid lembut */
}

.dataset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0 5px 12px;
  font-size: 15px;
  position: relative;
}
.dataset-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -11px;
  width: 14px;
  border-top: 2px solid #e6ecf0; /* Garis solid lembut */
}
.badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0;
}
.badge.publish { background: var(--green-badge); }
.badge.status-publish { background: var(--green-badge); }
.badge.status-empty { background: #9aa4a8; }
.badge.opd { background: var(--blue-badge); }
.dataset-item a { color: var(--blue-link); text-decoration: none; }
.dataset-item a:hover { text-decoration: underline; }

footer {
  background: #fff;
  color: var(--text);
  text-align: center;
  padding: 28px 20px 18px;
  font-size: 13.5px;
  margin-top: auto; 
}
footer h3 { margin: 0 0 10px; font-size: 15px; color: #222; }
footer p { margin: 3px 0; opacity: 0.85; }
footer a { color: var(--blue-link); }

.socials { 
  margin: 20px 0 14px; 
  display: flex; 
  gap: 20px; 
  justify-content: center; 
  align-items: center;
}
.social-icon {
  display: inline-flex;
  color: var(--text);
  transition: transform 0.2s, color 0.2s;
}
.social-icon:hover { transform: scale(1.15); }
.social-icon.ig { color: #E1306C; }
.social-icon.yt { color: #FF0000; }
.social-icon.fb { color: #1877F2; }
.social-icon.x { color: #000000; }

.back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background-color: var(--teal);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  text-decoration: none;
  z-index: 999;
  transition: all 0.3s ease;
  opacity: 0.85;
}

.back-top:hover {
  background-color: var(--teal-dark);
  transform: translateY(-4px); 
  opacity: 1;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.counters { 
  display: flex; 
  gap: 16px; 
  justify-content: center; 
  margin-top: 24px; 
  flex-wrap: wrap; 
}
.counter-card {
  background: #fff;
  border: 1px solid #e2e6e8;
  border-radius: 8px;
  padding: 14px 24px 14px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 175px;
  transition: all 0.3s ease;
}
.counter-card:hover {
  border-color: var(--teal);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.counter-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bg-light-blue { background: #eef5f7; }
.bg-light-green { background: #edf7ef; }

.online-pulse { position: relative; }
.online-pulse::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(61, 157, 74, 0.2);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.counter-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.counter-label {
  font-size: 11px;
  color: #777;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.counter-value {
  font-size: 20px;
  font-weight: 800;
  color: #222;
  line-height: 1.2;
  margin-top: 2px;
}
.copyright { background: var(--teal-dark); color: #fff; text-align: center; padding: 10px; font-size: 12.5px; }

.dataset-title-bar {
  padding: 14px 20px 4px;
  font-size: 13px;
  color: #444;
}

.marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
  padding: 0 0 4px;
}
.marquee-track {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-scroll 16s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.export-wrap { position: relative; display: inline-block; }
.export-menu {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  min-width: 190px;
  z-index: 20;
  overflow: hidden;
}
.export-wrap.open .export-menu { display: block; }
.export-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.export-menu button:last-child { border-bottom: none; }
.export-menu button:hover { background: #f2f8f9; color: var(--teal-dark); }
.export-menu button small { display: block; color: #888; font-size: 11px; margin-top: 2px; }

.leaderboard-list { margin: 0; padding: 0; list-style: none; }
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.lb-rank {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #7d8a91;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.leaderboard-row:nth-child(1) .lb-rank { background: #e0a72a; }
.leaderboard-row:nth-child(2) .lb-rank { background: #b0b8bd; }
.leaderboard-row:nth-child(3) .lb-rank { background: #c17a3d; }
.lb-name { width: 140px; flex-shrink: 0; font-size: 14.5px; font-weight: 600; }
.lb-bar-wrap {
  flex: 1;
  background: #f0f2f3;
  border-radius: 6px;
  overflow: hidden;
  height: 20px;
}
.lb-bar {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  transition: width 0.4s ease;
}
.lb-bar-value {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  white-space: nowrap;
}
.lb-count { flex-shrink: 0; width: 95px; text-align: right; font-size: 13.5px; color: #555; }
.chart-box {
  background: #111;
  margin: 14px 20px 0;
  border-radius: 4px;
  padding: 16px 10px;
}
.chart-box h2 {
  color: #ddd;
  font-size: 13px;
  text-align: center;
  margin: 0 0 8px;
  font-weight: 500;
}
.chart-credit { text-align: right; color: #888; font-size: 10px; padding: 2px 8px 0; }

.update-note {
  background: #eaf3fb;
  border: 1px solid #cfe1ef;
  color: #2c5b7a;
  margin: 18px 20px 0;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  text-align: center;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px 20px 0;
}
.btn-publish, .btn-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
.btn-publish { background: #6ba056; }
.btn-publish.status-publish { background: #6ba056; }
.btn-publish.status-empty { background: #9aa4a8; }
.btn-export { background: #4d7a42; }
.btn-publish:hover, .btn-export:hover { filter: brightness(0.92); }

.status-note {
  text-align: center;
  font-size: 13px;
  margin: 8px 20px 0;
  padding: 8px 12px;
  border-radius: 4px;
}
.year-status-banner {
  background: #fbedb8;
  border-top: 1px solid #e9d585;
  border-bottom: 1px solid #e9d585;
  padding: 16px 20px;
}
.year-status-banner .ysb-title {
  color: #7a5c00;
  font-weight: 800;
  font-size: 18px;
  margin: 0 0 4px;
}
.year-status-banner .ysb-body {
  color: #8a7326;
  font-size: 13.5px;
}
.year-status-banner .ysb-body strong { color: #6b5200; font-weight: 700; }

table.data-table tr.empty-row td {
  background: #f2f3f4;
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 18px 8px;
}

table.data-table td.cell-unknown {
  color: #999;
  font-style: italic;
  text-align: center;
}
table.data-table td.cell-pending {
  color: #c7a800;
  font-weight: 700;
  text-align: center;
  background: #fffbe9;
}
table.data-table tr.verif-row td {
  background: #fdf7d8;
  color: #6b5a00;
  font-style: italic;
  text-align: center;
  font-size: 12.5px;
  padding: 8px;
}

.download-count {
  text-align: center;
  font-size: 13px;
  color: #666;
  margin: 8px 20px 0;
}
.download-count strong { color: var(--teal-dark); }

.data-table-wrap { margin: 16px 20px 0; }
.data-table-wrap h3 { text-align: center; font-size: 14.5px; margin: 0 0 10px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; border: 1px solid var(--border); }
table.data-table th {
  background: var(--blue-badge);
  color: #fff;
  padding: 8px;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--blue-badge);
}
table.data-table td { padding: 8px; text-align: center; border: 1px solid var(--border); }
table.data-table tr.total-row td { background: #f4f4f4; font-weight: 700; }
.source-note { text-align: left; padding: 6px 4px; font-style: italic; font-size: 13px; color: #555; }

.meta-table { margin: 22px 20px 0; }
table.meta { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid var(--border); }
table.meta th { background: var(--teal); color: #fff; padding: 7px; border: 1px solid var(--teal); }
table.meta td { padding: 8px; text-align: center; border: 1px solid var(--border); }

.most-downloaded {
  margin: 26px 20px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
}
.most-downloaded h3 { margin: 0 0 10px; font-size: 14px; color: #444; }
.most-downloaded ol { margin: 0; padding-left: 20px; font-size: 13.5px; }
.most-downloaded li { margin-bottom: 4px; }
.most-downloaded .count { color: var(--teal-dark); font-weight: 700; }

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
  .breadcrumb-inner,
  .panel { max-width: 100%; }
}

@media (max-width: 700px) {
  .header { padding: 10px 14px; }
  .logo { font-size: 18px; }

  nav.mainnav { gap: 4px; padding: 0 8px; font-size: 13.5px; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; flex-wrap: nowrap; }
  nav.mainnav a { padding: 10px 8px; flex-shrink: 0; }
  .nav-dropdown-menu { left: 0; right: auto; }

  .breadcrumb-inner { padding: 8px 12px; font-size: 12.5px; }

  .panel { margin: 8px auto 24px; border-radius: 0; border-left: none; border-right: none; }
  .panel-head { padding: 10px 12px; }
  .panel-head-center { padding: 14px 12px 16px; }

  .controls { flex-direction: column; align-items: stretch; padding: 16px 12px 8px; }
  .controls input[type="text"],
  .controls select,
  .btn-toc { width: 100%; }

  .bab-list, .bab-list-toc { padding: 8px 12px; }

  .chart-box { margin: 12px 8px 0; padding: 12px 6px; }
  .chart-box canvas { max-width: 100%; }

  .action-row { flex-direction: column; margin: 16px 12px 0; }
  .btn-publish, .btn-export { width: 100%; text-align: center; }
  .export-menu { left: 0; right: 0; width: 100%; min-width: 0; }

  .data-table-wrap, .meta-table, .most-downloaded, .update-note, .year-status-banner, .status-note, .download-count { margin-left: 12px; margin-right: 12px; }
  table.data-table, table.meta { font-size: 12px; }
  table.data-table th, table.data-table td, table.meta th, table.meta td { padding: 6px 5px; }

  .leaderboard-row { flex-wrap: wrap; gap: 6px; }
  .lb-name { width: auto; flex: 1 1 100px; }
  .lb-bar-wrap { flex: 1 1 100%; order: 3; }
  .lb-count { width: auto; }

  footer { padding: 22px 14px 14px; }
  
  .counters { gap: 10px; }
  .counter-card { 
    width: calc(50% - 5px); 
    min-width: unset; 
    padding: 12px !important; 
    gap: 10px;
  }
  .counter-icon-wrap { width: 38px; height: 38px; }
  .counter-icon-wrap svg { width: 16px; height: 16px; }
  .counter-value { font-size: 16px; }
  .counter-label { font-size: 10px; }
}

@media (max-width: 420px) {
  .logo { font-size: 16px; }
  .panel-head-center .tahun-label, .panel-head-center .marquee-track.rilis { font-size: 12.5px; }
}

/* ==========================================================
   DARK MODE OVERRIDES (DISEMPURNAKAN)
   ========================================================== */
body.dark-mode {
  --bg: #121212;
  --text: #e0e0e0;
  --border: #333333;
  --blue-link: #8ab4f8; 
}

body.dark-mode .header,
body.dark-mode .panel,
body.dark-mode footer,
body.dark-mode .counter-card,
body.dark-mode .export-menu,
body.dark-mode .export-menu button,
body.dark-mode .controls input[type="text"],
body.dark-mode .controls select {
  background-color: #1e1e1e;
  color: #e0e0e0;
  border-color: #333;
}

body.dark-mode .logo,
body.dark-mode footer h3 {
  color: #ffffff;
}

body.dark-mode .social-icon.x {
  color: #ffffff;
}

body.dark-mode .breadcrumb { background: #252525; }
body.dark-mode .panel-head { background: #252525; border-color: #333333; }
body.dark-mode .panel-head-center .tahun-label,
body.dark-mode .panel-head-center .marquee-track.rilis {
  color: #81c995; 
}

/* --- PERBAIKAN WARNA TABEL --- */
body.dark-mode table.data-table th { 
  background: #1c456b; 
  border-color: #2a5a8a; 
  color: #e8eaed;
}
body.dark-mode table.meta th { 
  background: #0f5860; 
  border-color: #1a717a; 
  color: #e8eaed;
}
body.dark-mode table.data-table td, 
body.dark-mode table.meta td { 
  border-color: #333333; 
}

body.dark-mode table.data-table tr.total-row td { background: #2a2a2a; color: #ffffff; }
body.dark-mode table.data-table tr.empty-row td { background: #1e1e1e; color: #aaaaaa; }
body.dark-mode table.data-table td.cell-pending { background: #3a3200; color: #f2c75c; }
body.dark-mode table.data-table tr.verif-row td { background: #3a3200; color: #f2c75c; }

/* Akordion / Daftar BAB (Dark Mode) */
body.dark-mode .bab { border-color: #2a2a2a; }
body.dark-mode .dataset-list::before, 
body.dark-mode .dataset-item::before { 
  border-color: rgba(138, 180, 248, 0.4); /* Warna biru yang sama, tapi transparansi 40% */
}
body.dark-mode .bab-title { color: #8ab4f8; }
body.dark-mode .bab-title:hover { color: #fff; }
body.dark-mode .bab-title .caret {
  background-color: #2a2a2a;
  color: #8ab4f8;
}
body.dark-mode .bab-title:hover .caret,
body.dark-mode .bab.open .caret {
  background-color: #8ab4f8;
  color: #121212;
}

/* Perbaikan Kotak Note (Notifikasi) */
body.dark-mode .update-note { 
  background: #0c2b42; 
  border-color: #174263; 
  color: #8ab4f8; 
}
body.dark-mode .year-status-banner { background: #4a3e10; border-color: #5c4e16; }
body.dark-mode .year-status-banner .ysb-title, 
body.dark-mode .year-status-banner .ysb-body, 
body.dark-mode .year-status-banner .ysb-body strong { color: #ffe699; }

body.dark-mode .counter-value { color: #ffffff; }
body.dark-mode .counter-label { color: #aaaaaa; }
body.dark-mode .bg-light-blue { background: #1a3038; }
body.dark-mode .bg-light-green { background: #1b3321; }

body.dark-mode .lb-bar-wrap { background: #333333; }
body.dark-mode .lb-count { color: #bbbbbb; }
body.dark-mode .export-menu button:hover { background: #2a2a2a; color: #8ab4f8; }

body.dark-mode .counter-card:hover {
  border-color: var(--teal);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6); 
  transform: translateY(-2px);
}

body.dark-mode nav.mainnav {
  background-color: #1A363B; 
  border-bottom: 1px solid #2a4a50; 
}
body.dark-mode .nav-dropdown-menu {
  background-color: #122629; 
}
body.dark-mode .nav-dropdown-menu a:hover {
  background-color: rgba(255, 255, 255, 0.08);
}
body.dark-mode nav.mainnav a.active {
  border-bottom-color: #81c995; 
}

body.dark-mode .btn-toc,
body.dark-mode .toggle-all button,
body.dark-mode .toc-controls button {
  background-color: #1A363B;
  color: #ffffff;
  border: 1px solid #2a4a50; 
}
body.dark-mode .btn-toc:hover,
body.dark-mode .toggle-all button:hover,
body.dark-mode .toc-controls button:hover {
  background-color: #22484f; 
  border-color: #35636b;
}
body.dark-mode .toc-controls button:last-child {
  background-color: #1c456b; 
  border-color: #2a5a8a;
}
body.dark-mode .toc-controls button:last-child:hover {
  background-color: #245888;
}

body.dark-mode .copyright {
  background-color: #1A363B; 
  border-top: 1px solid #2a4a50; 
  color: #e0e0e0;
}
body.dark-mode footer {
  background-color: #121212; 
}

/* --- Tombol Back to Top (Dark Mode) --- */
body.dark-mode .back-top {
  background-color: #1A363B;
  border: 1px solid #2a4a50;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

body.dark-mode .back-top:hover {
  background-color: #81c995; 
  border-color: #81c995;
  color: #121212; 
}

/* ==========================================================
   NEUMORPHIC 3D DARK MODE TOGGLE SWITCH
   ========================================================== */
.theme-switch-neumorphic {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
}

.theme-switch-neumorphic input {
  display: none;
}

/* Rel Cekung (Track) */
.theme-switch-neumorphic .track {
  position: relative;
  width: 70px;
  height: 34px;
  background: #e6e9ee; 
  border-radius: 40px;
  box-shadow: inset 4px 4px 6px rgba(166, 180, 200, 0.6), 
              inset -4px -4px 6px rgba(255, 255, 255, 0.9);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.theme-switch-neumorphic .icon-bg {
  color: #aeb6c1; 
  transition: color 0.4s ease;
  z-index: 1;
  display: flex;
  align-items: center;
}

.theme-switch-neumorphic .thumb {
  position: absolute;
  top: -3px;  
  left: -2px; 
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 3px 4px 8px rgba(0, 0, 0, 0.15), 
              -2px -2px 6px rgba(255, 255, 255, 0.9);
  transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.theme-switch-neumorphic .icon-fg {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.theme-switch-neumorphic .icon-fg.sun {
  opacity: 1;
  transform: rotate(0deg);
}
.theme-switch-neumorphic .icon-fg.moon {
  opacity: 0;
  transform: rotate(-45deg);
}

input:checked + .track {
  background: #5d6780; 
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.3), 
              inset -3px -3px 6px rgba(130, 140, 170, 0.1);
}

input:checked + .track .thumb {
  transform: translateX(34px);
  background: #f8f9fa; 
  box-shadow: -2px 4px 8px rgba(0, 0, 0, 0.2), 
              2px -2px 6px rgba(255, 255, 255, 0.1);
}

input:checked + .track .icon-fg.sun {
  opacity: 0;
  transform: rotate(45deg);
}
input:checked + .track .icon-fg.moon {
  opacity: 1;
  transform: rotate(0deg);
}

/* ==========================================================
   CUSTOM SEARCHABLE DROPDOWN
   ========================================================== */
.custom-select-wrapper {
  position: relative;
  user-select: none;
  flex: 1;
  min-width: 200px;
}
.custom-select-trigger {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text);
}
.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--blue-link);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  margin-top: 4px;
  display: none;
  flex-direction: column;
}
.custom-select-wrapper.open .custom-select-dropdown {
  display: flex;
}
.custom-select-search {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.custom-select-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  outline: none;
}
.custom-select-search input:focus {
  border-color: var(--blue-link);
}
.custom-select-options {
  max-height: 250px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}
.custom-select-options li {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  color: #333;
}
/* Warna highlight ala gambar Anda */
.custom-select-options li:hover, 
.custom-select-options li.focused {
  background: #3b82f6; /* Warna biru seleksi */
  color: #fff;
}
.custom-select-options li.hidden {
  display: none;
}

/* Penyesuaian khusus Dark Mode */
body.dark-mode .custom-select-trigger {
  background: #1e1e1e; border-color: #333; color: #e0e0e0;
}
body.dark-mode .custom-select-dropdown {
  background: #1e1e1e; border-color: #2a5a8a;
}
body.dark-mode .custom-select-search { border-color: #333; }
body.dark-mode .custom-select-search input {
  background: #2a2a2a; border-color: #444; color: #e0e0e0;
}
body.dark-mode .custom-select-search input:focus { border-color: #8ab4f8; }
body.dark-mode .custom-select-options li { color: #e0e0e0; }
body.dark-mode .custom-select-options li:hover, 
body.dark-mode .custom-select-options li.focused {
  background: #245888; color: #fff;
}

/* ==========================================================
   KUSTOMISASI SCROLLBAR (TAMPILAN ELEGAN & MODERN)
   ========================================================== */
/* Memodifikasi scrollbar khusus untuk daftar dropdown */
.custom-select-options {
  scrollbar-width: thin; /* Untuk Firefox */
  scrollbar-color: #c1c1c1 transparent;
}

/* Lebar scrollbar */
.custom-select-options::-webkit-scrollbar {
  width: 6px;
}

/* Latar belakang jalur (track) scrollbar */
.custom-select-options::-webkit-scrollbar-track {
  background: transparent;
}

/* Warna pelatuk (thumb) scrollbar di Light Mode */
.custom-select-options::-webkit-scrollbar-thumb {
  background-color: #c1c1c1;
  border-radius: 10px;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
  background-color: #a8a8a8;
}

/* --- PENYESUAIAN SCROLLBAR DI DARK MODE --- */
body.dark-mode .custom-select-options {
  scrollbar-color: #4a4a4a transparent; /* Untuk Firefox */
}

/* Warna pelatuk (thumb) scrollbar di Dark Mode */
body.dark-mode .custom-select-options::-webkit-scrollbar-thumb {
  background-color: #4a4a4a; /* Abu-abu gelap agar menyatu */
}

/* Warna pelatuk saat di-hover di Dark Mode */
body.dark-mode .custom-select-options::-webkit-scrollbar-thumb:hover {
  background-color: #666666; /* Sedikit lebih terang saat disentuh mouse */
}