/* ============================================================
   SISTEM TOOLS - Premium Dark Theme CSS
   ============================================================ */

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

/* ── Root Variables ─────────────────────────────────────── */
:root {
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #0f1628;
  --bg-card:       #131929;
  --bg-card-hover: #1a2236;
  --bg-sidebar:    #0c1020;

  --accent-1:      #3d7fff;   /* Blue */
  --accent-2:      #00d4aa;   /* Teal */
  --accent-3:      #f59e0b;   /* Amber */
  --accent-danger: #ef4444;
  --accent-success:#10b981;
  --accent-warning:#f59e0b;
  --accent-purple: #8b5cf6;

  --text-primary:  #e8eaf6;
  --text-secondary:#8892b0;
  --text-muted:    #4a5568;
  --text-inverse:  #0a0e1a;

  --border:        rgba(61, 127, 255, 0.12);
  --border-hover:  rgba(61, 127, 255, 0.35);

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:     0 8px 48px rgba(0,0,0,0.6);
  --shadow-glow:   0 0 30px rgba(61, 127, 255, 0.15);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Tema Terang ────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg-primary:    #f4f6fb;
  --bg-secondary:  #eaeef7;
  --bg-card:       #ffffff;
  --bg-card-hover: #f1f4fb;
  --bg-sidebar:    #ffffff;

  --accent-1:      #2563eb;
  --accent-2:      #00a389;
  --accent-3:      #d97706;
  --accent-danger: #dc2626;
  --accent-success:#059669;
  --accent-warning:#d97706;
  --accent-purple: #7c3aed;

  --text-primary:  #131a2c;
  --text-secondary:#5b6478;
  --text-muted:    #94a0b8;
  --text-inverse:  #ffffff;

  --border:        rgba(37, 99, 235, 0.14);
  --border-hover:  rgba(37, 99, 235, 0.35);

  --shadow-sm:     0 2px 8px rgba(30,41,59,0.08);
  --shadow-md:     0 4px 24px rgba(30,41,59,0.10);
  --shadow-lg:     0 8px 48px rgba(30,41,59,0.14);
  --shadow-glow:   0 0 30px rgba(37, 99, 235, 0.12);
}
:root[data-theme="light"] table.sticky-act thead th:last-child { background: #eef1f8; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cbd3e3; }

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(61, 127, 255, 0.4);
  flex-shrink: 0;
}

.logo-text h1 {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.logo-text span {
  font-size: 11px; color: var(--text-secondary);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-subgroup-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-muted);
  padding: 6px 12px 2px 34px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(61, 127, 255, 0.1);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(61, 127, 255, 0.2), rgba(0, 212, 170, 0.1));
  color: var(--accent-1);
  border: 1px solid rgba(61, 127, 255, 0.2);
}

.nav-item.active .nav-icon { color: var(--accent-1); }

.nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

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

.nav-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  justify-content: space-between;
  user-select: none;
}

.nav-group-header:hover {
  background: rgba(61, 127, 255, 0.08);
  color: var(--text-primary);
}

.nav-group-header.open { color: var(--text-primary); }

.nav-group-header .left {
  display: flex; align-items: center; gap: 10px;
}

.nav-arrow {
  font-size: 10px;
  transition: transform var(--transition);
}

.nav-group-header.open .nav-arrow {
  transform: rotate(90deg);
}

.nav-submenu {
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
}

.nav-submenu.open {
  max-height: 400px;
  opacity: 1;
}

.nav-subitem {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 38px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  transition: all var(--transition);
  margin-bottom: 1px;
}

.nav-subitem:hover {
  background: rgba(61, 127, 255, 0.08);
  color: var(--text-secondary);
}

.nav-subitem.active {
  color: var(--accent-2);
  background: rgba(0, 212, 170, 0.08);
}

.nav-subitem::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-info {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Main Content ───────────────────────────────────────── */
.main-content {
  min-width: 0;
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: rgba(15, 22, 40, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex; align-items: center; gap: 16px;
}

.topbar-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}

.topbar-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-breadcrumb .sep { color: var(--text-muted); }

.topbar-right {
  display: flex; align-items: center; gap: 12px;
}

.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(61, 127, 255, 0.1);
  border: 1px solid rgba(61, 127, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-1);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.topbar-btn:hover {
  background: rgba(61, 127, 255, 0.2);
  border-color: var(--accent-1);
}

/* ── Page Content ───────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Stat Cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--accent-1));
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.stat-value {
  font-size: 32px; font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.stat-icon {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 24px;
  opacity: 0.15;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

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

.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

.card-actions {
  display: flex; align-items: center; gap: 8px;
}

.card-body { padding: 20px; }

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Form Controls ──────────────────────────────────────── */
.form-control, .form-select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  padding: 8px 12px;
  transition: all var(--transition);
  width: 100%;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(61, 127, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(61, 127, 255, 0.12);
}

.form-control::placeholder { color: var(--text-muted); }

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

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

.form-label.required::after {
  content: ' *';
  color: var(--accent-danger);
}

.input-group {
  position: relative;
  display: flex; align-items: stretch;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }

/* ── Search Input ───────────────────────────────────────── */
.search-wrap {
  position: relative;
  flex: 1; min-width: 200px;
}

.search-wrap .form-control {
  padding-left: 36px;
}

.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}
.btn-primary:hover {
  background: #5590ff;
  box-shadow: 0 4px 16px rgba(61, 127, 255, 0.4);
}

