/* =====================================================================
   FASVAL Dashboard - stylesheet
   Tema hijau sesuai desain referensi (Balai Perhutanan Sosial)
   ===================================================================== */
:root {
    --fv-green-900: #0f4a34;
    --fv-green-800: #0f5c3f;
    --fv-green-700: #14532d;
    --fv-green-600: #16743f;
    --fv-green-500: #1a8a4c;
    --fv-green-100: #e7f6ec;
    --fv-green-50: #f2fbf5;
    --fv-blue: #2563eb;
    --fv-blue-100: #dbeafe;
    --fv-amber: #d97706;
    --fv-amber-100: #fef3c7;
    --fv-red: #dc2626;
    --fv-red-100: #fee2e2;
    --fv-purple: #9333ea;
    --fv-purple-100: #f3e8ff;
    --fv-text: #1f2937;
    --fv-text-muted: #6b7280;
    --fv-border: #e5e7eb;
    --fv-bg: #f7f8fa;
    --fv-radius: 12px;
    --fv-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--fv-bg);
    color: var(--fv-text);
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------------- Layout ---------------- */
.fv-app { display: flex; min-height: 100vh; }

.fv-sidebar {
    width: 260px;
    flex: 0 0 260px;
    /* Foto hutan + scrim gelap, senada dengan halaman login (Tahap D -
       sesuai referensi gambar sidebar baru), menggantikan gradient hijau
       polos sebelumnya. */
    background:
        linear-gradient(180deg, rgba(10,46,36,.82) 0%, rgba(5,16,10,.88) 55%, rgba(5,16,10,.94) 100%),
        url('../img/bg-forest.jpg') center/cover no-repeat;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 22px 18px;
    /* Sticky (BUKAN relative - sebelumnya ada deklarasi `position` ganda di
       sini yang saling menimpa, sehingga sticky tidak pernah aktif dan
       sidebar ikut scroll bersama konten alih-alih tetap di tempat. Ini akar
       masalah "navbar tidak menyesuaikan" pada halaman panjang seperti form
       Tambah Penggarap - bagian bawah sidebar (kotak bantuan/footer) muncul
       di tengah halaman karena sidebar sudah lewat ter-scroll ke atas). */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}
.fv-sidebar-footer {
    position: relative; z-index: 1; font-size: 10.5px; font-weight: 700;
    letter-spacing: .08em; line-height: 1.6; opacity: .75; margin-top: 14px;
    text-align: center;
}
.fv-sidebar > * { position: relative; z-index: 1; }
.fv-brand { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 24px; padding: 0 4px; }
.fv-brand-logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    overflow: hidden;
    flex: 0 0 auto;
}
.fv-brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.fv-kemenhut-chip {
    display: inline-flex; align-items: center; background: #fff;
    border-radius: 10px; padding: 7px 12px; margin-bottom: 22px;
    position: relative; z-index: 1;
}
.fv-kemenhut-chip img { height: 22px; width: auto; display: block; }
.fv-brand-title { font-weight: 700; font-size: 17px; line-height: 1.2; }
.fv-brand-sub { font-size: 11.5px; opacity: .75; line-height: 1.3; }

/* Lockup dua logo (Kemenhut berdampingan WIBISANA) di puncak SIDEBAR -
   versi lebih ringkas dari .fv-login-lockup (halaman login) supaya muat di
   lebar sidebar (260px), tapi alasannya SAMA: logo Kemenhut PNG-nya
   berlatar transparan dengan teks gelap, jadi kalau ditaruh langsung di
   atas foto hutan gelap akan nyaris tak terbaca - makanya tetap dibungkus
   kartu putih kecil, senada dengan tampilan referensi sidebar baru. */
.fv-sidebar-lockup {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border-radius: 12px; padding: 9px 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
    margin-bottom: 14px; width: fit-content;
}
.fv-sidebar-lockup-logo { height: 24px; width: auto; display: block; }
.fv-sidebar-lockup-logo--wibisana { height: 32px; }
.fv-sidebar-lockup-divider { width: 1px; height: 26px; background: var(--fv-border); flex: 0 0 auto; }

