/* ==========================================================================
   BANK INDONESIA - COMMON / BASE STYLESHEET (common.css)
   Single Source of Truth untuk Desain, Warna, Komponen Global, & Dark Mode
   ========================================================================== */

/* 1. Desain Tokens & Variabel CSS (Palet Resmi Bank Indonesia) */
:root {
  --bi-navy-primary: #002855;
  --bi-navy-dark: #001f3f;
  --bi-navy-light: #003e7e;
  --bi-gold-primary: #c59b27;
  --bi-gold-light: #e5c058;
  --bi-gold-hover: #b38918;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #fdfdfd;
  --bg-secondary: #f1f5f9;

  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #002855;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 40, 85, 0.1), 0 4px 6px -4px rgba(0, 40, 85, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --scrollbar-thumb: var(--bi-navy-primary);
  --scrollbar-thumb-hover: var(--bi-gold-primary);

  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-speed: 0.25s;
}

/* 2. Reset & Dasar */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  overscroll-behavior-y: none;
  /* Latar gambar (terang) menempel di jendela; warna halaman sebagai cadangan. */
  background: var(--bg-page) url('../img/background/light-bg.jpg') center / cover no-repeat fixed;
}

html.dark-theme {
  background-image: url('../img/background/dark-bg.jpg');
}

body {
  font-family: var(--font-family);
  background-color: transparent;
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* 2b. Scrollbar Kustom (mengikuti palet resmi BI, berlaku di seluruh
   halaman termasuk area scroll internal seperti tabel & panel dropdown) */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--bg-secondary);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-secondary);
  transition: background-color var(--transition-speed);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

::-webkit-scrollbar-corner {
  background: var(--bg-secondary);
}

/* ==========================================================================
   3. BILAH NAVIGASI GLOBAL (NAVBAR)
   ========================================================================== */
.navbar {
  background: linear-gradient(135deg, var(--bi-navy-dark) 0%, var(--bi-navy-primary) 100%);
  padding: 0.85rem clamp(1rem, 3vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.nav-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left .logo-img {
  height: clamp(34px, 4vw, 46px);
  width: auto;
  max-width: 220px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.nav-right {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-links-desktop {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link {
  color: #f1f5f9;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-speed);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--bi-gold-light);
}

.nav-link.active {
  background-color: rgba(197, 155, 39, 0.2);
  color: var(--bi-gold-light);
  border: 1px solid rgba(197, 155, 39, 0.4);
}

/* Dropdown "Kelola" di navbar (khusus admin): menggabungkan Kelola Member &
   Kelola KPwDN jadi satu item. Halaman yang sedang dibuka tampil sebagai tag
   kecil di sebelah label, seperti nilai terpilih pada sebuah select. */
.nav-dropdown {
  position: relative;
  display: inline-flex;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid transparent;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}

.nav-dropdown-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--bi-navy-dark);
  background: var(--bi-gold-primary);
}

.nav-dropdown-tag[hidden] {
  display: none;
}

.nav-dropdown-chevron {
  flex-shrink: 0;
  margin-left: auto;
  transition: transform var(--transition-speed);
}

.nav-dropdown.open .nav-dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 0.4rem;
  flex-direction: column;
  gap: 0.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  transition: all var(--transition-speed);
}

.nav-dropdown-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-dropdown-item:hover {
  background-color: var(--bg-secondary);
  color: var(--bi-navy-primary);
}

.nav-dropdown-item.selected {
  background-color: rgba(0, 40, 85, 0.08);
  color: var(--bi-navy-primary);
}

.nav-dropdown-item.selected svg {
  color: var(--bi-navy-primary);
}

/* Titik emas penanda item yang sedang dipilih */
.nav-dropdown-item.selected::after {
  content: '';
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bi-gold-primary);
}

.btn-nav-action {
  background-color: var(--bi-gold-primary);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1.25rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-nav-action:hover {
  background-color: var(--bi-gold-hover);
  transform: translateY(-1px);
}

.nav-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.mobile-menu-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bi-navy-dark);
  border-bottom: 2px solid var(--bi-gold-primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  padding: 1.25rem 1.5rem;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 999;
}

.mobile-menu-drawer.active {
  display: flex;
}

.mobile-menu-drawer .nav-link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  width: 100%;
}

