/* ============================================================
   DPDT Mobile CSS — Fase 4C
   Platform Terintegrasi Pemetaan Desa 3T (DPDT)
   Tema: T-02 Forest Green | Primary: #16A34A
   ============================================================ */

/* ============================================================
   1. CSS Variables
   ============================================================ */
:root {
  /* Warna brand — T-02 Forest Green */
  --color-primary:       #16A34A;
  --color-primary-hover: #15803D;
  --color-primary-light: #DCFCE7;

  /* Accent */
  --color-accent:        #84CC16;
  --color-accent-hover:  #65A30D;

  /* Semantic colors */
  --color-success:       #16A34A;
  --color-success-light: #DCFCE7;
  --color-warning:       #D97706;
  --color-warning-light: #FEF3C7;
  --color-danger:        #DC2626;
  --color-danger-light:  #FEE2E2;
  --color-info:          #0891B2;
  --color-info-light:    #CFFAFE;

  /* Surface tokens — light mode */
  --bg-page:             #F7FAF8;
  --bg-surface:          #F0F7F2;
  --bg-elevated:         #E8F4EC;

  /* Text tokens */
  --text-primary:        #052E16;
  --text-secondary:      #3D6B4F;
  --text-muted:          #86A893;

  /* Border */
  --border-default:      #D1E8D8;
  --border-strong:       #A7D3B4;
  --border-focus:        #16A34A;

  /* Layout */
  --header-height:       56px;
  --nav-height:          64px;

  /* Radius */
  --radius-sm:           4px;
  --radius-md:           8px;
  --radius-lg:           12px;
  --radius-full:         9999px;

  /* Shadow */
  --shadow-sm:           0 1px 3px rgba(5,46,22,0.08);
  --shadow-md:           0 4px 12px rgba(5,46,22,0.12);
  --shadow-lg:           0 8px 24px rgba(5,46,22,0.16);

  /* Z-index */
  --z-overlay:           100;
  --z-sheet:             200;
  --z-toast:             300;

  /* Transition */
  --transition-fast:     150ms ease;
  --transition-base:     250ms ease;
}

[data-theme="dark"] {
  --bg-page:             #0A1F12;
  --bg-surface:          #1A3D28;
  --bg-elevated:         #224D34;
  --text-primary:        #F0FDF4;
  --text-secondary:      #86EFAC;
  --text-muted:          #4ADE80;
  --border-default:      #1A3D28;
  --border-strong:       rgba(255,255,255,0.15);
  --border-focus:        #22C55E;
  --color-primary-light: #14532D;
  --shadow-sm:           0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:           0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:           0 8px 24px rgba(0,0,0,0.5);
}

/* ============================================================
   2. Reset + Body Sizing
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Latar desktop */
html {
  min-height: 100%;
  background: #E5E7EB;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] html {
  background: #374151;
}

/* Body = panel HP */
body {
  width: 100%;
  max-width: 430px;
  min-width: 320px;
  height: 100svh;
  height: 100vh; /* fallback */
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* CRITICAL — mencegah display:flex menimpa hidden attribute */
[hidden] { display: none !important; }

/* ============================================================
   3. Layout — View Layer
   ============================================================ */
.view-layer {
  display: flex;
  flex-direction: column;
  height: 100svh;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: var(--bg-page);
}

/* ============================================================
   4. Header
   ============================================================ */
.mobile-header {
  flex-shrink: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  /* TANPA position:sticky */
}

.mobile-header-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  color: var(--text-primary);
  border-radius: var(--radius-full);
}
.mobile-back-btn:active { background: var(--bg-elevated); }

.header-greeting { display: flex; flex-direction: column; flex: 1; }
.greeting-text { font-size: 12px; color: var(--text-muted); }

.bell-wrapper { position: relative; }
.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* ============================================================
   5. Content Area
   ============================================================ */
.mobile-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.login-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

/* ============================================================
   6. Bottom Nav
   ============================================================ */