/* Tagline kursif di bagian bawah sidebar, senada dengan halaman login. */
.fv-sidebar-cursive {
    font-family: 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 15px; font-weight: 400; opacity: .85;
    text-align: center; margin-top: 10px; letter-spacing: .02em;
}

.fv-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.fv-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: rgba(255,255,255,.88);
    transition: background .15s ease;
}
.fv-nav a:hover { background: rgba(255,255,255,.08); }
.fv-nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.fv-nav .fv-icon { font-size: 17px; width: 20px; text-align: center; }

.fv-help-box {
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 14px;
    font-size: 12.5px;
    line-height: 1.5;
    opacity: .9;
}
.fv-help-box strong { display: block; margin-bottom: 4px; font-size: 13px; }

.fv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.fv-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-bottom: 1px solid var(--fv-border);
    padding: 16px 28px;
    position: sticky; top: 0; z-index: 30;
    gap: 12px; flex-wrap: wrap;
}
.fv-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fv-page-title { font-size: 19px; font-weight: 700; }
.fv-page-date { font-size: 12.5px; color: var(--fv-text-muted); margin-top: 2px; }
.fv-topbar-right { display: flex; align-items: center; gap: 18px; }

/* Tombol hamburger - hanya tampil di layar sempit (lihat media query di
   bawah) untuk membuka drawer sidebar (lihat .fv-sidebar.open & fvToggleSidebar
   di app.js). Sebelumnya CSS drawer-nya sudah ada tapi TIDAK ADA tombol/JS
   sama sekali yang mengaktifkannya, jadi di HP menu navigasi tidak bisa
   dibuka - ini yang melengkapinya. */
.fv-sidebar-toggle {
    display: none; font-size: 20px; background: none; border: none; color: var(--fv-text);
    width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto; cursor: pointer;
}
.fv-sidebar-toggle:hover { background: var(--fv-bg); }
.fv-sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 39;
}
.fv-sidebar-backdrop.show { display: block; }

.fv-notif-btn { position: relative; font-size: 19px; color: var(--fv-text-muted); background: none; border: none; cursor: pointer; }
.fv-notif-dot {
    position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px; padding: 0 3px;
    background: var(--fv-red); color: #fff; border-radius: 999px;
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
    display: none; align-items: center; justify-content: center; border: 2px solid #fff;
}

/* Panel dropdown notifikasi - isinya diisi JS (fvRenderNotifPanel di app.js)
   dari GET /notifications (lihat NotificationController.php). */
.fv-notif-wrap { position: relative; }
.fv-notif-panel {
    position: absolute; top: calc(100% + 12px); right: -6px; width: 340px; max-width: calc(100vw - 32px);
    background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(16,24,40,.18); border: 1px solid var(--fv-border);
    z-index: 50; overflow: hidden;
}
.fv-notif-panel-title { font-weight: 700; font-size: 13.5px; padding: 14px 16px; border-bottom: 1px solid var(--fv-border); }
.fv-notif-list { max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; }
.fv-notif-empty { padding: 28px 16px; text-align: center; color: var(--fv-text-muted); font-size: 12.5px; }
.fv-notif-item {
    display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--fv-border);
    transition: background .12s ease;
}
.fv-notif-item:last-child { border-bottom: none; }
.fv-notif-item:hover { background: var(--fv-bg); }
.fv-notif-item-icon { font-size: 17px; flex: 0 0 auto; margin-top: 1px; }
.fv-notif-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fv-notif-item-title { font-weight: 700; font-size: 12.5px; color: var(--fv-text); }
.fv-notif-item-msg { font-size: 12px; color: var(--fv-text-muted); line-height: 1.4; }
.fv-notif-item-time { font-size: 10.5px; color: var(--fv-text-muted); opacity: .8; margin-top: 2px; }
.fv-notif-item-danger .fv-notif-item-title { color: var(--fv-red); }
.fv-notif-item-info .fv-notif-item-title { color: var(--fv-blue); }

.fv-user-chip { display: flex; align-items: center; gap: 10px; }
.fv-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--fv-green-100); color: var(--fv-green-700);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.fv-user-name { font-weight: 600; font-size: 13.5px; }
.fv-user-email { font-size: 11.5px; color: var(--fv-text-muted); }
.fv-logout-btn {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--fv-red-100); background: var(--fv-red-100);
    color: var(--fv-red); padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 13px;
}