.mobile-menu-drawer .btn-nav-action {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

/* Di drawer mobile dropdown "Kelola" berbentuk accordion (menu tampil inline,
   bukan melayang) supaya tidak terpotong dan mudah disentuh. */
.mobile-menu-drawer .nav-dropdown {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.mobile-menu-drawer .nav-dropdown-toggle {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
}

.mobile-menu-drawer .nav-dropdown-menu {
  position: static;
  min-width: 0;
  padding: 0.35rem 0 0 0.75rem;
  background: transparent;
  border: none;
  box-shadow: none;
  animation: none;
}

.mobile-menu-drawer .nav-dropdown-item {
  color: #f1f5f9;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
}

.mobile-menu-drawer .nav-dropdown-item svg {
  color: #cbd5e1;
}

.mobile-menu-drawer .nav-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--bi-gold-light);
}

.mobile-menu-drawer .nav-dropdown-item.selected {
  background-color: rgba(197, 155, 39, 0.2);
  color: var(--bi-gold-light);
}

.mobile-menu-drawer .nav-dropdown-item.selected svg {
  color: var(--bi-gold-light);
}

/* ==========================================================================
   4. TOMBOL TOGGLE TEMA (DARK / LIGHT)
   ========================================================================== */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.45rem 0.75rem;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all var(--transition-speed);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--bi-gold-primary);
  color: var(--bi-gold-light);
  transform: translateY(-1px);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.navbar-theme-btn {
  padding: 0.45rem 0.65rem;
}

.mobile-theme-btn {
  width: 100%;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 0.25rem;
  background: rgba(255, 255, 255, 0.08);
}

/* Toggle tema khusus login */
.login-top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  width: 100%;
}

.login-top-bar .theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 0.45rem 0.9rem;
  box-shadow: var(--shadow-sm);
}

.login-top-bar .theme-toggle-btn:hover {
  background-color: var(--border-color);
}

/* ==========================================================================
   5. MENU PROFIL DROPDOWN ALA GOOGLE
   ========================================================================== */
.user-profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-avatar-btn {
  background: transparent;
  border: 2px solid rgba(197, 155, 39, 0.6);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
  position: relative;
}

.user-avatar-btn:hover,
.user-avatar-btn[aria-expanded="true"] {
  border-color: var(--bi-gold-light);
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.3);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-dropdown-card {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem 1.25rem 1rem;
  z-index: 1100;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-card.active {
  display: flex;
}

.user-dropdown-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.user-dropdown-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 0.75rem;
}

.dropdown-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bi-gold-primary);
}

.user-display-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.3;
  word-break: break-word;
}

.user-display-email {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  margin-bottom: 0.65rem;
  word-break: break-all;
}

.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  margin-bottom: 0.25rem;
}

.user-dropdown-divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
  margin: 1rem 0 0.65rem;
}

.user-dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  transition: all var(--transition-speed);
}

.user-dropdown-item:hover {
  background-color: var(--bg-secondary);
  color: var(--bi-navy-primary);
}

.user-dropdown-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-speed);
}

.user-dropdown-item:hover svg {
  color: var(--bi-navy-primary);
}

.user-dropdown-item.logout-item {
  color: #ef4444;
}

.user-dropdown-item.logout-item:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.user-dropdown-item.logout-item svg {
  color: #ef4444;
}

.mobile-user-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-user-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--bi-gold-primary);
  object-fit: cover;
  flex-shrink: 0;
}

.mobile-user-card-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.mobile-user-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-user-card-email {
  font-size: 0.75rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   6. ELEMEN FORM & INPUT UMUM
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-speed);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-dark);
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed), background-color var(--transition-speed);
}

.form-control:hover {
  border-color: #cbd5e1;
}

.form-control:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 40, 85, 0.12);
}

.input-wrapper:focus-within .input-icon {
  color: var(--bi-navy-primary);
}

/* ==========================================================================
   7. MODAL & ALERT BANNER UMUM
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bi-navy-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed);
}

.btn-close-modal:hover {
  color: var(--text-dark);
}

.alert-box {
  display: none;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  align-items: center;
  gap: 0.6rem;
  animation: slideDown 0.3s ease-out;
}

.alert-box.show {
  display: flex;
}

.alert-success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ==========================================================================
   8. FOOTER GLOBAL
   ========================================================================== */
