@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
body { font-family: 'Inter', sans-serif; background-color: #F8FAFC; color: #334155; overflow-x: hidden; }

.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sidebar {
  position: fixed; top: 0; left: -100%; width: 260px; height: 100vh;
  background-color: #1E293B; color: white; transition: left 0.3s ease;
  z-index: 1000; overflow-y: auto;
}
.sidebar.open { left: 0; }

.sidebar-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 999; display: none;
}
.sidebar-overlay.open { display: block; }

.main-content { width: 100%; transition: margin-left 0.3s ease; }
.admin-page { display: none; }
.admin-page.active { display: block; }

.nav-link { display: flex; align-items: center; padding: 12px 20px; color: #94A3B8; transition: all 0.2s; cursor: pointer; }
.nav-link:hover, .nav-link.active { background-color: #334155; color: #F97316; border-left: 4px solid #F97316; }
.nav-link i { width: 25px; }

.sub-nav-link {
  display: block;
  padding: 10px 20px 10px 52px;
  color: #94A3B8;
  font-size: 13.5px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.sub-nav-link:hover {
  color: #F1F5F9;
  background-color: rgba(51, 65, 85, 0.4);
}
.sub-nav-link.active {
  color: #F97316 !important;
  background-color: #293548 !important;
  font-weight: 600;
}

@media (min-width: 1024px) {
  .sidebar { left: 0; }
  .main-content { margin-left: 260px; width: calc(100% - 260px); }
  .sidebar-overlay { display: none !important; }
  #btn-hamburger { display: none; }
}

@media (max-width: 767px) {
  .mobile-card-table thead { display: none; }
  .mobile-card-table tr { display: flex; flex-direction: column; background: white; margin-bottom: 15px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 10px; border: 1px solid #E2E8F0; }
  .mobile-card-table td { display: flex; justify-content: space-between; align-items: center; padding: 8px 5px; border-bottom: 1px solid #F1F5F9; }
  .mobile-card-table td:last-child { border-bottom: none; }
  .mobile-card-table td::before { content: attr(data-label); font-weight: 600; color: #64748B; margin-right: 15px; }
  .mobile-card-table td > div { text-align: right; }

  /* ========================================================
     BEAUTIFIED ALTERNATING CARDS: MANAJEMEN AKUN (MOBILE/HP)
     ======================================================== */
  #table-accounts.mobile-card-table {
    display: block;
    width: 100%;
  }

  #table-accounts.mobile-card-table tbody {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0;
  }

  #table-accounts.mobile-card-table tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
    border-radius: 16px !important;
    padding: 14px 14px 12px 14px !important;
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.08) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
  }

  /* Kartu Ganjil: Putih Bersih dengan aksen Biru Modern */
  #table-accounts.mobile-card-table tr.card-zebra-odd,
  #table-accounts.mobile-card-table tbody tr:nth-child(odd) {
    background: #FFFFFF !important;
    border: 1.5px solid #E2E8F0 !important;
    border-left: 6px solid #3B82F6 !important;
  }

  /* Kartu Genap: Soft Slate Tint dengan aksen Oranye Nyewa */
  #table-accounts.mobile-card-table tr.card-zebra-even,
  #table-accounts.mobile-card-table tbody tr:nth-child(even) {
    background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%) !important;
    border: 1.5px solid #CBD5E1 !important;
    border-left: 6px solid #F97316 !important;
  }

  #table-accounts.mobile-card-table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 4px !important;
    border-bottom: 1px dashed rgba(203, 213, 225, 0.75) !important;
  }

  #table-accounts.mobile-card-table td:first-child {
    padding-top: 2px !important;
    padding-bottom: 12px !important;
  }

  #table-accounts.mobile-card-table td:last-child {
    border-bottom: none !important;
    padding-top: 14px !important;
    padding-bottom: 4px !important;
    margin-top: 6px !important;
    border-top: 1px solid rgba(226, 232, 240, 0.9) !important;
  }

  #table-accounts.mobile-card-table td::before {
    content: attr(data-label);
    font-weight: 700 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #64748B !important;
    margin-right: 12px !important;
    min-width: 90px !important;
    text-align: left !important;
    flex-shrink: 0 !important;
  }

  #table-accounts.mobile-card-table td > div {
    text-align: right;
  }

  /* Dark mode support for alternating cards */
  html.dark #table-accounts.mobile-card-table tr.card-zebra-odd,
  html.dark #table-accounts.mobile-card-table tbody tr:nth-child(odd) {
    background: #1E293B !important;
    border: 1.5px solid #334155 !important;
    border-left: 6px solid #60A5FA !important;
  }

  html.dark #table-accounts.mobile-card-table tr.card-zebra-even,
  html.dark #table-accounts.mobile-card-table tbody tr:nth-child(even) {
    background: #0F172A !important;
    border: 1.5px solid #334155 !important;
    border-left: 6px solid #FB923C !important;
  }

  html.dark #table-accounts.mobile-card-table td {
    border-bottom-color: rgba(51, 65, 85, 0.7) !important;
  }

  html.dark #table-accounts.mobile-card-table td:last-child {
    border-top-color: rgba(51, 65, 85, 0.9) !important;
  }

  html.dark #table-accounts.mobile-card-table td::before {
    color: #94A3B8 !important;
  }
}