.btn-success {
  background: var(--accent-success);
  color: #fff;
  border-color: var(--accent-success);
}
.btn-success:hover {
  background: #0ea572;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-danger {
  background: var(--accent-danger);
  color: #fff;
  border-color: var(--accent-danger);
}
.btn-danger:hover { background: #dc2626; }

.btn-warning {
  background: var(--accent-warning);
  color: #000;
  border-color: var(--accent-warning);
}
.btn-warning:hover { background: #d97706; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-outline-primary {
  background: transparent;
  color: var(--accent-1);
  border-color: rgba(61, 127, 255, 0.4);
}
.btn-outline-primary:hover {
  background: rgba(61, 127, 255, 0.1);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; aspect-ratio: 1; }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: rgba(61, 127, 255, 0.06);
  color: var(--text-secondary);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(61, 127, 255, 0.05);
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: rgba(61, 127, 255, 0.04);
}

.td-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-2);
}

.td-secondary { color: var(--text-secondary); font-size: 12px; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.3px;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-blue   { background: rgba(61,127,255,0.15); color: var(--accent-1); }
.badge-teal   { background: rgba(0,212,170,0.15);  color: var(--accent-2); }
.badge-amber  { background: rgba(245,158,11,0.15); color: var(--accent-3); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--accent-danger); }
.badge-green  { background: rgba(16,185,129,0.15); color: var(--accent-success); }
.badge-purple { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.badge-gray   { background: rgba(255,255,255,0.08); color: var(--text-secondary); }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center;
  padding: 16px;
}

.page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  background: transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.page-link:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  background: rgba(61, 127, 255, 0.08);
}

.page-link.active {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: #fff;
}

.page-info {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 8px;
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.modal-title {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 10px;
}

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(239,68,68,0.15);
  color: var(--accent-danger);
}

.modal-body { padding: 24px; }

.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── Form Grid ──────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* ── Alert / Toast ──────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-success {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.3);
  color: #6ee7b7;
}

.alert-danger {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

.alert-warning {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.3);
  color: #fcd34d;
}

.alert-info {
  background: rgba(61,127,255,0.1);
  border-color: rgba(61,127,255,0.3);
  color: #93c5fd;
}

/* Toast */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  min-width: 300px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
}

.toast.success { border-left: 3px solid var(--accent-success); }
.toast.error   { border-left: 3px solid var(--accent-danger); }
.toast.warning { border-left: 3px solid var(--accent-warning); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(120%); }
}

/* ── File Upload Zone ───────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(61,127,255,0.02);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-1);
  background: rgba(61,127,255,0.06);
}

.upload-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.upload-zone h3 {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upload-zone p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Map Container ──────────────────────────────────────── */
.map-container {
  height: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.map-container.full-height {
  height: calc(100vh - var(--topbar-height) - 200px);
}

#main-map, #analisis-map, #pendataan-map {
  height: 100%;
  width: 100%;
  background: #1a2030;
}

/* Leaflet dark override */
.leaflet-container {
  background: #1a2030 !important;
}

.leaflet-tile-pane { filter: brightness(0.8) saturate(0.9); }

.leaflet-popup-content-wrapper {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-hover) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip { background: var(--bg-secondary) !important; }

.leaflet-popup-content { color: var(--text-primary); font-family: 'Inter', sans-serif; }

