/* =============================================================================
   THEME — Modern Skin (PROJECT-LEVEL, nol perubahan di vendor/)
   -----------------------------------------------------------------------------
   Arah desain : "Soft Modern" + disiplin Clean pada form
                 (tren 2025/2026 ala Linear / Vercel / app mobile modern)
   Brand       : Indigo  #411de1
   Font        : Inter
   Mekanisme   :
     1. Override TOKEN framework (--web-*, --pwa-*, --amsg-*) untuk warna,
        shadow, font. Token = single source of truth → semua widget ikut.
        Pakai !important karena CSS komponen framework di-inject Renderer
        SETELAH <head> styles (lihat WebBuilder.php:856 vs :890), jadi tanpa
        !important deklarasi :root framework akan menimpa kita.
     2. Override UTILITAS Tailwind (rounded-*, shadow-*) yang dipakai mayoritas
        widget — di-scope ke `.web-body` (specificity 0,2,0) sehingga MENANG
        atas utilitas Tailwind (0,1,0) TANPA perlu !important, sekaligus tidak
        bocor ke MDI/Form().
   Catatan: file ini di-serve via /share/ (app/Share/) → /share/css/theme-modern.css
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. BRAND PALETTE (indigo) + token framework
   -------------------------------------------------------------------------- */
:root {
  --brand-50:  #eef0ff;
  --brand-100: #e0e3ff;
  --brand-200: #c7ccff;
  --brand-500: #5a3af0;
  --brand-600: #411de1;   /* PRIMARY */
  --brand-700: #350fc0;   /* hover / pressed */
  --brand-on:  #ffffff;
  --brand-ring: rgba(65, 29, 225, .22);

  /* radius scale (dipakai override di bawah) */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 22px;

  /* ---- primary token (dipakai input, tombol, fokus) ---- */
  --pwa-primary:         var(--brand-600) !important;
  --pwa-primary-hover:   var(--brand-700) !important;
  --pwa-text-on-primary: var(--brand-on)  !important;

  /* ---- semantic accent (--web-*) ---- */
  --web-accent:        var(--brand-600) !important;
  --web-accent-hover:  var(--brand-700) !important;

  /* ---- legacy (--amsg-*) modal / alert / sis.* ---- */
  --amsg-z-index:       100000 !important;
  --amsg-primary-bg:    var(--brand-600) !important;
  --amsg-primary-hover: var(--brand-700) !important;
  --amsg-primary-text:  var(--brand-on)  !important;
  --amsg-input-focus:   var(--brand-600) !important;
  --amsg-font-family:   'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;

  /* ---- 2. SHADOW lembut berlapis (kunci kesan "tidak kaku") ---- */
  --web-shadow:    0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05) !important;
  --web-shadow-md: 0 4px 12px -2px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .06) !important;
}

/* Dark mode — accent lebih terang + shadow lebih pekat */
.dark {
  --pwa-primary:        #7e6bf2 !important;
  --pwa-primary-hover:  #6d57ef !important;
  --web-accent:         #8b78f5 !important;
  --web-accent-hover:   #7e6bf2 !important;
  --amsg-z-index:       100000 !important;
  --amsg-primary-bg:    #6d57ef !important;
  --amsg-primary-hover: #5b45e6 !important;
  --brand-ring: rgba(126, 107, 242, .30);

  --web-shadow:    0 1px 3px rgba(0, 0, 0, .45) !important;
  --web-shadow-md: 0 8px 24px -6px rgba(0, 0, 0, .55) !important;
}

/* -----------------------------------------------------------------------------
   3. TIPOGRAFI — Inter di seluruh subtree Web
   -------------------------------------------------------------------------- */
