/* =========================================================
   SIMANTRI — style.css
   Tema: Clean Government Health
   Primary: emerald/teal #0d9488 • rounded-2xl • shadow soft
   ========================================================= */

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-soft: #f0fdfa;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', Roboto, sans-serif;
}

/* ---------- Scrollbar halus ---------- */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =========================================================
   1. SPLASH / LANDING PAGE (3 detik → fade out)
   ========================================================= */
#splash {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: .35rem; padding: 1.5rem;
  color: #fff;
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(45, 212, 191, .38), transparent 62%),
    linear-gradient(160deg, #134e4a 0%, #0f766e 48%, #0d9488 100%);
  transition: opacity .6s ease, visibility .6s ease;
}
#splash.splash-out { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-logo {
  width: 92px; height: 92px;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .28));
  animation: splashPulse 1.6s ease-in-out infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
.splash-title {
  font-size: 2.15rem; font-weight: 800; letter-spacing: .16em; margin-top: .85rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .22);
}
.splash-sub {
  font-size: .84rem; opacity: .88; line-height: 1.6; max-width: 540px; margin-top: .2rem;
}
.splash-bar {
  width: 250px; height: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); overflow: hidden; margin-top: 1.15rem;
}
.splash-bar-fill {
  display: block; height: 100%; width: 0;
  background: #fff; border-radius: 999px;
  animation: splashBar 3s linear forwards;
}
@keyframes splashBar { from { width: 0; } to { width: 100%; } }
.splash-status {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  opacity: .78; margin-top: .55rem;
}
.splash-foot {
  position: absolute; bottom: 1.4rem; left: 0; right: 0;
  font-size: .72rem; opacity: .72; letter-spacing: .08em;
}

/* Animasi masuk aplikasi setelah splash */
.app-enter { animation: appIn .5s ease both; }
@keyframes appIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================
   2. SIDEBAR (fixed 280px, collapsible di mobile)
   ========================================================= */
#sidebar {
  position: fixed; inset-block: 0; left: 0; width: 280px; z-index: 50;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0f172a 0%, #113b38 130%);
  color: #cbd5e1;
  transform: translateX(-100%);
  transition: transform .3s ease;
}
#sidebar.open { transform: translateX(0); }
@media (min-width: 1024px) { #sidebar { transform: none; } }

.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.15rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-logo { width: 44px; height: 44px; flex: none; }
.brand-title { font-weight: 800; letter-spacing: .14em; color: #fff; font-size: .98rem; }
.brand-sub { font-size: .64rem; color: #5eead4; margin-top: .1rem; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem .8rem 1.4rem; }
.nav-section { margin-bottom: 1.05rem; }
.nav-section-title {
  font-size: .62rem; font-weight: 700; letter-spacing: .16em;
  color: #5eead4; opacity: .9; text-transform: uppercase;
  padding: 0 .65rem .45rem;
}
.nav-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .7rem; border-radius: .85rem;
  font-size: .85rem; font-weight: 500; color: #cbd5e1;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active {
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(13, 148, 136, .35);
}
.nav-link svg { flex: none; }
.sidebar-foot {
  padding: .85rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .64rem; color: rgba(153, 246, 228, .55);
}

#sidebar-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 23, 42, .55);
  opacity: 0; visibility: hidden; transition: .25s;
}
#sidebar-overlay.show { opacity: 1; visibility: visible; }
@media (min-width: 1024px) { #sidebar-overlay { display: none; } }

/* =========================================================
   3. TOPBAR + CONTENT
   ========================================================= */
.main-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin .3s;
}
@media (min-width: 1024px) { .main-wrap { margin-left: 280px; } }

#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.25rem;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-title { font-weight: 800; font-size: 1rem; color: var(--ink); line-height: 1.25; }
.page-sub { font-size: .7rem; color: var(--muted); }

.page-content {
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 1.25rem;
  position: relative; z-index: 1; /* di atas peta Leaflet, di bawah topbar */
}
.app-foot {
  text-align: center; font-size: .68rem; color: #94a3b8;
  padding: 1.15rem 1rem 1.4rem;
}

/* =========================================================
   4. KOMPONEN UMUM
   ========================================================= */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; border-radius: .75rem;
  color: #475569; transition: background .15s, color .15s; cursor: pointer;
}
.icon-btn:hover { background: #f1f5f9; color: var(--primary-dark); }

.card {
  background: #fff; border: 1px solid #e9eef5; border-radius: 1rem;
  box-shadow: 0 8px 30px rgba(15, 23, 42, .06);
}

.stat-card { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(13, 148, 136, .18); }
.stat-card:active { transform: translateY(-1px); }

/* Tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-weight: 600; font-size: .8rem; border-radius: .8rem;
  padding: .58rem 1rem; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(13, 148, 136, .28); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); border-color: #99f6e4; }
.btn-soft:hover { background: #ccfbf1; }
.btn-success { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.btn-success:hover { background: #d1fae5; }
.btn-danger { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }
.btn-danger:hover { background: #ffe4e6; }
.btn-ghost { background: #fff; color: #475569; border-color: var(--line); }
.btn-ghost:hover { background: #f8fafc; }

/* Chip filter */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .42rem .85rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  background: #fff; border: 1px solid var(--line); color: #475569;
  cursor: pointer; transition: .15s;
}
.chip:hover { border-color: #99f6e4; color: var(--primary-dark); }
.chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 6px 16px rgba(13, 148, 136, .3);
}
.count-chip {
  display: inline-flex; align-items: center;
  padding: .38rem .8rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-dark);
  border: 1px solid #99f6e4;
}

