/* ============================================================
   DPDT Web Design System
   Platform Terintegrasi Pemetaan Desa 3T
   Kementerian Desa dan Pembangunan Daerah Tertinggal
   Primary: #16A34A | Theme: T-02 Forest Green | Font: Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   1. CSS Custom Properties — :root (T-02 Forest Green)
   ============================================================ */
:root {
  /* Brand */
  --color-primary:        #16A34A;
  --color-primary-hover:  #15803D;
  --color-primary-light:  #DCFCE7;
  --color-accent:         #84CC16;
  --color-accent-hover:   #65A30D;

  /* Semantic */
  --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;
  --color-purple:         #7C3AED;  --color-purple-light:  #EDE9FE;

  /* Surface — green-tinted light mode */
  --bg-page:     #F7FAF8;
  --bg-surface:  #F0F7F2;
  --bg-elevated: #E8F4EC;
  --bg-sidebar:  #052E16;
  --bg-hover:    #E8F4EC;

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

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

  /* Shadow — green-tinted */
  --shadow-xs: 0 1px 2px rgba(5,46,22,0.05);
  --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);

  /* Layout */
  --header-height: 60px;
  --sidebar-width: 240px;

  /* Z-index — urutan wajib */
  --z-sidebar:       100;
  --z-dropdown:      150;
  --z-modal:         200;
  --z-modal-content: 201;
  --z-toast:         500;

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

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

[data-theme="dark"] {
  --bg-page:        #0A1F12;
  --bg-surface:     #1A3D28;
  --bg-elevated:    #224D34;
  --bg-sidebar:     #0A1F12;
  --bg-hover:       #1A3D28;
  --text-primary:   #F0FDF4;
  --text-secondary: #86EFAC;
  --text-muted:     #4ADE80;
  --border-default: rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.16);
  --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. CSS Reset
   ============================================================ */
*, *::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; }
img { max-width: 100%; display: block; }

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ============================================================
   3. Layout & App Shell
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width var(--transition-base);
  border-right: 1px solid var(--border-default);
  position: relative;
  z-index: var(--z-sidebar);
}
.app-sidebar.collapsed { width: 60px; overflow: visible; }

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.app-header {
  height: var(--header-height);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-page);
}

@media (max-width: 640px) {
  .app-content { padding: 16px; }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  display: none;
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   4. Sidebar Components
   ============================================================ */
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  /* TANPA border-bottom — sidebar-brand dan nav adalah satu unit visual */
}

.brand-logo {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

.brand-info { flex: 1; min-width: 0; }
.brand-name { font-size: 14px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.nav-section { margin-bottom: 4px; }

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 8px 16px 4px;
  display: block;
}

.nav-section-divider {
  display: none;
  height: 1px;
  background: var(--border-default);
  margin: 4px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-left: 3px solid var(--color-primary);
}
.nav-item.active .nav-icon { color: var(--color-primary); }

.nav-icon  { width: 18px; flex-shrink: 0; text-align: center; font-size: 15px; }
.nav-label { flex: 1; }
.nav-arrow { font-size: 11px; transition: transform var(--transition-fast); }
.nav-item.open > .nav-arrow { transform: rotate(90deg); }

.nav-badge {
  font-size: 11px;
  background: var(--color-danger);
  color: white;
  border-radius: var(--radius-full);
  padding: 1px 6px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  padding: 6px 16px 6px 44px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.nav-sub-item:hover { color: white; }
.nav-sub-item.active { color: var(--color-primary); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* DPDT logout button in sidebar footer */
.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.btn-logout:hover { color: var(--color-danger); background: rgba(220,38,38,0.1); }

/* Collapsed state */
.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-arrow,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .nav-section-label,
.app-sidebar.collapsed .user-info,
.app-sidebar.collapsed .btn-logout { display: none; }

.app-sidebar.collapsed .nav-section-divider { display: block; }
.app-sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; border-left: none; }
.app-sidebar.collapsed .nav-item.active { border-left: none; }
.app-sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0; }
.app-sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 0; }
.app-sidebar.collapsed .sidebar-nav { overflow: visible; }

