/* ================================================================
   TAMBAHAN CSS — 3 Fitur Baru WebGIS Bansos
   Append ke bagian bawah assets/css/style.css yang sudah ada
================================================================ */

/* ─── Panel Header ─── */
.fb-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

/* ─── Sub Tabs ─── */
.fb-sub-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 10px;
}

.fb-sub-tab {
  flex: 1;
  padding: 5px 4px;
  font-size: 10px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.fb-sub-tab.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fb-sub-panel { display: none; }
.fb-sub-panel.active { display: block; }

/* ─── States ─── */
.fb-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 11px;
  justify-content: center;
  animation: pulse 1.5s infinite;
}

.fb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.fb-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: rgba(239,68,68,0.08);
  border-radius: 8px;
  color: var(--danger);
  font-size: 11px;
}

.fb-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* ================================================================
   FITUR 1: REDISTRIBUSI
================================================================ */
.redistribusi-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}

.redist-sum-item {
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 6px 4px;
  text-align: center;
}

.redist-sum-val {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.redist-sum-key {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Beban Card ── */
.redist-card {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.redist-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.redist-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.redist-card-nama {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.redist-card-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.redist-progress-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.redist-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.redist-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.redist-progress-pct {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

.redist-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.redist-stat-item {
  text-align: center;
  padding: 4px 2px;
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.redist-stat-val {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.redist-stat-key {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Saran Card ── */
.saran-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.saran-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.saran-flow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.saran-ibadah {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.saran-ibadah.surplus {
  background: rgba(16,185,129,0.12);
  color: #10b981;
}

.saran-ibadah.defisit {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
}

.saran-arrow {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 2px;
}

.saran-alasan {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 4px;
}

.saran-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ── Riwayat Item ── */
.riwayat-item {
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

/* ================================================================
   FITUR 2: VERIFIKASI / KETERBARUAN DATA
================================================================ */
.verif-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.verif-sum-card {
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid transparent;
}

.verif-sum-card.ok   { background: rgba(16,185,129,0.1);  border-color: rgba(16,185,129,0.3); }
.verif-sum-card.warn { background: rgba(245,158,11,0.1);  border-color: rgba(245,158,11,0.3); }
.verif-sum-card.err  { background: rgba(239,68,68,0.1);   border-color: rgba(239,68,68,0.3);  }

.verif-sum-card span {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 2px;
}

.verif-sum-card.ok span   { color: #10b981; }
.verif-sum-card.warn span { color: #f59e0b; }
.verif-sum-card.err span  { color: #ef4444; }

.verif-sum-card small {
  display: block;
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.1;
}

/* ── Verif Item ── */
.verif-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.verif-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.verif-item-nama {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.verif-item-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.skor-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.skor-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.skor-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.skor-pct {
  font-size: 10px;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}

.verif-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  align-items: center;
}

.verif-info-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ── Konfigurasi ── */
.konfig-intro {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.konfig-item {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.konfig-item:last-child { border-bottom: none; }

.konfig-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.konfig-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
  line-height: 1.4;
}

/* ================================================================
   FITUR 3: KEMANDIRIAN
================================================================ */
.kemandirian-siap-badge {
  margin-left: auto;
  background: rgba(16,185,129,0.12);
  color: #10b981;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
}

.kemandirian-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  transition: box-shadow 0.2s;
}

.kemandirian-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.kemandirian-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.kemandirian-nama {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.kemandirian-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Gauge Grid ── */
.kemandirian-gauges {
  display: flex;
  gap: 4px;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-bottom: 6px;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.kemandirian-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

.gauge-val {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  margin-top: -4px;
}

.gauge-label {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1px;
}

.kemandirian-est {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kemandirian-rek {
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 4px;
}

.kemandirian-rek-item {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 2px 0;
}

/* ── Animation ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Responsive fine-tuning ── */
@media (max-width: 320px) {
  .redistribusi-summary { grid-template-columns: repeat(3, 1fr); }
  .redist-stat-row      { grid-template-columns: repeat(2, 1fr); }
  .kemandirian-gauges   { gap: 2px; }
}

/* ─── Side by Side Modals ─── */
@media (min-width: 1100px) {
  body.side-by-side-modals #modal-premium-verifikasi {
    justify-content: center;
    padding-right: 560px;
    transition: all 0.3s ease;
  }
  body.side-by-side-modals #modal-warga {
    justify-content: center;
    padding-left: 540px;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
    transition: all 0.3s ease;
  }
  body.side-by-side-modals #modal-warga .modal {
    pointer-events: auto;
  }
}

/* ================================================================
   RBAC & LOGIN & DONASI FRONTEND STYLES
================================================================ */
.user-profile-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  transition: all 0.25s ease;
}

.user-avatar-wrap {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3);
}

.user-avatar.avatar-guest {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: 0 2px 5px rgba(100, 116, 139, 0.3);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.badge-guest { background: rgba(148, 163, 184, 0.12); color: #64748b; }
.badge-admin { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.badge-petugas { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge-koordinator { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.badge-kontributor { background: rgba(16, 185, 129, 0.12); color: #10b981; }

.btn-auth-action {
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-auth-action:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

/* Kebutuhan & Donasi Cards */
.kebutuhan-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.kebutuhan-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--accent-light);
}

.kebutuhan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.kebutuhan-ibadah-nama {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.kebutuhan-bantuan-jenis {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.kebutuhan-progress-section {
  margin: 10px 0;
}

.kebutuhan-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kebutuhan-progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.kebutuhan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.kebutuhan-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 8px;
}

.kebutuhan-sisa {
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
}

.kebutuhan-sisa.kebutuhan-penuh {
  color: var(--text-muted);
}

/* Riwayat Kontribusi Item */
.kontribusi-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.kontribusi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* ================================================================
   PREMIUM DISTINCT LOGIN CARD REDESIGN (LIGHT CLASSIC PREMIUM)
   ================================================================ */
.login-premium-modal {
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(99, 102, 241, 0.15) !important;
  border: none !important;
  background: #ffffff !important;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-premium-header {
  background: #ffffff !important;
  padding: 26px 20px 18px 20px !important;
  text-align: center;
  position: relative;
  border-bottom: 1px solid #f1f5f9 !important;
}

.login-premium-header .modal-title {
  color: #1e293b !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  width: 100%;
}

.login-premium-header .login-sub-title {
  color: #64748b;
  font-size: 11px;
  margin-top: 5px;
}

.login-premium-header .modal-close {
  color: #64748b !important;
  background: #f1f5f9 !important;
  border-radius: 50% !important;
  width: 26px !important;
  height: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s !important;
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  border: none !important;
}

.login-premium-header .modal-close:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.login-premium-logo-wrap {
  width: 50px;
  height: 50px;
  background: rgba(99, 102, 241, 0.08) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  border: 1px solid rgba(99, 102, 241, 0.15);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08) !important;
}

.login-premium-logo-wrap svg {
  stroke: #4f46e5;
  width: 24px;
  height: 24px;
}

.login-premium-body {
  padding: 24px 22px !important;
  background: #ffffff !important;
}

.login-premium-input-group {
  position: relative;
  margin-bottom: 18px;
}

.login-premium-input-group label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.login-premium-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-premium-input-wrapper svg {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 10;
  transition: color 0.2s;
}

.login-premium-input-wrapper .form-control {
  padding-left: 38px !important;
  height: 42px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease-in-out !important;
  width: 100% !important;
}

.login-premium-input-wrapper .form-control::placeholder {
  color: #94a3b8 !important;
}

.login-premium-input-wrapper .form-control:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  background: #ffffff !important;
}

.login-premium-input-wrapper .form-control:focus + svg {
  color: #6366f1 !important;
}

.login-premium-footer {
  padding: 0 22px 26px 22px !important;
  border-top: none !important;
  display: flex;
  gap: 12px;
  background: #ffffff !important;
}

.login-premium-footer .btn {
  height: 42px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  flex: 1;
}

.login-premium-footer .btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15) !important;
  transition: all 0.2s;
  color: #ffffff !important;
}

.login-premium-footer .btn-primary:hover {
  background: linear-gradient(135deg, #7073ff, #6366f1) !important;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25) !important;
  transform: translateY(-1.5px);
}

.login-premium-footer .btn-ghost {
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #475569 !important;
}

.login-premium-footer .btn-ghost:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

.login-hint-premium {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}