.web-body,
.web-body button,
.web-body input,
.web-body select,
.web-body textarea {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* sedikit lebih rapat → kesan modern; heading lebih tegas */
.web-body { letter-spacing: -0.011em; }
.web-body h1, .web-body h2, .web-body h3,
.web-body .web-text-strong { letter-spacing: -0.02em; }

/* Sub-judul AppBar global di bawah Nama BPR */
.web-appbar-title {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  min-width: 0 !important;
}
.web-appbar-title::after {
  content: "Pusat Monitoring Kinerja Keuangan, Portofolio Kredit & Antrean Otorisasi Transaksi";
  display: block;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  opacity: 0.9 !important;
  margin-top: 3px !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
@media (max-width: 640px) {
  .web-appbar-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
  }
  .web-appbar-title::after {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    opacity: 0.92 !important;
    margin-top: 2px !important;
  }
}

/* -----------------------------------------------------------------------------
   4. BACKGROUND aplikasi yang lembut → card putih jadi "pop"
   (framework default body cenderung putih polos = flat)
   -------------------------------------------------------------------------- */
body.web-body { background-color: #f4f5fb; }
.dark body.web-body { background-color: #0b1120; }

/* -----------------------------------------------------------------------------
   5. SUDUT MEMBULAT — menimpa utilitas Tailwind (scoped .web-body = menang)
   rounded-full SENGAJA tidak disentuh (avatar, pill, FAB tetap bulat).
   -------------------------------------------------------------------------- */
.web-body .rounded     { border-radius: var(--r-sm); }
.web-body .rounded-md  { border-radius: var(--r-md); }
.web-body .rounded-lg  { border-radius: var(--r-lg); }
.web-body .rounded-xl  { border-radius: var(--r-xl); }
.web-body .rounded-2xl { border-radius: var(--r-2xl); }
.web-body .rounded-3xl { border-radius: 28px; }

/* -----------------------------------------------------------------------------
   6. SHADOW — menimpa utilitas Tailwind dengan versi lembut berlapis
   -------------------------------------------------------------------------- */
.web-body .shadow-sm { box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.web-body .shadow    { box-shadow: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05); }
.web-body .shadow-md { box-shadow: 0 4px 12px -2px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .06); }
.web-body .shadow-lg { box-shadow: 0 12px 28px -8px rgba(16, 24, 40, .16), 0 4px 10px -4px rgba(16, 24, 40, .08); }
.web-body .shadow-xl { box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .22), 0 8px 16px -8px rgba(16, 24, 40, .10); }

.dark .web-body .shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.dark .web-body .shadow,
.dark .web-body .shadow-md { box-shadow: 0 6px 18px -4px rgba(0, 0, 0, .5); }
.dark .web-body .shadow-lg,
.dark .web-body .shadow-xl { box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .6); }

/* -----------------------------------------------------------------------------
   7. INPUT — radius lega + focus ring brand (bukan garis biru default)
   -------------------------------------------------------------------------- */
.web-body input:not([type="checkbox"]):not([type="radio"]),
.web-body select,
.web-body textarea {
  border-radius: var(--r-md);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.web-body input:not([type="checkbox"]):not([type="radio"]):focus,
.web-body select:focus,
.web-body textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.dark .web-body input:focus,
.dark .web-body select:focus,
.dark .web-body textarea:focus { border-color: var(--pwa-primary); }

/* -----------------------------------------------------------------------------
   8. MICRO-INTERACTION — transisi halus + sedikit "lift" pada elemen interaktif
   (tanpa ini, UI terasa statis/kaku)
   -------------------------------------------------------------------------- */
.web-body button,
.web-body a,
.web-body .web-surface,
.web-body [class*="rounded"] {
  transition: transform .14s ease, box-shadow .2s ease, background-color .18s ease, border-color .18s ease;
}
/* lift hanya untuk tombol solid (punya shadow), bukan teks-link */
.web-body button.shadow:hover,
.web-body button.shadow-md:hover,
.web-body button.shadow-lg:hover { transform: translateY(-1px); }
.web-body button:active { transform: translateY(0); }

/* -----------------------------------------------------------------------------
   9. SCROLLBAR tipis modern (webkit)
   -------------------------------------------------------------------------- */
.web-body *::-webkit-scrollbar { width: 10px; height: 10px; }
.web-body *::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, .35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.web-body *::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .55); background-clip: content-box; }
.web-body *::-webkit-scrollbar-track { background: transparent; }

/* -----------------------------------------------------------------------------
   10. SELECTION mengikuti brand
   -------------------------------------------------------------------------- */