/* Tooltip via CSS — tanpa JS */
.app-sidebar.collapsed .nav-item { position: relative; }
.app-sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  font-size: 13px; white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
}
.app-sidebar.collapsed .nav-item:hover::after { opacity: 1; }

/* ============================================================
   5. Header Bar
   ============================================================ */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.breadcrumb-sep     { color: var(--text-muted); }
.breadcrumb-current { font-weight: 600; color: var(--text-primary); }

/* DPDT sync timestamp */
.header-sync { font-size: 12px; color: var(--text-muted); }

.bell-wrapper { position: relative; }
.bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-surface);
}

/* ============================================================
   6. Buttons (explicit height — DILARANG via padding)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}
.btn:hover   { filter: brightness(0.92); }
.btn:active  { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-xs { height: 24px; padding: 0 8px;  font-size: 11px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 16px; }
.btn-xl { height: 52px; padding: 0 24px; font-size: 16px; }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.btn-xs { width: 24px; height: 24px; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-icon.btn-lg { width: 44px; height: 44px; }

.btn-primary        { background: var(--color-primary); color: white; }
.btn-secondary      { background: transparent; border: 1px solid var(--border-default); color: var(--text-primary); }
.btn-outline        { background: transparent; border: 1px solid var(--color-primary); color: var(--color-primary); }
.btn-ghost          { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover    { background: var(--bg-hover); }
.btn-danger         { background: var(--color-danger); color: white; }
.btn-danger-outline { background: transparent; border: 1px solid var(--color-danger); color: var(--color-danger); }
.btn-success        { background: var(--color-success); color: white; }
.btn-link           { background: transparent; color: var(--color-primary); padding: 0; height: auto; text-decoration: underline; }

/* Loading state */
.btn.loading { position: relative; color: transparent; pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-secondary.loading::after,
.btn-ghost.loading::after,
.btn-outline.loading::after {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--text-primary);
}

/* ============================================================
   7. Cards
   ============================================================ */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}
.card-header-actions { display: flex; gap: 8px; align-items: center; }