/* Kotak pencarian */
.search-box {
  display: flex; align-items: center; gap: .5rem; flex: 1; max-width: 340px;
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: .8rem; padding: .5rem .8rem;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, .14); }
.search-box input {
  background: transparent; border: none; outline: none;
  font-size: .82rem; width: 100%; color: var(--ink);
}

/* Form */
.lbl {
  display: block; font-size: .72rem; font-weight: 700;
  color: #475569; margin-bottom: .3rem;
}
.input {
  width: 100%; border: 1px solid #dfe7ef; border-radius: .8rem;
  padding: .58rem .8rem; font-size: .85rem; background: #fff;
  outline: none; transition: border .15s, box-shadow .15s;
  color: var(--ink); font-family: inherit;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, .15); }
textarea.input { resize: vertical; min-height: 2.4rem; }

/* Badge */
.badge {
  display: inline-flex; align-items: center;
  padding: .18rem .6rem; border-radius: 999px;
  font-size: .68rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
}

/* Tabel */
.table-wrap { overflow-x: auto; border-radius: .8rem; }
.sim-table { width: 100%; font-size: .8rem; border-collapse: collapse; }
.sim-table th {
  text-align: left; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  padding: .6rem .8rem; background: #f8fafc; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sim-table td { padding: .68rem .8rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.sim-table tbody tr { cursor: pointer; transition: background .12s; }
.sim-table tbody tr:hover { background: var(--primary-soft); }
.sim-table tbody tr:last-child td { border-bottom: none; }

/* Modal */
.modal-backdrop-anim { animation: fadeIn .2s ease; }
.modal-card { animation: modalUp .3s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes modalUp {
  from { transform: translateY(26px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Toast */
#toast-root {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 10001;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  min-width: 230px; max-width: 340px;
  background: #0f172a; color: #fff;
  padding: .72rem .95rem; border-radius: .9rem;
  font-size: .8rem; display: flex; gap: .6rem; align-items: flex-start;
  box-shadow: 0 14px 34px rgba(2, 6, 23, .35);
  animation: toastIn .3s ease;
}
.toast.success { border-left: 4px solid #10b981; }
.toast.error   { border-left: 4px solid #f43f5e; }
.toast.info    { border-left: 4px solid #0ea5e9; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f7fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: .6rem;
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Accordion petunjuk */
.acc-item {
  border: 1px solid var(--line); border-radius: 1rem;
  overflow: hidden; background: #fff;
}
.acc-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  width: 100%; text-align: left;
  padding: .9rem 1.1rem; cursor: pointer;
  font-weight: 700; font-size: .86rem; color: var(--ink);
  background: transparent; border: none; font-family: inherit;
}
.acc-head:hover { background: #f8fafc; }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.acc-item.open .acc-body { max-height: 760px; }
.acc-chevron { transition: transform .3s; flex: none; }
.acc-item.open .acc-chevron { transform: rotate(180deg); }

/* Detail modal */
.detail-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 640px) { .detail-grid { grid-template-columns: 175px 1fr; } }
.detail-label {
  font-size: .68rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  padding: .58rem 0;
}
.detail-value { font-size: .84rem; color: var(--ink); padding: .58rem 0; }
@media (min-width: 640px) {
  .detail-label, .detail-value { border-bottom: 1px dashed var(--line); }
}

/* Peta Leaflet */
.leaflet-container {
  border-radius: 1rem; font-family: inherit; z-index: 0;
  background: #e2e8f0;
}
.leaflet-popup-content { margin: .8rem 1rem; }
.sim-pin { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .28)); }

/* Thumbnail foto monev */
.thumb {
  width: 46px; height: 34px; object-fit: cover;
  border-radius: .5rem; border: 1px solid var(--line);
}

/* Fokus keyboard yang jelas */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

/* =========================================================
   13. FORMULIR VERVAL IZIN PRAKTIK (menu Verifikasi Praktik)
   ========================================================= */

.verval-grid { display: grid; grid-template-columns: 1fr; gap: .8rem 1rem; }
@media (min-width: 640px)  { .verval-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .verval-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.verval-field label {
  display: block; font-size: .7rem; font-weight: 700;
  color: #475569; margin-bottom: .3rem; line-height: 1.35;
}
.verval-field label .req { color: #e11d48; }
.verval-span { grid-column: 1 / -1; }

.verval-hint {
  display: block; font-size: .66rem; color: #94a3b8; margin-top: .25rem;
}
.verval-status-ok  { color: #059669; }
.verval-status-warn{ color: #d97706; }

/* Input readonly (timestamp & kolom duplikat otomatis) */
.input-readonly {
  background: #f8fafc; color: #64748b; cursor: default;
  border-style: dashed;
}
.input-readonly:focus { border-color: #dfe7ef; box-shadow: none; }

/* Judul kelompok field di dalam grid */
.verval-section {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: .6rem; margin-top: .5rem;
}
.verval-section-title {
  font-size: .64rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--primary-dark);
  background: var(--primary-soft); border: 1px solid #99f6e4;
  padding: .3rem .8rem; border-radius: 999px; white-space: nowrap;
}
.verval-section::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Baris aksi bawah formulir */
.verval-actions {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin-top: 1.2rem; padding-top: 1.1rem;
  border-top: 1px dashed var(--line);
}
.verval-actions .btn-submit { flex: 1 1 230px; }

/* Status draft otomatis */
.draft-status {
  display: flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 600; color: #059669;
  min-height: 1.1rem;
}
.draft-status.saving { color: #d97706; }
.draft-status.verval-status-warn { color: #d97706; }

/* Baris riwayat verval */
.rv-row { cursor: pointer; transition: border-color .15s, transform .12s; }
.rv-row:hover { border-color: #99f6e4; transform: translateY(-1px); }

/* Kode verifikasi */
.kode-chip {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem; background: #f1f5f9; border: 1px solid var(--line);
  padding: .15rem .55rem; border-radius: .45rem; color: #334155;
}

/* =========================================================
   14. FORMULIR VERVAL FASYANKES (menu Verifikasi Faskes)
   ========================================================= */

/* Panel info: ID Pendaftaran + Tanggal Input */
.vf-info-panel {
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border: 1px solid #99f6e4; border-radius: .9rem;
  padding: .85rem 1.1rem; margin-bottom: 1.1rem;
  display: flex; flex-wrap: wrap; gap: .9rem 1.2rem; align-items: center;
}
.vf-info-label {
  font-size: .62rem; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
}
.vf-info-value { font-size: .9rem; font-weight: 800; color: var(--primary-dark); }
.vf-info-value.tanggal { color: #334155; font-weight: 700; }
.vf-info-sep { height: 34px; width: 1px; background: #99f6e4; }

/* Badge ID di header kartu */
.vf-id-badge {
  background: linear-gradient(135deg, var(--primary-dark), #14b8a6);
  color: #fff; padding: .55rem .95rem; border-radius: .8rem;
  font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.5;
  white-space: nowrap;
}
.vf-id-badge code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; }

/* Kotak SDM Kesehatan (dinamis per jenis fasyankes) */
.vf-sdm-box {
  background: #f8fafc; border: 1.5px solid var(--line);
  border-radius: .9rem; padding: 1rem 1.1rem; min-height: 70px;
}
.vf-sdm-grid { display: grid; grid-template-columns: 1fr; gap: .45rem; }
@media (min-width: 640px)  { .vf-sdm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .vf-sdm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vf-sdm-item {
  display: flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: .65rem;
  padding: .45rem .65rem; font-size: .76rem; font-weight: 600; color: #334155;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.vf-sdm-item:hover { border-color: #99f6e4; }
.vf-sdm-item input {
  accent-color: var(--primary); width: 15px; height: 15px; flex: none; cursor: pointer;
}
.vf-sdm-item:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark);
}