.mobile-bottom-nav {
  flex-shrink: 0;
  height: var(--nav-height);
  display: flex;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  padding-bottom: env(safe-area-inset-bottom);
  /* TANPA position:fixed */
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.mobile-nav-item.active { color: var(--color-primary); }
.mobile-nav-item i { font-size: 20px; }
.mobile-nav-item:active { opacity: 0.7; }

/* ============================================================
   7. KPI Grid + Stat Cards
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  border-top: 3px solid transparent;
}
.stat-primary { border-top-color: var(--color-primary); }
.stat-success  { border-top-color: var(--color-success); }
.stat-warning  { border-top-color: var(--color-warning); }
.stat-danger   { border-top-color: var(--color-danger);  }
.stat-info     { border-top-color: var(--color-info);    }

.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  font-size: 16px;
}
.stat-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.stat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-trend { font-size: 11px; margin-top: 4px; display: flex; align-items: center; gap: 3px; }
.trend-up   { color: var(--color-success); }
.trend-down { color: var(--color-danger);  }
.trend-flat { color: var(--text-muted);    }

/* ============================================================
   8. Icon Helpers
   ============================================================ */
.icon-primary { background: var(--color-primary-light); color: var(--color-primary); }
.icon-success { background: var(--color-success-light); color: var(--color-success); }
.icon-warning { background: var(--color-warning-light); color: var(--color-warning); }
.icon-danger  { background: var(--color-danger-light);  color: var(--color-danger);  }
.icon-info    { background: var(--color-info-light);    color: var(--color-info);    }
.icon-muted   { background: var(--bg-elevated);         color: var(--text-muted);    }

.icon-sm { width: 32px; height: 32px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.icon-md { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.icon-lg { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* ============================================================
   9. List Items
   ============================================================ */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-default);
  min-height: 64px;
  cursor: pointer;
}
.list-item:active { background: var(--bg-surface); }
.list-item:last-child { border-bottom: none; }

.list-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.list-body { flex: 1; min-width: 0; margin: 0 12px; }

.list-title {
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.list-meta {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px;
  flex-shrink: 0;
}

/* ============================================================
   10. Card
   ============================================================ */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
  margin-bottom: 12px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-default);
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-body  { padding: 16px; }
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-elevated);
}

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-title  { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }

/* ============================================================
   11. Search Bar
   ============================================================ */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-default);
}
.search-icon { color: var(--text-muted); flex-shrink: 0; font-size: 14px; }
.search-input { flex: 1; background: none; border: none; outline: none; font-size: 14px; color: var(--text-primary); }
.search-input::placeholder { color: var(--text-muted); }

/* ============================================================
   12. Chip Strip + Chips
   ============================================================ */
.chip-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; padding-bottom: 4px; }
.chip-strip::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: 13px; cursor: pointer;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-surface);
}
.chip.active  { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.chip:active  { opacity: 0.8; }

/* ============================================================
   13. Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.btn:active  { transform: scale(0.97); opacity: 0.9; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-sm  { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs  { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-full { width: 100%; }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-full);
  color: var(--text-primary);
}
.btn-icon:active { background: var(--bg-elevated); }

.btn-primary   { background: var(--color-primary); color: white; }
.btn-secondary { background: transparent; border: 1px solid var(--border-default); color: var(--text-primary); }
.btn-danger    { background: var(--color-danger);  color: white; }
.btn-success   { background: var(--color-success); color: white; }
.btn-ghost     { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-surface); }

.btn.loading { position: relative; color: transparent; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================================
   14. FAB — Floating Action Button
   ============================================================ */
.fab {
  position: absolute;
  bottom: calc(var(--nav-height) + 16px);
  right: 16px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.fab:active { transform: scale(0.95); }

/* ============================================================
   15. Bottom Sheet
   ============================================================ */
.sheet-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-overlay);
  align-items: flex-end;
}
.sheet-overlay.open { display: flex; }