.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: #F1F5F9; border: 1px solid #E2E8F0; border-bottom: none; border-radius: 6px 6px 0 0; }
.editor-toolbar button { padding: 4px 8px; background: white; border: 1px solid #CBD5E1; border-radius: 4px; color: #475569; font-size: 14px; cursor: pointer; transition: all 0.2s; min-width: 32px; display: flex; justify-content: center; align-items: center; }
.editor-toolbar button:hover { background: #E2E8F0; color: #0F172A; border-color: #94A3B8; }
.editor-content { min-height: 200px; padding: 12px; border: 1px solid #E2E8F0; border-radius: 0 0 6px 6px; outline: none; background: white; overflow-y: auto; max-height: 400px; }

.prose-content p { margin-bottom: 1rem; line-height: 1.6; }
.prose-content ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose-content ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose-content b, .prose-content strong { font-weight: 700; color: #1E293B; }
.prose-content i, .prose-content em { font-style: italic; }

.pulse-orange { animation: pulseOrange 2s infinite; }
@keyframes pulseOrange { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

.fomo-toast {
    position: fixed; bottom: 90px; left: 20px; background: white; border-left: 4px solid #10B981;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 12px 16px; border-radius: 8px; z-index: 50; display: flex; align-items: center; gap: 12px;
    transform: translateX(-150%); transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); max-width: 330px;
}
.fomo-toast.show { transform: translateX(0); }
@media (max-width: 640px) { .fomo-toast { bottom: 90px; left: 20px; right: 20px; max-width: none; } }

@media print {
  body { background-color: white; color: black; }
  .sidebar, .sidebar-overlay, header, #btn-hamburger, .print-hide { display: none !important; }
  .main-content { margin-left: 0 !important; width: 100% !important; }
  .admin-page { display: none; }
  #page-finance { display: block !important; }
  .bg-white { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  canvas { max-width: 100% !important; height: auto !important; }
}

/* Ensure SweetAlert2 always renders above all modals and overlays */
.swal2-container {
  z-index: 99999 !important;
}

/* ========================================================
   LIGHT / DARK THEME SYSTEM
   ======================================================== */
html.dark {
  color-scheme: dark;
}

html.dark body {
  background-color: #0b1120;
  color: #cbd5e1;
}

html.dark header {
  background-color: #0f172a !important;
  border-bottom: 1px solid #1e293b !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5) !important;
}

html.dark #btn-theme-toggle {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #fbbf24 !important;
}
html.dark #btn-theme-toggle:hover {
  background-color: #334155 !important;
}

html.dark #auth-loading {
  background-color: #0b1120 !important;
}
html.dark #auth-loading p {
  color: #94a3b8 !important;
}

html.dark .text-slate-800,
html.dark .text-slate-900 {
  color: #f1f5f9 !important;
}

html.dark .text-slate-700 {
  color: #e2e8f0 !important;
}

html.dark .text-slate-600 {
  color: #cbd5e1 !important;
}

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

/* Cards & Containers in Public View */
html.dark #public-catalog > div {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}
html.dark #public-catalog > div:hover {
  border-color: rgba(249, 115, 22, 0.5) !important;
}