/* Custom marker */
.custom-marker {
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ── Map Controls (overlay) ─────────────────────────────── */
.map-overlay {
  position: absolute;
  top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 1000;
}

.map-legend {
  position: absolute;
  bottom: 30px; left: 16px;
  background: rgba(15,22,40,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  z-index: 1000;
  font-size: 12px;
}

.legend-item {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Survey Form ────────────────────────────────────────── */
.survey-form-header {
  background: linear-gradient(135deg, rgba(61,127,255,0.15), rgba(0,212,170,0.08));
  border: 1px solid rgba(61,127,255,0.2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.survey-form-header .form-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-2);
  margin-bottom: 6px;
}

.survey-form-header h2 {
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.data-item label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.data-item .value {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}

.question-card:hover { border-color: var(--border-hover); }

.question-card.answered { border-color: rgba(0,212,170,0.25); }

.question-num {
  font-size: 11px; font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.question-text {
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.radio-group {
  display: flex; flex-direction: column; gap: 8px;
}

.radio-item {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}

.radio-item input[type="radio"] {
  accent-color: var(--accent-1);
  width: 15px; height: 15px;
}

.radio-item span {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.radio-item:has(input:checked) span { color: var(--text-primary); }

/* ── Print Styles ───────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print, .btn, .card-actions { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: white !important; color: black !important; }
  .card {
    border: 1px solid #ccc !important;
    background: white !important;
    break-inside: avoid;
  }
}

/* ── Dashboard Specific ─────────────────────────────────── */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(61,127,255,0.15) 0%, rgba(0,212,170,0.08) 50%, rgba(139,92,246,0.06) 100%);
  border: 1px solid rgba(61,127,255,0.2);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(61,127,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: 26px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.hero-subtitle {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px; color: var(--text-secondary);
}

/* ── Under Construction ─────────────────────────────────── */
.coming-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: 40px;
}

.coming-soon-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.coming-soon h2 {
  font-size: 24px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.coming-soon p {
  font-size: 14px; color: var(--text-secondary);
  max-width: 400px; line-height: 1.7;
}

/* ── Progress Bar ───────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 1s ease;
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(61,127,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(61,127,255,0.4); }

/* ── Utility ────────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-success); }
.text-danger { color: var(--accent-danger); }
.text-accent { color: var(--accent-1); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }

/* ── Animated Gradient Text ─────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Separator ──────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* Tabel data: kolom aksi menempel di kanan agar tetap terlihat pada layar sempit; badge tidak membungkus */
table.sticky-act th:last-child, table.sticky-act td:last-child { position: sticky; right: 0; z-index: 2; box-shadow: -10px 0 10px -10px rgba(0,0,0,.6); }
table.sticky-act thead th:last-child { background: #161e35; }
table.sticky-act tbody td:last-child { background: var(--bg-card); }
table.sticky-act tbody tr:hover td:last-child { background: var(--bg-card-hover); }
table.sticky-act .badge { white-space: nowrap; }
table.sticky-act thead th, table.sticky-act tbody td { padding: 10px 12px; }
table.sticky-act .th-sort a { font-size: 11px; }
table.sticky-act tbody td:last-child .btn-sm { padding: 5px 6px; }
table.sticky-act .act-sep { margin: 0 3px; }
table.sticky-act thead th, table.sticky-act tbody td { padding: 10px 9px; }

/* ── Kabupaten/kota aktif (Fase 1) ─────────────────────────── */
.wilayah-card { display:flex; align-items:center; gap:10px; margin:0 12px 10px; padding:10px 12px; border:1px solid var(--border);
  border-radius:10px; background:var(--bg-secondary); text-decoration:none; color:var(--text-primary); transition:border-color .15s; }
.wilayah-card:hover { border-color:var(--accent-1); }
.wilayah-ic { font-size:18px; }
.wilayah-tx { display:flex; flex-direction:column; min-width:0; flex:1; line-height:1.25; }
.wilayah-tx b { font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wilayah-lb { font-size:10px; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); }
.wilayah-ganti { font-size:11px; font-weight:600; color:var(--accent-1); }
.wilayah-top { border:1px solid var(--border); white-space:nowrap; }
@media (max-width: 720px) { .wilayah-top { display:none; } }

/* ── Pengisian otomatis dari Data Referensi (PMP UMK) ──────── */
.ref-box { border:1px dashed var(--accent-1); border-radius:10px; padding:12px 14px; margin-bottom:12px; background:var(--bg-secondary); }
.ref-locked { background:var(--bg-secondary) !important; border-style:dashed !important; cursor:not-allowed; }
.ref-manual { border-color:var(--accent-amber, #f59e0b) !important; }
.ref-btn { margin-left:8px; font-size:11px; font-weight:600; border:0; background:none; color:var(--accent-1); cursor:pointer; padding:0; }
.ref-manual ~ .ref-btn { color:#f59e0b; }

/* ── Manajemen Base Data (Fase 3) ──────────────────────────── */
.sw { position:relative; display:inline-block; width:38px; height:21px; }
.sw input { opacity:0; width:0; height:0; }
.sw span { position:absolute; inset:0; background:#475569; border-radius:21px; cursor:pointer; transition:background .15s; }
.sw span::before { content:""; position:absolute; width:15px; height:15px; left:3px; top:3px; background:#fff; border-radius:50%; transition:transform .15s; }
.sw input:checked + span { background:var(--accent-1, #3d7fff); }
.sw input:checked + span::before { transform:translateX(17px); }
.sw input:disabled + span { opacity:.5; cursor:wait; }
.map-legend .legend-item svg { vertical-align:middle; margin-right:6px; }
.bd-prev { display:grid; grid-template-columns:150px 1fr; gap:12px; align-items:stretch; }
.bd-prev-svg { border:1px solid var(--border); border-radius:8px; background:#1e293b; display:flex; align-items:center; justify-content:center; padding:8px; }
#bd-map { height:230px; border:1px solid var(--border); border-radius:8px; background:#0f172a; }
@media (max-width: 720px) { .bd-prev { grid-template-columns:1fr; } }

/* ── Label base data (Manajemen Base Data) ─────────────────── */
.leaflet-div-icon.bd-label { background:none; border:none; }
.bd-label-tx { display:inline-block; transform:translate(-50%,-50%); }