.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.card-body   { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Stat Card — CANONICAL .stat-card (bukan .kpi-card) */
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  border-top: 3px solid transparent;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
/* DPDT KPI variants */
.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: 44px; height: 44px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-body  { flex: 1; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-trend { font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.trend-up   { color: var(--color-success); }
.trend-down { color: var(--color-danger);  }
.trend-flat { color: var(--text-muted);    }

/* ============================================================
   8. Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.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-purple  { background: var(--color-purple-light);  color: var(--color-purple);  }
.badge-gray    { background: var(--bg-elevated);         color: var(--text-muted);    }

.badge-outline {
  background: transparent;
  border: 1px solid currentColor;
}

.badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Role badges canonical */
.badge-role-admin   { background: #FEE2E2; color: #991B1B; }
.badge-role-manager { background: #DBEAFE; color: #1E40AF; }
.badge-role-user    { background: #D1FAE5; color: #065F46; }

/* DPDT role badges */
.badge-role-pendamping  { background: #D1FAE5; color: #065F46; }
.badge-role-kepala-desa { background: #DCFCE7; color: #15803D; }
.badge-role-sekdes      { background: #CFFAFE; color: #0E7490; }
.badge-role-dinas-pmd   { background: #DBEAFE; color: #1E40AF; }
.badge-role-kemendes    { background: #EDE9FE; color: #5B21B6; }

/* DPDT IDM level badges */
.badge-idm-mandiri           { background: #D1FAE5; color: #065F46; }
.badge-idm-maju              { background: #CFFAFE; color: #0E7490; }
.badge-idm-berkembang        { background: #DCFCE7; color: #15803D; }
.badge-idm-tertinggal        { background: #FEF3C7; color: #92400E; }
.badge-idm-sangat-tertinggal { background: #FEE2E2; color: #991B1B; }

/* DPDT IDM submission workflow badges */
.badge-draft     { background: var(--bg-elevated);         color: var(--text-muted);    }
.badge-submitted { background: #DBEAFE;                    color: #1E40AF;              }
.badge-verified  { background: var(--color-warning-light); color: #92400E;              }
.badge-approved  { background: var(--color-success-light); color: var(--color-success); }
.badge-rejected  { background: var(--color-danger-light);  color: var(--color-danger);  }

/* ============================================================
   9. Icon Color 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);    }

[data-theme="dark"] .icon-primary { background: rgba(22,163,74,0.15);  color: #4ADE80; }
[data-theme="dark"] .icon-success { background: rgba(22,163,74,0.15);  color: #4ADE80; }
[data-theme="dark"] .icon-warning { background: rgba(217,119,6,0.15);  color: #FCD34D; }
[data-theme="dark"] .icon-danger  { background: rgba(220,38,38,0.15);  color: #FCA5A5; }
[data-theme="dark"] .icon-info    { background: rgba(8,145,178,0.15);  color: #67E8F9; }

/* ============================================================
   10. Avatar
   ============================================================ */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ============================================================
   11. Page Header
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-sub   { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

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

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-back:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .page-header { flex-direction: column; gap: 12px; }
  .page-header-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   12. Tables
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg-surface);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr.selected { background: var(--color-primary-light); }

.col-no     { width: 48px; text-align: center; }
.col-action { width: 80px; }
.sortable   { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text-primary); }
.sort-icon  { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.table-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.empty-row td { padding: 0; border: none; }
.table-empty  { text-align: center; padding: 48px 24px; }
.table-empty-icon  { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; }
.table-empty-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.table-empty-sub   { font-size: 13px; color: var(--text-muted); }

/* Pagination — CANONICAL .pagination-btn (bukan .page-btn) */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.pagination-btn:hover   { background: var(--bg-elevated); }
.pagination-btn.active  { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.pagination-ellipsis    { padding: 0 6px; color: var(--text-muted); }
.pagination-info { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   13. Forms
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  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(--border-focus);
  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; }
.form-control-lg { height: 44px; font-size: 15px; }

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

.form-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 36px 0 12px;
  font-size: 14px;
  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;
  cursor: pointer;
}
.form-select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--color-primary-light); outline: none; }
.form-select-sm { height: 30px; font-size: 13px; }

.form-error { font-size: 12px; color: var(--color-danger); }
.form-hint  { font-size: 12px; color: var(--text-muted); }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-label { font-size: 14px; cursor: pointer; }

.form-row   { display: flex; gap: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 640px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

.input-group { display: flex; position: relative; align-items: center; }
.input-prefix {
  position: absolute; left: 12px;
  color: var(--text-muted); font-size: 14px;
  pointer-events: none;
}
.input-suffix {
  position: absolute; right: 12px;
  color: var(--text-muted); font-size: 14px;
}
.input-group .form-control { padding-left: 36px; }
.input-group .form-control.has-suffix { padding-right: 36px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 10px;
  color: var(--text-muted); font-size: 13px;
  pointer-events: none;
}
.search-box .form-control { padding-left: 32px; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  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: 12px;
  transition: background var(--transition-base);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  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(20px); }

/* ============================================================
   14. Modal (z-index WAJIB > sidebar)
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
/* toggle class "open" — BUKAN "active" */
.modal-overlay.open { display: flex; }

.modal {
  position: relative;
  z-index: var(--z-modal-content);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  max-width: 560px;
  animation: modal-in 0.2s ease;
}
.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; } /* DPDT: IDM form 67 indikator */

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.modal-close { color: var(--text-muted); }
.modal-close:hover { color: var(--text-primary); }

.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 95vh; }
}

/* ============================================================
   15. Dropdown (z-index WAJIB > sidebar, < modal)
   ============================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 4px);
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
}
.dropdown-menu.open { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--color-danger); }

.dropdown-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border-default);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-default);
  margin: 4px 0;
}

/* ============================================================
   16. Toast
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-lg);
  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: 14px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.toast-close   { color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }

/* ============================================================
   17. Tabs
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.tab-item:hover  { color: var(--text-primary); }
.tab-item.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 500; }

.tab-count {
  font-size: 11px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  margin-left: 4px;
  color: var(--text-muted);
}
.tab-item.active .tab-count { background: var(--color-primary-light); color: var(--color-primary); }

.tab-content { }
.tab-pane         { display: none; }
.tab-pane.active  { display: block; }

/* ============================================================
   18. Alerts
   ============================================================ */
.alert {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border-left: 4px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-icon  { flex-shrink: 0; margin-top: 1px; }
.alert-body  { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }

.alert-info    { background: var(--color-info-light);    border-left-color: var(--color-info);    color: #1E40AF; }
.alert-success { background: var(--color-success-light); border-left-color: var(--color-success); color: #065F46; }
.alert-warning { background: var(--color-warning-light); border-left-color: var(--color-warning); color: #92400E; }
.alert-danger  { background: var(--color-danger-light);  border-left-color: var(--color-danger);  color: #991B1B; }

/* ============================================================
   19. Progress Bar
   ============================================================ */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  /* width via JS: el.style.width = pct + '%' */
}
.progress-fill.success { background: var(--color-success); }
.progress-fill.warning { background: var(--color-warning); }
.progress-fill.danger  { background: var(--color-danger);  }

/* ============================================================
   20. Empty State, Skeleton, Timeline, Filter Bar
   ============================================================ */
/* 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); }

/* Skeleton */
@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-text   { height: 14px; border-radius: var(--radius-sm); }
.skeleton-title  { height: 20px; width: 60%; border-radius: var(--radius-sm); }
.skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-default);
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-dot {
  position: absolute;
  left: -21px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  top: 2px;
}
.timeline-dot.active { background: var(--color-primary); border-color: var(--color-primary); }
.timeline-content { }
.timeline-title   { font-weight: 600; font-size: 14px; }
.timeline-time    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  background: var(--bg-surface);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.filter-chip:hover  { background: var(--bg-elevated); }
.filter-chip.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* Chart container */
.chart-container { position: relative; width: 100%; }

/* ============================================================
   21. Interactive States
   ============================================================ */
.nav-item:hover       { background: rgba(255,255,255,0.06); }
table tbody tr:hover  { background: var(--bg-hover); }
.dropdown-item:hover  { background: var(--bg-hover); }

.btn:active { transform: scale(0.98); }

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.nav-item:focus-visible,
.tab-item:focus-visible,
.pagination-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

table tbody tr.selected { background: var(--color-primary-light); }

.btn:disabled,
.form-control:disabled,
.form-select:disabled,
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   22. Animations & Keyframes
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

.animate-fade   { animation: fade-in 0.2s ease; }
.animate-spin   { animation: spin 1s linear infinite; }
.animate-pulse  { animation: pulse 2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   23. Scrollbar
   ============================================================ */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ============================================================
   24. Utility Classes
   ============================================================ */

/* Flex & Grid */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.grid         { display: grid; gap: 20px; }
.grid-cols-2  { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3  { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4  { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5  { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 { grid-template-columns: 1fr; }
}

/* Spacing */
.gap-1 { gap: 4px;  } .gap-2 { gap: 8px;  } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }

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

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

/* Typography */
.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; } .text-2xl  { font-size: 20px; }
.text-3xl  { font-size: 24px; }

.font-normal   { font-weight: 400; }
.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-success   { color: var(--color-success);  }
.text-warning   { color: var(--color-warning);  }
.text-danger    { color: var(--color-danger);   }
.text-center { text-align: center; }
.text-right  { text-align: right;  }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase   { text-transform: uppercase; }
.capitalize  { text-transform: capitalize; }
.link        { color: var(--color-primary); cursor: pointer; }
.link:hover  { text-decoration: underline; }

/* Visual */
.w-full  { width: 100%;  }
.h-full  { height: 100%; }
.min-w-0 { min-width: 0; }

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

.border        { border: 1px solid var(--border-default); }
.border-top    { border-top: 1px solid var(--border-default); }
.border-bottom { border-bottom: 1px solid var(--border-default); }

.bg-surface { background: var(--bg-surface); }
.bg-page    { background: var(--bg-page);    }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.overflow-hidden  { overflow: hidden; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-y-scroll { overflow-y: scroll; }
.cursor-pointer   { cursor: pointer; }
.hidden  { display: none; }
.block   { display: block; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ============================================================
   25. DPDT Domain Components
   ============================================================ */

/* 25.1 IDM Score Ring */
.idm-score-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid var(--color-primary);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.idm-score-value {
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.idm-score-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Dimensi grid */
.dimensi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.dimensi-card {
  background: var(--bg-page);
  border: 1px solid var(--border-default);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 12px;
  text-align: center;
}
.dimensi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}
.dimensi-score {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 4px 0 2px;
  line-height: 1;
}
.dimensi-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* 25.2 Dana Desa Realisasi */
.realisasi-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 80px;
}
.realisasi-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  transition: width 0.3s ease;
}
.realisasi-fill.low  { background: var(--color-danger);  }
.realisasi-fill.mid  { background: var(--color-warning); }
.realisasi-fill.high { background: var(--color-success); }

/* Rupiah currency */
.rupiah { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.rupiah-lg { font-size: 22px; 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); }

/* 25.3 IDM Form Indikator */
.indikator-section { margin-bottom: 24px; }
.indikator-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 12px;
}
.indikator-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-default);
}
.indikator-row:last-child { border-bottom: none; }
.indikator-label {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}
.indikator-no {
  font-size: 11px;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}

/* 25.4 Peta IDM (GIS) */
.map-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-default);
}

.map-legend {
  position: absolute;
  bottom: 24px; left: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  z-index: 10;
  min-width: 180px;
}
.map-legend-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
  color: var(--text-primary);
}
.map-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-dot.mandiri           { background: #16A34A; }
.map-dot.maju              { background: #0891B2; }
.map-dot.berkembang        { background: #15803D; }
.map-dot.tertinggal        { background: #D97706; }
.map-dot.sangat-tertinggal { background: #DC2626; }

.map-controls {
  position: absolute;
  top: 12px; right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.map-filter {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* 25.5 Kode desa */
.desa-kode {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  letter-spacing: 0.5px;
}

/* ============================================================
   Login Page — standalone layout
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px;
  flex-shrink: 0;
}
.login-logo-text { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.login-logo-sub  { font-size: 12px; color: var(--text-muted); }
.login-title     { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.login-sub       { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ============================================================
   Header User Dropdown
   ============================================================ */
.header-user-menu {
  position: relative;
  display: flex;
  align-items: center;
}
.header-user-menu .avatar {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.header-user-menu .avatar:hover { opacity: 0.85; }

.header-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 232px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1200;
  overflow: hidden;
  animation: hud-in 0.15s ease;
}
.header-user-dropdown.open { display: block; }

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

.hud-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-sidebar);
}
.hud-info .avatar { flex-shrink: 0; }
.hud-name  { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; }
.hud-role  { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 1px; }
.hud-kab   { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 1px; }

.hud-divider { height: 1px; background: var(--border-default); margin: 4px 0; }

.hud-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s;
}
.hud-item:hover { background: var(--bg-hover); }
.hud-item i { width: 16px; text-align: center; color: var(--text-muted); flex-shrink: 0; }
.hud-item-danger { color: var(--color-danger); }
.hud-item-danger i { color: var(--color-danger); }
.hud-item-danger:hover { background: #FEF2F2; }
