:root {
  --emerald-primary: #047857;
  --emerald-dark: #064E3B;
  --gold-accent: #D97706;
  --surface-bg: #F8FAFC;
}

html, body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--surface-bg);
  color: #0F172A;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.islamic-pattern {
  background-color: #047857;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(217, 119, 6, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.30) 0%, transparent 50%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 18px
    );
}

.bottom-nav-safe {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

/* ============================================================================
   MODE GELAP (DARK MODE) — STANDAR KETERBACAAN & KONTRAS TINGGI
   ============================================================================ */
html.dark {
  color-scheme: dark;
}

html.dark,
html.dark body {
  background-color: #0B1120 !important;
  color: #F1F5F9 !important;
}

/* Header, Sidebar, Bottom Nav, Cards, Drawer & Modal */
html.dark header,
html.dark aside,
html.dark nav.fixed,
html.dark .bg-white,
html.dark .bg-white\/95 {
  background-color: #1E293B !important;
  color: #F1F5F9 !important;
}

html.dark .bg-slate-50,
html.dark .bg-slate-50\/60,
html.dark .bg-slate-50\/70,
html.dark .bg-slate-100 {
  background-color: #0F172A !important;
}

html.dark .bg-emerald-50,
html.dark .bg-emerald-50\/40,
html.dark .bg-emerald-50\/60,
html.dark .bg-emerald-50\/70 {
  background-color: rgba(6, 78, 59, 0.42) !important;
}

html.dark .bg-emerald-100 {
  background-color: rgba(5, 150, 105, 0.28) !important;
}

html.dark .bg-teal-50 {
  background-color: rgba(17, 94, 89, 0.35) !important;
}

html.dark .bg-amber-50,
html.dark .bg-amber-50\/40,
html.dark .bg-amber-50\/50 {
  background-color: rgba(120, 53, 15, 0.34) !important;
}

html.dark .bg-amber-100,
html.dark .bg-amber-200 {
  background-color: rgba(180, 83, 9, 0.38) !important;
}

html.dark .bg-sky-50,
html.dark .bg-sky-100 {
  background-color: rgba(12, 74, 110, 0.45) !important;
}

html.dark .bg-rose-50,
html.dark .bg-rose-100 {
  background-color: rgba(136, 19, 55, 0.42) !important;
}

html.dark .bg-red-50,
html.dark .bg-red-100 {
  background-color: rgba(127, 29, 29, 0.42) !important;
}

/* Borders & Dividers */
html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-200\/70,
html.dark .border-slate-200\/80,
html.dark .border-slate-300 {
  border-color: #334155 !important;
}

html.dark .border-emerald-100,
html.dark .border-emerald-200,
html.dark .border-emerald-300 {
  border-color: rgba(16, 185, 129, 0.38) !important;
}

html.dark .border-amber-200,
html.dark .border-amber-200\/80,
html.dark .border-amber-300 {
  border-color: rgba(245, 158, 11, 0.42) !important;
}

html.dark .border-teal-200 {
  border-color: rgba(20, 184, 166, 0.38) !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #334155 !important;
}

/* Typography Kontras Tinggi */
html.dark .text-slate-900,
html.dark .text-slate-800 {
  color: #F8FAFC !important;
}

html.dark .text-slate-700,
html.dark .text-slate-600 {
  color: #CBD5E1 !important;
}

html.dark .text-slate-500,
html.dark .text-slate-400 {
  color: #94A3B8 !important;
}

html.dark .text-emerald-950,
html.dark .text-emerald-900,
html.dark .text-emerald-800,
html.dark .text-emerald-700 {
  color: #6EE7B7 !important;
}

html.dark .text-teal-950,
html.dark .text-teal-800,
html.dark .text-teal-700 {
  color: #5EEAD4 !important;
}

html.dark .text-amber-950,
html.dark .text-amber-900,
html.dark .text-amber-800,
html.dark .text-amber-700,
html.dark .text-amber-600 {
  color: #FCD34D !important;
}

html.dark .text-sky-900,
html.dark .text-sky-800,
html.dark .text-sky-700 {
  color: #7DD3FC !important;
}

html.dark .text-rose-800,
html.dark .text-rose-700 {
  color: #FDA4AF !important;
}

html.dark .text-red-900,
html.dark .text-red-700,
html.dark .text-red-600 {
  color: #FCA5A5 !important;
}

/* Pertahankan teks gelap di tombol kuning/amber terang & teks putih di tombol emerald/gelap */
html.dark .bg-amber-500,
html.dark .bg-amber-400,
html.dark .bg-emerald-400 {
  color: #0F172A !important;
}

html.dark .bg-emerald-700,
html.dark .bg-emerald-800,
html.dark .bg-amber-600,
html.dark .bg-red-600,
html.dark .bg-slate-900,
html.dark .bg-slate-800 {
  color: #FFFFFF !important;
}

html.dark .islamic-pattern {
  background-color: #064E3B;
}

/* Form Inputs, Selects, Textareas & Placeholders */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.dark select,
html.dark textarea {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  border-color: #475569 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #94A3B8 !important;
  opacity: 1;
}

html.dark option {
  background-color: #0F172A;
  color: #F8FAFC;
}

/* Hover States di Dark Mode */
html.dark .hover\:bg-slate-50:hover,
html.dark .hover\:bg-slate-50\/70:hover,
html.dark .hover\:bg-slate-100:hover,
html.dark .hover\:bg-slate-200:hover {
  background-color: #334155 !important;
}

html.dark .hover\:bg-emerald-50:hover,
html.dark .hover\:bg-emerald-100:hover {
  background-color: rgba(16, 185, 129, 0.22) !important;
}

html.dark code {
  background-color: #0F172A;
  color: #FCD34D;
  padding: 0.1rem 0.35rem;
  border-radius: 0.375rem;
}