.footer {
  background-color: var(--bi-navy-dark);
  color: var(--text-light);
  margin-top: auto;
  width: 100%;
  position: relative;
}

.footer-top {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-logo img {
  height: clamp(32px, 3.5vw, 42px);
  width: auto;
  opacity: 0.95;
  display: block;
}

.btn-help {
  background-color: transparent;
  color: var(--bi-gold-light);
  border: 1.5px solid var(--bi-gold-light);
  padding: 0.6rem 1.4rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-help:hover {
  background-color: var(--bi-gold-light);
  color: var(--bi-navy-dark);
}

.footer-bottom {
  text-align: center;
  padding: 1.1rem 1rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  background-color: #001830;
  position: relative;
  /* Perpanjangan warna ke bawah agar saat overscroll bounce di bawah halaman,
     tidak muncul celah putih kosong yang merusak estetika */
  box-shadow: 0 50vh 0 50vh #001830;
  clip-path: inset(0 -100vw -100vh -100vw);
}

/* ==========================================================================
   9. ATURAN DARK MODE GLOBAL (SHARED)
   ========================================================================== */
html.dark-theme {
  --bg-page: #0b1329;
  --bg-card: #131f3b;
  --bg-input: #1a294d;
  --bg-secondary: #0e182f;

  --text-dark: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #ffffff;

  --border-color: #1e3056;
  --border-focus: var(--bi-gold-light);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6);

  /* Navy tenggelam di latar gelap, jadi thumb scrollbar dipakaikan gold
     supaya tetap kontras -- selaras dengan aksen lain yang berganti ke
     gold di dark mode (tombol, border fokus, dst). */
  --scrollbar-thumb: var(--bi-gold-primary);
  --scrollbar-thumb-hover: var(--bi-gold-hover);
}

html.dark-theme body {
  background-color: transparent;
  color: var(--text-body);
}

html.dark-theme .navbar {
  background: linear-gradient(135deg, #070e1e 0%, #0d1a38 100%);
  border-bottom: 1px solid var(--border-color);
}

html.dark-theme .mobile-menu-drawer {
  background: #0d1a38;
  border-bottom-color: var(--bi-gold-primary);
}

html.dark-theme .user-dropdown-card {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

html.dark-theme .dropdown-avatar-img {
  background: #1a294d;
  border-color: #1e3056;
}

html.dark-theme .user-display-name {
  color: #f8fafc;
}

html.dark-theme .user-display-email {
  color: #94a3b8;
}

html.dark-theme .user-dropdown-item {
  color: #cbd5e1;
}

html.dark-theme .user-dropdown-item:hover {
  background-color: #1a294d;
  color: #38bdf8;
}

html.dark-theme .user-dropdown-item:hover svg {
  color: #38bdf8;
}

html.dark-theme .nav-dropdown-menu {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

html.dark-theme .nav-dropdown-item:hover {
  background-color: #1a294d;
  color: var(--bi-gold-light);
}

html.dark-theme .nav-dropdown-item.selected {
  background-color: rgba(197, 155, 39, 0.16);
  color: var(--bi-gold-light);
}

html.dark-theme .nav-dropdown-item.selected svg {
  color: var(--bi-gold-light);
}

/* Drawer mobile tetap memakai warna terang di atas latar navy, baik light maupun dark */
html.dark-theme .mobile-menu-drawer .nav-dropdown-item {
  color: #f1f5f9;
}

html.dark-theme .mobile-menu-drawer .nav-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

html.dark-theme .mobile-menu-drawer .nav-dropdown-item.selected {
  background-color: rgba(197, 155, 39, 0.2);
}

html.dark-theme .user-dropdown-item.logout-item {
  color: #fca5a5;
}

html.dark-theme .user-dropdown-item.logout-item:hover {
  background-color: #3b1212;
  color: #f87171;
}

html.dark-theme .user-dropdown-item.logout-item svg {
  color: #fca5a5;
}

html.dark-theme .form-control {
  background-color: var(--bg-input);
  border-color: var(--border-color);
  color: #f8fafc;
}

html.dark-theme .form-control:focus {
  background-color: #1f315c;
  border-color: var(--bi-gold-light);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.25);
}

html.dark-theme .form-control::placeholder {
  color: #64748b;
}

html.dark-theme .modal-dialog {
  background: var(--bg-card);
  border-color: var(--border-color);
}

html.dark-theme .modal-title {
  color: #38bdf8;
}

html.dark-theme .btn-close-modal {
  color: var(--text-muted);
}

html.dark-theme .btn-close-modal:hover {
  color: var(--text-dark);
}

html.dark-theme .alert-error {
  background-color: #3b1212;
  color: #fca5a5;
  border-color: #7f1d1d;
}

html.dark-theme .alert-success {
  background-color: #0f291e;
  color: #86efac;
  border-color: #14532d;
}

html.dark-theme .footer {
  background-color: #070e1e;
}

html.dark-theme .footer-bottom {
  background-color: #040811;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 50vh 0 50vh #040811;
}

/* ==========================================================================
   10. ANIMASI UMUM
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   11. RESPONSIF UMUM (NAVBAR & FOOTER)
   ========================================================================== */
@media screen and (max-width: 768px) {
  .nav-links-desktop {
    display: none;
  }

  .nav-toggle-btn {
    display: inline-flex;
  }

  .footer-top {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .btn-help {
    width: 100%;
    max-width: 280px;
  }
}

/* ==========================================================================
   JENDELA "HUBUNGI KAMI"
   ========================================================================== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 20, 45, 0.55);
  backdrop-filter: blur(3px);
}

.contact-modal.active {
  display: flex;
}

body.contact-modal-open {
  overflow: hidden;
}

.contact-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.75rem 1.5rem;
  background: var(--bg-card);
  color: var(--text-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 20, 45, 0.35);
  animation: contactModalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes contactModalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.contact-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.contact-modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-dark);
}

.contact-modal-title {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--bi-navy-primary);
}

.contact-modal-desc {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.contact-option {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--text-dark);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
}

.contact-option:hover,
.contact-option:focus-visible {
  outline: none;
  border-color: var(--bi-navy-primary);
  box-shadow: 0 6px 16px rgba(0, 40, 85, 0.12);
  transform: translateY(-1px);
}

.contact-option-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #ffffff;
  border-radius: 12px;
}

.contact-option--email .contact-option-icon {
  background: var(--bi-navy-primary);
}

.contact-option--wa .contact-option-icon {
  background: #1f9d55;
}

.contact-option-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-option-text strong {
  font-size: 0.9375rem;
}

.contact-option-text small {
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-modal-note {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-muted);
}

html.dark-theme .contact-modal-title {
  color: var(--bi-gold-light);
}

html.dark-theme .contact-option:hover,
html.dark-theme .contact-option:focus-visible {
  border-color: var(--bi-gold-light);
}

html.dark-theme .contact-option--email .contact-option-icon {
  background: var(--bi-gold-light);
  color: var(--bi-navy-dark);
}

/* ==========================================================================
   TAB KATEGORI & JUDUL HALAMAN -- tampilan SERAGAM di semua halaman
   (Dashboard, Data UMKM, Realisasi) pada tema terang maupun gelap. Selektor
   sengaja lebih spesifik daripada CSS tiap halaman agar tidak ditimpa.
   ========================================================================== */
html.dark-theme body .dashboard-header h1 {
  color: #38bdf8;
}

html.dark-theme body .dashboard-header p {
  color: #94a3b8;
}

html.dark-theme body :is(.dashboard-tab, .umkm-tab, .target-category-tab) {
  background: #0e182f;
  border-color: #26385f;
  color: #cbd5e1;
}

html.dark-theme body :is(.dashboard-tab, .umkm-tab, .target-category-tab):hover {
  background: #16254a;
  border-color: #38bdf8;
  color: #7dd3fc;
}

html.dark-theme body :is(.dashboard-tab, .umkm-tab, .target-category-tab).active,
html.dark-theme body :is(.dashboard-tab, .umkm-tab, .target-category-tab).active:hover {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #0b1329;
}