.fv-content { padding: 26px 28px 60px; flex: 1; }

/* ---------------- Cards / stat tiles ---------------- */
.fv-stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.fv-stat-card {
    background: #fff; border-radius: var(--fv-radius); box-shadow: var(--fv-shadow);
    padding: 16px 22px; flex: 1; min-width: 190px;
    border-left: 4px solid var(--fv-blue);
}
.fv-stat-card.green { border-left-color: var(--fv-green-500); }
.fv-stat-card.amber { border-left-color: var(--fv-amber); }
.fv-stat-label { font-size: 12.5px; color: var(--fv-text-muted); margin-bottom: 6px; }
.fv-stat-value { font-size: 24px; font-weight: 700; }

.fv-panel { background: #fff; border-radius: var(--fv-radius); box-shadow: var(--fv-shadow); padding: 22px; margin-bottom: 20px; }
.fv-panel-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; display:flex; align-items:center; gap:8px;}
.fv-panel-sub { font-size: 12.5px; color: var(--fv-text-muted); margin: 0 0 18px; }

/* ---------------- Buttons ---------------- */
.fv-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: none; border-radius: 9px; padding: 10px 16px;
    font-weight: 600; font-size: 13.5px; white-space: nowrap;
}
.fv-btn-primary { background: var(--fv-green-500); color: #fff; }
.fv-btn-primary:hover { background: var(--fv-green-600); }
.fv-btn-blue { background: var(--fv-blue); color: #fff; }
.fv-btn-light { background: #eef0f2; color: var(--fv-text); }
.fv-btn-outline { background: #fff; border: 1px solid var(--fv-border); color: var(--fv-text); }
.fv-btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.fv-btn-icon-blue { background: var(--fv-blue-100); color: var(--fv-blue); }
.fv-btn-icon-amber { background: var(--fv-amber-100); color: var(--fv-amber); }
.fv-btn-icon-red { background: var(--fv-red-100); color: var(--fv-red); }
.fv-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- Form ---------------- */
.fv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.fv-form-grid.single { grid-template-columns: 1fr; }
.fv-field { display: flex; flex-direction: column; gap: 6px; }
.fv-field label { font-size: 13px; font-weight: 600; }
.fv-field .req { color: var(--fv-red); }
.fv-field input, .fv-field select, .fv-field textarea {
    padding: 10px 12px; border-radius: 9px; border: 1px solid var(--fv-border);
    background: #fff; outline: none;
}
.fv-field input:focus, .fv-field select:focus, .fv-field textarea:focus { border-color: var(--fv-green-500); box-shadow: 0 0 0 3px var(--fv-green-100); }
.fv-field .hint { font-size: 11.5px; color: var(--fv-text-muted); }
.fv-field .error { font-size: 11.5px; color: var(--fv-red); }
.fv-field-error input, .fv-field-error select { border-color: var(--fv-red); }

.fv-form-error {
    color: var(--fv-red); background: var(--fv-red-100); border: 1px solid #fecaca;
    border-radius: 9px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px;
    font-weight: 600;
}

/* Bilah aksi Simpan/Kembali - dibuat "menempel" (sticky) di dasar layar
   sebagai kartu tersendiri (bukan lagi teks/tombol yang mengambang jauh di
   bawah kolom peta yang lebih pendek) supaya selalu mudah dijangkau di
   formulir panjang, dan terasa menyatu secara visual dengan panel-panel
   lain di atasnya alih-alih terasa terpisah/jauh. */
.fv-form-actionbar {
    position: sticky; bottom: 16px;
    background: #fff; border-radius: var(--fv-radius); box-shadow: 0 8px 24px rgba(16,24,40,.12);
    border: 1px solid var(--fv-border);
    padding: 14px 20px; margin: 24px 0 8px;
    display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
    z-index: 10;
}
.fv-form-actionbar-hint { font-size: 12.5px; color: var(--fv-text-muted); }
.fv-form-actionbar-btns { display: flex; gap: 10px; margin-left: auto; }

/* ---------------- Table ---------------- */
.fv-table-wrap { overflow-x: auto; }
table.fv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.fv-table thead th {
    background: var(--fv-green-600); color: #fff; text-align: left;
    padding: 12px 14px; font-weight: 600; white-space: nowrap;
}
table.fv-table thead th:first-child { border-top-left-radius: 8px; }
table.fv-table thead th:last-child { border-top-right-radius: 8px; }
table.fv-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--fv-border); vertical-align: middle; }
table.fv-table tbody tr:hover { background: #fafbfc; }
.fv-td-muted { color: var(--fv-text-muted); font-size: 12px; }
.fv-actions-cell { display: flex; gap: 6px; }

.fv-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.fv-badge-blue { background: var(--fv-blue-100); color: var(--fv-blue); }
.fv-badge-green { background: var(--fv-green-100); color: var(--fv-green-700); }
.fv-badge-purple { background: var(--fv-purple-100); color: var(--fv-purple); }
.fv-badge-amber { background: var(--fv-amber-100); color: var(--fv-amber); }
.fv-badge-red { background: var(--fv-red-100); color: var(--fv-red); }
.fv-count-pill { background: var(--fv-green-100); color: var(--fv-green-700); border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 12.5px; }

/* ---------------- Alur approval berjenjang (Tahap 5) ---------------- */
.fv-approval-actions { display: flex; gap: 10px; margin-top: 4px; }
.fv-btn-approve {
    background: var(--fv-green-500); color: #fff; border: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.fv-btn-approve:hover { background: var(--fv-green-600); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(26,138,76,.28); }
.fv-btn-reject {
    background: #fff; color: var(--fv-red); border: 1.5px solid var(--fv-red-100);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.fv-btn-reject:hover { background: var(--fv-red-100); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(220,38,38,.16); }

/* Timeline riwayat aktivitas (create/update/approve/reject) - tiap baris
   fade+slide masuk dengan jeda kecil antar-item supaya terasa "hidup". */
.fv-timeline { position: relative; padding-left: 6px; }
.fv-timeline::before {
    content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px;
    background: linear-gradient(var(--fv-border), var(--fv-border));
}
.fv-timeline-item {
    position: relative; display: flex; gap: 14px; padding: 0 0 20px 0;
    opacity: 0; transform: translateY(10px);
    animation: fv-timeline-in .45s ease forwards;
}
@keyframes fv-timeline-in { to { opacity: 1; transform: translateY(0); } }
.fv-timeline-item:last-child { padding-bottom: 2px; }
.fv-timeline-dot {
    position: relative; z-index: 1; flex: 0 0 auto;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--fv-green-50); border: 2px solid var(--fv-green-100);
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.fv-timeline-item.approve .fv-timeline-dot { background: var(--fv-green-100); border-color: var(--fv-green-500); }
.fv-timeline-item.reject .fv-timeline-dot { background: var(--fv-red-100); border-color: var(--fv-red); }
.fv-timeline-body { padding-top: 4px; }
.fv-timeline-title { font-size: 13.5px; font-weight: 600; }
.fv-timeline-note { font-size: 12.5px; color: var(--fv-text-muted); font-style: italic; margin-top: 2px; }
.fv-timeline-time { font-size: 11.5px; color: var(--fv-text-muted); margin-top: 2px; }

/* Pratinjau dokumen KTP/KK terenkripsi (dibuka lewat FileController) */
.fv-doc-preview { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.fv-doc-thumb {
    width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--fv-border);
    overflow: hidden; cursor: pointer; background: var(--fv-bg);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.fv-doc-thumb:hover { transform: scale(1.04); box-shadow: var(--fv-shadow); }
.fv-doc-thumb img { width: 100%; height: 100%; object-fit: cover; }

.fv-search-row { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.fv-search-row input[type=text] { flex: 2; min-width: 220px; }
.fv-search-row select { flex: 1; min-width: 140px; }
.fv-search-row input, .fv-search-row select { padding: 10px 12px; border-radius: 9px; border: 1px solid var(--fv-border); }

.fv-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; }
.fv-pagination button { border: 1px solid var(--fv-border); background: #fff; border-radius: 8px; padding: 6px 11px; }
.fv-pagination button.active { background: var(--fv-green-500); color: #fff; border-color: var(--fv-green-500); }

/* ---------------- Login page ---------------- */
.fv-login-wrap { display: flex; min-height: 100vh; }
.fv-login-left {
    /* Foto ilustrasi hutan (bg-forest.jpg, sama aset dengan splash Android)
       + scrim gradient gelap di atasnya supaya kartu logo & teks putih
       tetap kontras terbaca - menggantikan gradient hijau polos
       sebelumnya yang dinilai kurang menarik. */
    flex: 1;
    background:
        linear-gradient(165deg, rgba(10,46,36,.55) 0%, rgba(5,16,10,.55) 45%, rgba(5,16,10,.88) 100%),
        url('../img/bg-forest.jpg') center/cover no-repeat;
    color: #fff; padding: 54px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden; min-height: 100vh;
}
.fv-login-right { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; }
.fv-login-card { width: 100%; max-width: 380px; }
.fv-login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.fv-login-sub { color: var(--fv-text-muted); font-size: 13.5px; margin-bottom: 26px; }
.fv-feature-row { display: grid; grid-template-columns: repeat(2, auto); gap: 18px 28px; position: relative; z-index: 1; }
.fv-feature-item { font-size: 12.5px; }
.fv-feature-item .ico { font-size: 20px; margin-bottom: 6px; }
.fv-hero-title { font-size: 30px; font-weight: 800; line-height: 1.25; position: relative; z-index: 1; }
.fv-hero-desc { font-size: 14px; opacity: .85; margin-top: 14px; max-width: 420px; line-height: 1.6; position: relative; z-index: 1; }

/* Kartu logo "berdampingan" (lockup) khusus halaman login - Kemenhut &
   WIBISANA dalam satu kartu putih terpisah garis tipis, meniru gambar
   referensi yang diberikan pengguna. Class terpisah dari .fv-brand /
   .fv-kemenhut-chip milik sidebar supaya perubahan di sini tidak
   mengubah tampilan sidebar. */
.fv-login-lockup {
    display: inline-flex; align-items: center; gap: 16px;
    background: #fff; border-radius: 16px; padding: 14px 22px;
    box-shadow: 0 14px 34px rgba(0,0,0,.28);
    position: relative; z-index: 1; width: fit-content; margin-bottom: 20px;
}
.fv-login-lockup-logo { height: 34px; width: auto; display: block; }
.fv-login-lockup-logo--wibisana { height: 46px; }
.fv-login-lockup-divider { width: 1px; height: 36px; background: var(--fv-border); flex: 0 0 auto; }
.fv-login-brand-text { position: relative; z-index: 1; margin-bottom: 30px; }
.fv-login-brand-title { font-weight: 800; font-size: 20px; letter-spacing: .05em; }
.fv-login-brand-sub { font-size: 12px; opacity: .85; line-height: 1.45; max-width: 320px; margin-top: 3px; }

/* Tagline kursif + tagline bawah dekoratif (Tahap D - sesuai referensi
   gambar login baru: "Bersama Menjaga Hutan untuk Masa Depan" bergaya
   tulisan tangan, dan tagline kapital di pojok bawah kiri). */
.fv-login-cursive {
    font-family: 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 24px; font-weight: 400; opacity: .92;
    margin-top: 10px; position: relative; z-index: 1; letter-spacing: .02em;
}
.fv-login-footer-tagline {
    position: relative; z-index: 1; font-size: 11px; font-weight: 700;
    letter-spacing: .12em; opacity: .8; margin-top: 18px;
}

/* Dekorasi daun di pojok - murni CSS, tanpa aset gambar tambahan. */
.fv-leaf-corner {
    position: absolute; pointer-events: none; z-index: 0; opacity: .35;
    font-size: 120px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.3));
}
.fv-leaf-corner--top { top: -22px; right: -18px; transform: rotate(18deg); }
.fv-leaf-corner--bottom { bottom: -30px; left: -20px; transform: rotate(-24deg); font-size: 150px; }

.fv-login-forgot { font-size: 12.5px; color: var(--fv-green-600); font-weight: 600; }
.fv-login-forgot:hover { text-decoration: underline; }

/* Partikel kunang-kunang melayang - polesan "interaktif" tambahan di atas
   foto hutan, murni CSS (tanpa JS/aset gambar tambahan). */
.fv-fireflies { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.fv-firefly {
    position: absolute; width: 5px; height: 5px; border-radius: 50%;
    background: #fce7ad; box-shadow: 0 0 9px 3px rgba(252,231,173,.85);
    opacity: 0;
    animation: fv-firefly-float 8s ease-in-out infinite, fv-firefly-blink 3.6s ease-in-out infinite;
}
@keyframes fv-firefly-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(16px, -26px); }
}
@keyframes fv-firefly-blink {
    0%, 100% { opacity: 0; }
    45%, 55% { opacity: .95; }
}
@media (prefers-reduced-motion: reduce) {
    .fv-firefly { animation: none; opacity: .6; }
}

/* ---------------- Misc ---------------- */
.fv-toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.fv-toast { background: #fff; border-radius: 10px; box-shadow: var(--fv-shadow); padding: 12px 16px; font-size: 13.5px; border-left: 4px solid var(--fv-green-500); min-width: 240px; }
.fv-toast.error { border-left-color: var(--fv-red); }

.fv-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.fv-modal-backdrop.show { display: flex; }
.fv-modal { background: #fff; border-radius: 14px; max-width: 520px; width: 100%; padding: 24px; max-height: 90vh; overflow-y: auto; }
.fv-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.fv-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.fv-empty-state { text-align: center; padding: 50px 20px; color: var(--fv-text-muted); }
.fv-loading { text-align: center; padding: 40px; color: var(--fv-text-muted); }

.fv-map-box { border-radius: var(--fv-radius); overflow: hidden; border: 1px solid var(--fv-border); }
#fv-map, #fv-map-form { width: 100%; height: 520px; background: #eef1f3; }
#fv-map-sebaran { width: 100%; height: 560px; background: #eef1f3; }

.fv-ocr-drop {
    border: 2px dashed var(--fv-border); border-radius: 10px; padding: 16px;
    text-align: center; font-size: 12.5px; color: var(--fv-text-muted); cursor: pointer;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    transition: border-color .15s ease, background .15s ease;
    min-height: 108px; justify-content: center;
}
.fv-ocr-drop:hover { border-color: var(--fv-green-500); background: var(--fv-green-50); }
.fv-ocr-drop-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fv-ocr-drop-icon { font-size: 26px; line-height: 1; }
.fv-ocr-drop-thumb {
    width: 100%; max-width: 220px; max-height: 130px; object-fit: cover;
    border-radius: 8px; box-shadow: var(--fv-shadow);
}
.fv-ocr-drop-ok { border-style: solid; border-color: var(--fv-green-500); background: var(--fv-green-50); }
.fv-ocr-drop-warn { border-style: solid; border-color: var(--fv-amber); background: var(--fv-amber-100); }
.fv-ocr-progress { font-size: 12px; color: var(--fv-green-700); font-weight: 600; }

/* Badge keyakinan (confidence) per-field hasil OCR (Tahap D - validasi OCR
   ketat: setiap field yang diisi otomatis ditandai seberapa yakin sistem
   terhadap nilainya, supaya petugas tahu field mana yang WAJIB diperiksa
   ulang sebelum menyimpan). */
.fv-ocr-badge {
    display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: middle;
}
.fv-ocr-badge-high { background: var(--fv-green-100); color: var(--fv-green-700); }
.fv-ocr-badge-medium { background: var(--fv-amber-100); color: var(--fv-amber); }
.fv-ocr-badge-low { background: var(--fv-red-100); color: var(--fv-red); }
input.fv-ocr-filled { border-color: var(--fv-amber) !important; background: #fffdf6; }
input.fv-ocr-filled.fv-ocr-filled-high { border-color: var(--fv-green-500) !important; background: #f8fffa; }

.fv-pointing-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.fv-pointing-item { display: flex; justify-content: space-between; align-items: center; background: var(--fv-green-50); border: 1px solid var(--fv-green-100); border-radius: 9px; padding: 8px 12px; font-size: 12.5px; }

.fv-tab-row { display: flex; gap: 8px; margin-bottom: 18px; }
.fv-tab-btn { padding: 9px 16px; border-radius: 9px; border: 1px solid var(--fv-border); background: #fff; font-weight: 600; font-size: 13px; }
.fv-tab-btn.active { background: var(--fv-green-600); border-color: var(--fv-green-600); color: #fff; }

.fv-section-title { font-size: 14.5px; font-weight: 700; color: var(--fv-green-700); margin: 22px 0 4px; display:flex; align-items:center; gap:8px; }
.fv-section-title:first-child { margin-top: 0; }

/* =====================================================================
   RESPONSIVE - dua breakpoint: tablet (<=900px, sidebar jadi drawer) dan
   ponsel (<=560px, penyesuaian lebih ketat untuk layar sempit: topbar,
   kartu statistik, baris tombol header, grid form, tinggi peta, dsb).
   Semua halaman dashboard sudah lewat komponen bersama (topbar.php,
   sidebar.php, .fv-panel/.fv-form-grid/.fv-stats-row) jadi perubahan di
   sini otomatis berlaku ke seluruh halaman, bukan cuma satu-satu.
   ===================================================================== */
@media (max-width: 900px) {
    .fv-sidebar { position: fixed; left: -280px; top: 0; bottom: 0; z-index: 40; transition: left .2s ease; }
    .fv-sidebar.open { left: 0; }
    .fv-sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .fv-form-grid { grid-template-columns: 1fr; }
    .fv-login-left { display: none; }
    .fv-content { padding: 18px; }

    /* Grid 2 kolom (Data Nominatif/Lapangan | Peta) di halaman Tambah/Edit
       Penggarap dipaksa lewat inline style (grid-template-columns: 1.3fr 1fr)
       supaya lebih fleksibel diatur per-halaman - inline style menang atas
       class biasa, jadi override di sini SENGAJA pakai !important, khusus
       untuk breakpoint ini saja. */
    #fv-penggarap-form .fv-form-grid[style] { grid-template-columns: 1fr !important; }

    #fv-map, #fv-map-form { height: 380px; }
    #fv-map-sebaran { height: 400px; }
}

@media (max-width: 560px) {
    .fv-topbar { padding: 12px 16px; }
    .fv-page-title { font-size: 16.5px; }
    .fv-content { padding: 14px; }
    .fv-panel { padding: 16px; }

    /* Chip user disederhanakan - email disembunyikan supaya tidak
       mendesak tombol lain keluar layar; avatar+nama saja sudah cukup
       identitas di layar sesempit ini. */
    .fv-user-email { display: none; }
    .fv-user-chip { gap: 7px; }
    .fv-logout-btn { font-size: 0; padding: 8px; gap: 0; }
    .fv-logout-btn::before { content: "⏻"; font-size: 16px; }
    .fv-topbar-right { gap: 10px; }

    .fv-notif-panel { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; max-width: none; }

    .fv-stats-row { gap: 10px; }
    .fv-stat-card { min-width: 100%; padding: 14px 16px; }

    /* Baris header halaman (judul + tombol aksi) yang ditulis lewat inline
       style di banyak file (data-kelompok.php, kelompok-detail.php,
       penggarap-form.php, manajemen-user.php, dst.) - dipaksa membungkus
       ke bawah rapi di layar ponsel alih-alih berdesakan/terpotong.
       !important dipakai KHUSUS di breakpoint ini karena kalah spesifisitas
       melawan inline style, dan hanya menyentuh flex-wrap/gap/margin, bukan
       mengganti tata letak intinya. */
    div[style*="justify-content:space-between"], div[style*="justify-content: space-between"] {
        flex-wrap: wrap !important;
        row-gap: 10px !important;
    }
    #fv-write-actions { margin: 10px 0 18px !important; justify-content: flex-start !important; }

    .fv-btn { flex: 1 1 auto; justify-content: center; }
    .fv-search-row .fv-btn { flex: 0 0 auto; }

    #fv-map, #fv-map-form { height: 300px; }
    #fv-map-sebaran { height: 320px; }

    .fv-modal { padding: 18px; }
    .fv-login-right { padding: 24px 18px; }
    .fv-login-card { max-width: 100%; }

    .fv-form-actionbar { flex-direction: column; align-items: stretch; }
    .fv-form-actionbar-btns { margin-left: 0; width: 100%; }
    .fv-form-actionbar-btns .fv-btn { flex: 1; }
}