html.dark #public-cloud-section > div > div {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html.dark #public-reviews-section > div {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html.dark #public-reviews-section .border-slate-100 {
  border-color: #1e293b !important;
}

html.dark #reviews-carousel > div {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
html.dark #reviews-carousel > div:hover {
  border-color: #f97316 !important;
}

html.dark #public-faq-section > div {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html.dark .faq-item {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html.dark .faq-item button {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}
html.dark .faq-item button:hover {
  background-color: #1e293b !important;
}

html.dark .faq-answer {
  background-color: #0b1120 !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

html.dark footer {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

/* Modals & Inputs in Dark Mode */
html.dark [id^="modal-"] > div {
  background-color: #0f172a !important;
  border: 1px solid #1e293b;
  color: #f1f5f9 !important;
}

html.dark [id^="modal-"] .border-b,
html.dark [id^="modal-"] .border-t {
  border-color: #1e293b !important;
}

html.dark [id^="modal-"] input,
html.dark [id^="modal-"] select,
html.dark [id^="modal-"] textarea {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html.dark [id^="modal-"] input:focus,
html.dark [id^="modal-"] select:focus,
html.dark [id^="modal-"] textarea:focus {
  background-color: #0f172a !important;
  border-color: #f97316 !important;
}

html.dark [id^="modal-"] input::placeholder,
html.dark [id^="modal-"] textarea::placeholder {
  color: #64748b !important;
}

html.dark .fomo-toast {
  background-color: #0f172a !important;
  color: #cbd5e1 !important;
  border-left-color: #10b981 !important;
  border-top: 1px solid #1e293b;
  border-right: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
}
html.dark .fomo-toast #fomo-text b {
  color: #f8fafc !important;
}

/* SweetAlert2 Dark Mode Overrides */
html.dark .swal2-popup {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border: 1px solid #1e293b !important;
}
html.dark .swal2-title {
  color: #f8fafc !important;
}
html.dark .swal2-html-container {
  color: #cbd5e1 !important;
}

/* Refinements for public components in Dark Mode */
html.dark header button[onclick="openCheckOrderModal()"] {
  background-color: rgba(249, 115, 22, 0.15) !important;
  border-color: rgba(249, 115, 22, 0.3) !important;
  color: #fb923c !important;
}
html.dark header button[onclick="openCheckOrderModal()"]:hover {
  background-color: rgba(249, 115, 22, 0.25) !important;
}

html.dark #public-announcement-box {
  background-color: rgba(249, 115, 22, 0.1) !important;
  border-color: rgba(249, 115, 22, 0.3) !important;
  color: #fdba74 !important;
}

html.dark #public-catalog .bg-slate-100 {
  background-color: #1e293b !important;
}
html.dark #public-catalog .border-slate-100 {
  border-color: #1e293b !important;
}
html.dark #public-catalog button.bg-slate-800 {
  background-color: #334155 !important;
  color: #f8fafc !important;
}
html.dark #public-catalog button.bg-slate-800:hover {
  background-color: #475569 !important;
}

html.dark #public-cloud-list > div {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}
html.dark #public-cloud-list .bg-orange-50 {
  background-color: rgba(249, 115, 22, 0.15) !important;
}
html.dark #public-cloud-list button {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
}
html.dark #public-cloud-list button:hover {
  background-color: rgba(16, 185, 129, 0.25) !important;
}

html.dark #reviews-carousel .bg-white {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html.dark #reviews-carousel .bg-slate-50 {
  background-color: #1e293b !important;
}

html.dark [id^="modal-"] .bg-slate-50 {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
html.dark [id^="modal-"] .bg-white {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}
html.dark [id^="modal-"] hr {
  border-color: #334155 !important;
}