.web-body ::selection { background: var(--brand-200); color: var(--brand-700); }
.dark .web-body ::selection { background: rgba(126, 107, 242, .4); color: #fff; }

/* -----------------------------------------------------------------------------
   11. MSTFORM MOBILE SCROLL (PWA) — Mencegah scroll terjebak di dalam grid
   Di layar ponsel (< 768px), tabel membentang vertikal secara alami mengikuti
   halaman, hanya bergulir horizontal (X). Halaman bebas digulir vertikal di atas grid.
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .web-mstform,
  #mst-list-section,
  .web-mstform .web-bg-surface.rounded-xl,
  .web-mstform .mst-table-wrap,
  .web-mstform .mst-table-wrap > div {
    flex: none !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
  }

  .web-mstform .web-bg-surface.rounded-xl {
    overflow: visible !important;
  }

  .web-mstform .mst-table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    overscroll-behavior-y: auto !important;
  }

  /* Ruang dasar di bawah konten agar baris terakhir & paginasi tidak tertutup bottomnav */
  .pwa-main,
  #web-body,
  .web-body {
    padding-bottom: calc(var(--pwa-bottomnav-height, 64px) + 2rem) !important;
  }

  /* ---------------------------------------------------------------------------
     12. RESPONSIVE FILTER CARDS (PWA / Mobile <= 768px)
     Input filter (periode, cabang, kategori) tersusun vertikal penuh ke bawah.
     ------------------------------------------------------------------------ */
  #card-filter,
  #card-filter-dashboard {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  #card-filter .web-row,
  #card-filter .flex.flex-row,
  #card-filter-dashboard .web-row,
  #card-filter-dashboard .flex.flex-row {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 0.875rem !important;
  }

  #card-filter [style*="flex-basis"],
  #card-filter .px-2.flex-shrink-0,
  #card-filter-dashboard [style*="flex-basis"],
  #card-filter-dashboard .px-2.flex-shrink-0 {
    flex-basis: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0 !important;
  }

  #card-filter .form-group,
  #card-filter .web-form-group,
  #card-filter .web-input-wrapper,
  #card-filter select,
  #card-filter-dashboard .form-group,
  #card-filter-dashboard .web-form-group,
  #card-filter-dashboard .web-input-wrapper,
  #card-filter-dashboard select {
    width: 100% !important;
  }

  #card-filter-dashboard .web-input-wrapper {
    margin-bottom: 0 !important;
  }

  #card-filter button#cmdRefresh,
  #card-filter [id="cmdRefresh"] {
    margin-top: 0.375rem !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
    font-weight: 600 !important;
  }

  #card-filter-dashboard [class*="mt-6"] {
    margin-top: 0.25rem !important;
    width: 100% !important;
  }

  #card-filter-dashboard button#cmdFilter,
  #card-filter-dashboard [id="cmdFilter"] {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
    font-weight: 600 !important;
  }
}

/* -----------------------------------------------------------------------------
   4. ALERT, CONFIRM, & PROMPT OVERLAY (sis.confirm / sis.alert / sis.prompt / mstForm)
   Harus selalu berada di atas modal maupun drawer (z-index modal: 9995, dialog: 100000)
   -------------------------------------------------------------------------- */
.amsg-overlay,
div.amsg-overlay,
.sis-overlay.amsg-overlay {
  z-index: 100000 !important;
}

.amsg-overlay .amsg-modal {
  z-index: 100001 !important;
  position: relative !important;
}

/* -----------------------------------------------------------------------------
   5. LOADING & BUSY OVERLAY (sis-busy-overlay, sis-global-spinner, sis-local-spinner)
   Harus selalu berada di atas modal maupun drawer saat proses penyimpanan berlangsung
   -------------------------------------------------------------------------- */
.sis-busy-overlay,
div.sis-busy-overlay,
#sis-global-spinner,
div#sis-global-spinner,
#sis-backdrop,
div#sis-backdrop {
  z-index: 100000 !important;
}

.sis-busy-overlay .sis-busy-box {
  z-index: 100001 !important;
  position: relative !important;
}

#mst-modal .sis-local-spinner,
.web-mstform > .sis-local-spinner {
  z-index: 100000 !important;
}