.bottom-sheet {
  width: 100%; max-width: 430px;
  background: var(--bg-surface);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  z-index: var(--z-sheet);
  max-height: 80svh; overflow-y: auto;
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 20px;
}
.sheet-title   { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.sheet-desc    { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

/* ============================================================
   16. Forms
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%; height: 44px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-control.error { border-color: var(--color-danger); }
.form-control:disabled { opacity: 0.5; background: var(--bg-surface); cursor: not-allowed; }

textarea.form-control { height: auto; padding: 12px; resize: vertical; }

.form-select {
  width: 100%; height: 44px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }

.form-error { font-size: 12px; color: var(--color-danger); margin-top: 4px; display: block; }

/* ============================================================
   17. Toggle Switch (Dark Mode — HANYA di profil.html)
   ============================================================ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px; height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0; width: 0; height: 0; position: absolute;
}
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 13px;
  transition: background var(--transition-base);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ============================================================
   18. Setting Row
   ============================================================ */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-default);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { display: flex; align-items: center; gap: 12px; }
.setting-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.setting-sub   { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   19. Badge
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: #92400E; }
.badge-danger  { background: var(--color-danger-light);  color: var(--color-danger);  }
.badge-info    { background: var(--color-info-light);    color: var(--color-info);    }
.badge-gray    { background: var(--bg-elevated);         color: var(--text-muted);    }
.badge-primary { background: var(--color-primary-light); color: var(--color-primary); } /* [DPDT] IDM Berkembang */

/* Badge Status IDM — 5 level Permendesa No. 9/2024 — [DPDT] */
.badge-idm-mandiri           { background: var(--color-success-light); color: var(--color-success); }    /* IDM ≥ 0.815 */
.badge-idm-maju              { background: var(--color-info-light);    color: var(--color-info);    }    /* 0.707–0.814 */
.badge-idm-berkembang        { background: var(--color-primary-light); color: var(--color-primary); }    /* 0.600–0.706 */
.badge-idm-tertinggal        { background: var(--color-warning-light); color: #92400E;              }    /* 0.491–0.599 */
.badge-idm-sangat-tertinggal { background: var(--color-danger-light);  color: var(--color-danger);  }    /* < 0.491 */

/* Badge Status Submission — IDM lifecycle DRAFT→SUBMITTED→VERIFIED→APPROVED→REJECTED — [DPDT] */
.badge-draft     { background: var(--bg-elevated);         color: var(--text-muted);    }
.badge-submitted { background: var(--color-warning-light); color: #92400E;              }
.badge-verified  { background: var(--color-info-light);    color: var(--color-info);    }
.badge-approved  { background: var(--color-success-light); color: var(--color-success); }
.badge-rejected  { background: var(--color-danger-light);  color: var(--color-danger);  }

/* Badge Sync Status — offline-first Dexie.js — [DPDT] */
.badge-local  { background: #FEF3C7; color: #B45309; }
.badge-synced { background: var(--color-success-light); color: var(--color-success); }

/* Badge Role — [DPDT] */
.badge-role-pendamping  { background: var(--color-primary-light); color: var(--color-primary); }
.badge-role-kepala-desa { background: var(--color-info-light);    color: var(--color-info);    }
.badge-role-dinas-pmd   { background: var(--color-warning-light); color: #92400E;              }
.badge-role-kemendes    { background: var(--bg-elevated);         color: var(--text-secondary); }

/* ============================================================
   20. Alert Inline
   ============================================================ */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.5;
  margin-bottom: 12px;
}
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--color-success-light); color: #065F46; }
.alert-warning { background: var(--color-warning-light); color: #92400E; }
.alert-danger  { background: var(--color-danger-light);  color: #991B1B; }
.alert-info    { background: var(--color-info-light);    color: #1E40AF; }

/* ============================================================
   21. Toast
   ============================================================ */
.toast-container {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  width: calc(100% - 32px);
  max-width: 398px;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid transparent;
  pointer-events: auto;
  animation: toast-in 0.25s ease;
}
.toast-success { border-left-color: var(--color-success); }
.toast-error   { border-left-color: var(--color-danger);  }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info    { border-left-color: var(--color-info);    }
.toast-icon    { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.toast-body    { flex: 1; min-width: 0; }
.toast-title   { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   22. Skeleton Loading
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line    { height: 14px; margin-bottom: 6px; width: 100%; }
.skeleton-line-lg { width: 75%; }
.skeleton-line-md { width: 55%; }
.skeleton-line-sm { width: 35%; }
.skeleton-avatar  { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   23. Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center;
}
.empty-icon  { font-size: 48px; color: var(--text-muted); margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-sub   { font-size: 14px; color: var(--text-muted); }

/* ============================================================
   24. Animations
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-fade { animation: fade-in 0.2s ease; }

/* ============================================================
   25. Scrollbar
   ============================================================ */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border-strong); border-radius: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ============================================================
   26. Utility Classes
   ============================================================ */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-1        { flex: 1; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: 4px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }

.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }
.text-xl   { font-size: 18px; }

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-danger    { color: var(--color-danger); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }

.p-0  { padding: 0; }
.p-2  { padding: 8px; }
.p-3  { padding: 12px; }
.p-4  { padding: 16px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }

.flex-shrink-0  { flex-shrink: 0; }
.cursor-pointer { cursor: pointer; }
.border-b { border-bottom: 1px solid var(--border-default); }
.border-r { border-right: 1px solid var(--border-default); }

.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }

.hidden { display: none; }
.block  { display: block; }

/* ============================================================
   27. DPDT-Specific Classes [DPDT]
   ============================================================ */

/* IDM Score Ring — implementasi via SVG stroke-dashoffset di HTML */
.idm-score-ring { /* SVG ring — lihat HTML untuk implementasi */ }

/* IDM Dimensi Card (IKS / IKE / IKL) */
.dimensi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border-left: 3px solid var(--color-primary);
  margin-bottom: 8px;
}
.dimensi-label  { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.dimensi-value  { font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.dimensi-sub    { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* IDM Form Tab Bar (IKS / IKE / IKL) */
.idm-tab-bar    { display: flex; gap: 0; border-bottom: 1px solid var(--border-default); margin-bottom: 16px; }
.idm-tab        { flex: 1; padding: 10px 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.idm-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* IDM Indikator Item dalam form */
.indikator-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-default);
}
.indikator-kode { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.indikator-nama { font-size: 14px; font-weight: 500; color: var(--text-primary); margin: 2px 0 8px; }

/* Sync Status Bar */
.sync-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--color-warning-light);
  font-size: 12px;
  color: #92400E;
  gap: 8px;
}
.sync-bar.synced {
  background: var(--color-success-light);
  color: #065F46;
}
.sync-bar-text { flex: 1; }
.sync-bar-btn  { font-size: 12px; font-weight: 600; color: inherit; text-decoration: underline; cursor: pointer; }

/* Peta IDM Filter Controls */
.map-filter-bar {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  z-index: 400;
  display: flex; gap: 8px;
}
.map-filter-select {
  flex: 1;
  height: 36px; padding: 0 10px;
  background: var(--bg-page);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  appearance: none;
  box-shadow: var(--shadow-sm);
}

/* Dana Desa — Rupiah Amount Display */
.rupiah-lg { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.rupiah-md { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.rupiah-sm { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* Realisasi Progress Bar */
.realisasi-bar-wrap { height: 8px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; margin: 6px 0; }
.realisasi-bar      { height: 100%; border-radius: var(--radius-full); background: var(--color-primary); transition: width 0.4s ease; }
.realisasi-bar.low  { background: var(--color-danger);  }   /* < 50% */
.realisasi-bar.mid  { background: var(--color-warning); }   /* 50–79% */
.realisasi-bar.high { background: var(--color-success); }   /* ≥ 80% */

/* ============================================================
   Login Page Specific
   ============================================================ */
.login-logo {
  width: 72px; height: 72px;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  font-size: 32px;
  color: white;
}
.login-title    { font-size: 22px; font-weight: 800; color: var(--text-primary); text-align: center; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 32px; }
.login-form     { width: 100%; }
.login-footer   { margin-top: 24px; text-align: center; font-size: 12px; color: var(--text-muted); }

/* ============================================================
   Profile Avatar
   ============================================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
}

/* ============================================================
   Map Container (Leaflet wrapper)
   ============================================================ */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#leaflet-map {
  width: 100%;
  height: 100%;
}
.map-legend {
  position: absolute;
  bottom: 24px; left: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  z-index: 400;
  font-size: 11px;
}
.legend-item { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
