/* ==========================================================================
   Root tokens & reset
   ========================================================================== */
:root {
  --appbar-h: 64px;
  --nav-h: 60px;
  --sheet-maxh: 70vh;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --txt: #111827;
  --muted: #6b7280;
  --blue: #2563eb;
  --red: #ef4444;
  --green: #10b981;
  --footer-h: 64px;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: #333;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hidden {
  display: none !important;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 2000;
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.logo-text {
  font-weight: 700;
  color: #1f2937;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.avatar-btn {
  background: #fff;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.download-btn {
  display: none;
  align-items: center;
  gap: 0.45rem;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
.download-btn.show {
  display: inline-flex;
}
.rb-menu-btn {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--appbar-h));
}
@media (min-width: 769px) {
  .container {
    height: calc(100vh - var(--appbar-h) - var(--footer-h));
  }
}

/* Sidebar */
.sidebar {
  width: 84px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: sticky;
  top: var(--appbar-h);
  height: calc(100vh - var(--appbar-h));
  transition: width 0.25s ease;
  z-index: 1200;
}
.sidebar.expanded {
  width: 240px;
  align-items: flex-start;
}
.hamburger {
  background: none;
  border: 0;
  cursor: pointer;
  color: #374151;
  font-size: 1.2rem;
  align-self: center;
  margin-bottom: 0.75rem;
}
.sidebar.expanded .hamburger {
  align-self: flex-end;
  margin-right: 0.25rem;
}
.nav-item {
  background: none;
  border: 0;
  cursor: pointer;
  color: #374151;
  width: 100%;
  padding: 0.6rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.5rem;
  transition: background 0.15s ease;
  font-size: 0.85rem;
}
.nav-item:hover {
  background: #f3f4f6;
}
.sidebar.expanded .nav-item {
  flex-direction: row;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
}
.nav-text {
  display: none;
}
.sidebar.expanded .nav-text {
  display: inline;
}

/* Submenu Rute */
.submenu {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.25rem 0 0;
  width: 100%;
}
.sidebar.expanded .submenu.show {
  display: flex;
}
.submenu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 0;
  color: #4b5563;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  padding: 0.25rem 0.25rem;
  border-radius: 0.375rem;
}
.submenu-item:hover {
  background: #f3f4f6;
  color: var(--blue);
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  background: #eef2ff;
  color: #1d4ed8;
  border-radius: 0.375rem;
  padding: 0.1rem 0.45rem;
}

/* Main & Map */
.main-content {
  position: relative;
  flex: 1;
  overflow: hidden;
  margin-right: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.5rem 0 0.75rem 1rem;
}
.map-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.map-section .map-container {
  position: relative;
  flex: 1 1 auto;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}
#map {
  position: absolute;
  inset: 0;
}

/* Buttons on map */
.btn-add-report {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 1100;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 9999px;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.btn-add-report:hover {
  filter: brightness(0.95);
}
.map-fab {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 1100;
  background: #fff;
  color: #111827;
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.55rem 0.75rem;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
.map-fab.second {
  bottom: 4.25rem;
}
.map-fab.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.fab-label {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Rightbar (desktop) */
.rightbar {
  width: 260px;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}
.weather,
.announcements {
  background: #f9fafb;
  padding: 0.5rem;
  border-radius: 0.5rem;
}
.announcement-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.announcement {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: #fff;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}
.announcement:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Footer */
.footer {
  background: #f3f4f6;
  color: #4b5563;
  text-align: center;
  padding: 0;
  border-top: 0 solid var(--border);
  min-height: var(--footer-h);
  display: grid;
  place-items: center;
}

/* ==========================================================================
   Overlay & Modal (global)
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 24px);
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
}
.overlay.show {
  display: flex;
}
.overlay .modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: min(720px, 96vw);
  max-height: 90vh;
  overflow: auto;
}
.modal .modal-head {
  position: sticky;
  top: 0;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  padding-right: 56px;
}
.modal .modal-head header {
  font-weight: 700;
  font-size: 1.05rem;
}
.modal .modal-head > .close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.modal .modal-head > .close-x:hover {
  background: #f3f4f6;
}
.modal-article,
.modal .body {
  padding: 1rem 1.25rem;
}
body.modal-open {
  overflow: hidden;
}

/* ==========================================================================
   Rightbar Popover (⋮)
   ========================================================================== */
.rb-popover-overlay {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.18);
  z-index: 3000;
}
.rb-popover-overlay.show {
  display: block;
}
.rb-popover {
  position: absolute;
  right: 8px;
  top: calc(var(--appbar-h) + 8px);
  width: min(92vw, 360px);
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  padding: 0.75rem;
  transform-origin: top right;
  animation: rbPop 0.14s ease;
}
.rb-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 16px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
  box-shadow: -2px -2px 3px rgba(0, 0, 0, 0.02);
}
@keyframes rbPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.rb-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.rb-popover-head .r-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.rb-popover-body > * + * {
  margin-top: 0.75rem;
}

/* ==========================================================================
   Tutorial / Help tour
   ========================================================================== */
#overlayHelp .modal {
  max-width: 420px;
  padding: 1rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
#helpTitle {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
#helpStep {
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0.75rem 0;
}
.feature {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.feature i {
  font-size: 1.8rem;
  color: var(--blue);
  flex-shrink: 0;
}
.feature i.fa-circle-exclamation {
  color: #dc2626;
}
.feature h4 {
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.feature .muted {
  color: #4b5563;
  font-size: 0.9rem;
}
#helpDots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.75rem 0;
}
#helpDots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
}
#helpDots .dot.active {
  background: var(--blue);
}
#helpPrev {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  color: #111827;
  border-radius: 9999px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}
#helpPrev:hover {
  background: #9ca3af;
  transform: translateY(-1px);
}
#helpNext {
  background: linear-gradient(135deg, var(--blue), #1e40af);
  color: #fff;
  border-radius: 9999px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}
#helpNext:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ==========================================================================
   Announcement MODAL (centered on mobile & desktop)
   ========================================================================== */
#overlayAnnouncement .modal {
  max-width: 580px;
  width: min(94vw, 580px);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
#overlayAnnouncement #annTitle {
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 0 0.4rem;
  color: #111827;
}
#overlayAnnouncement .ann-meta {
  color: #6b7280;
  font-size: 0.85rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
#overlayAnnouncement #annContent {
  color: #111827;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 12px 18px 14px;
  background: #f9fafb;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
}
#overlayAnnouncement .fa-circle-exclamation {
  color: #dc2626;
}
#overlayAnnouncement .actions {
  margin: 0.6rem 18px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
#overlayAnnouncement .btn {
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 0.58rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  background: #111827;
  color: #fff;
  transition: filter 0.15s ease, transform 0.05s ease;
}
#overlayAnnouncement .btn:hover {
  filter: brightness(1.05);
}
#overlayAnnouncement .btn:active {
  transform: translateY(1px);
}
#overlayAnnouncement .btn.ghost {
  background: #fff;
  color: #111827;
}

/* ==========================================================================
   Report Form (Tambah Laporan)
   ========================================================================== */
#overlayReport .modal {
  width: min(720px, 96vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
#reportForm {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.75rem 1rem 1rem;
}
#reportForm label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}
#reportForm .field {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  background: #fff;
  font: inherit;
  color: var(--txt);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#reportForm .field:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
#reportForm textarea.field {
  min-height: 110px;
  resize: vertical;
}
#reportForm .coord-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}
#reportForm .coord-inputs {
  display: flex;
  gap: 0.5rem;
}
#reportForm .field.sm {
  flex: 1;
  padding: 0.5rem 0.55rem;
}
#btnPick.btn-report.pick {
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
#btnPick.btn-report.pick:hover {
  filter: brightness(0.95);
}
#btnPick.btn-report.pick:active {
  transform: translateY(1px);
}
#reportForm .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
#reportForm .actions .close-x {
  position: static;
  margin: 0;
  width: auto;
  height: auto;
  box-shadow: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-weight: 600;
  background: #fff;
  color: #111827;
  cursor: pointer;
}
#reportForm .actions .close-x:hover {
  background: #f3f4f6;
}
#reportForm .btn-report.submit {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
#reportForm .btn-report.submit:hover {
  filter: brightness(0.95);
}
#reportForm .btn-report.submit:active {
  transform: translateY(1px);
}
#reportForm .is-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}
#reportForm .is-valid {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12) !important;
}

/* ==========================================================================
   Hazard icon (Font Awesome)
   ========================================================================== */
.hazard-divicon {
  background: transparent;
  border: 0;
}
.hazard-divicon i.fa-circle-exclamation {
  font-size: 22px;
  color: #dc2626;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   Profile popover (opsional)
   ========================================================================== */
.profile-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.25);
  z-index: 3500;
}
.profile-overlay.show {
  display: flex;
}
.profile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  width: 320px;
  margin: 70px 12px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.profile-head {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: #e5e7eb;
  display: grid;
  place-items: center;
}
.prof-name {
  font-weight: 700;
}
.prof-username,
.prof-role {
  font-size: 0.85rem;
  color: var(--muted);
}
.profile-actions {
  padding: 0.75rem 1rem;
}

/* ==========================================================================
   Reports table (petugas) + Section Laporan (pengguna)
   ========================================================================== */
.reports-section .card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  height: calc(100vh - 180px);
  overflow: auto;
}
.reports-section .table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}
.reports-section thead th {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.5rem;
  z-index: 1;
}
.reports-section tbody td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.5rem;
}
.reports-section .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.reports-section .js-report-show,
.reports-section .js-report-validate,
.reports-section .js-report-reject,
.reports-section .js-report-note {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #111827;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.48rem 0.7rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: box-shadow 0.15s ease, transform 0.05s ease, filter 0.15s ease,
    background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.reports-section .js-report-show i,
.reports-section .js-report-validate i,
.reports-section .js-report-reject i,
.reports-section .js-report-note i {
  font-size: 0.95rem;
}
.reports-section .js-report-show:hover,
.reports-section .js-report-validate:hover,
.reports-section .js-report-reject:hover,
.reports-section .js-report-note:hover {
  filter: brightness(0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.reports-section .js-report-show:active,
.reports-section .js-report-validate:active,
.reports-section .js-report-reject:active,
.reports-section .js-report-note:active {
  transform: translateY(1px);
}
.reports-section .js-report-show:focus-visible,
.reports-section .js-report-validate:focus-visible,
.reports-section .js-report-reject:focus-visible,
.reports-section .js-report-note:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.reports-section .js-report-show {
  border-color: #c7d2fe;
  color: var(--blue);
  background: #eef2ff;
}
.reports-section .js-report-validate {
  border-color: #bbf7d0;
  color: #065f46;
  background: #ecfdf5;
}
.reports-section .js-report-reject {
  border-color: #fecaca;
  color: #991b1b;
  background: #fef2f2;
}
.reports-section .js-report-note {
  border-color: var(--border);
  color: #374151;
  background: #fff;
}
.reports-section .js-report-show:disabled,
.reports-section .js-report-validate:disabled,
.reports-section .js-report-reject:disabled,
.reports-section .js-report-note:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Section Laporan (pengguna) */
.section-laporan {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.section-laporan h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #111827;
}
.table-laporan {
  width: 100%;
  border-collapse: collapse;
}
.table-laporan th {
  text-align: left;
  padding: 0.75rem;
  color: #374151;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
  font-size: 0.9rem;
}
.table-laporan td {
  padding: 0.85rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.88rem;
  color: #111827;
}
.table-laporan tr:hover {
  background: #f9fafb;
}

/* ==========================================================================
   NOTE MODAL (Catatan) – always centered
   ========================================================================== */
#overlayNote .modal {
  max-width: 520px;
  width: min(94vw, 520px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
#overlayNote .modal .body textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.65rem;
  min-height: 110px;
  resize: vertical;
  font-size: 0.95rem;
  color: var(--txt);
}
#overlayNote .modal .actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0 1.25rem 1rem;
}
#overlayNote .btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: #111827;
  color: #fff;
}
#overlayNote .btn.ghost {
  background: #fff;
  color: #111827;
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 768px) {
  .header {
    padding-top: calc(0.5rem + env(safe-area-inset-top));
    padding-left: calc(1rem + env(safe-area-inset-left));
    padding-right: calc(1rem + env(safe-area-inset-right));
  }
  .container {
    flex-direction: column;
    height: auto;
  }
  .rightbar {
    display: none;
  }

  /* bottom nav */
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: var(--nav-h);
    width: 100%;
    border-right: 0;
    border-top: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    z-index: 3200;
  }
  .hamburger {
    display: none;
  }
  .nav-item {
    flex: 1;
    flex-direction: column;
    padding: 0.25rem 0;
  }
  .nav-text {
    display: block;
    font-size: 0.75rem;
  }

  .submenu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--nav-h);
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    max-height: 45vh;
    overflow: auto;
    z-index: 3201;
    display: none;
  }
  .submenu.show {
    display: block;
  }

  .main-content {
    margin-right: 0;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
  .map-section .map-container {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    height: calc(100vh - var(--appbar-h) - var(--nav-h) - 8px);
  }
  .btn-add-report {
    left: 0.75rem;
    bottom: calc(-3rem + var(--nav-h));
  }
  .map-fab {
    right: 0.75rem;
    bottom: calc(-2rem + var(--nav-h));
  }
  .map-fab.second {
    bottom: calc(1rem + var(--nav-h));
  }

  /* generic modal → bottom sheet */
  .overlay {
    align-items: flex-end;
    padding: 0;
  }
  .overlay .modal {
    width: 100vw;
    max-height: 98vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }
  .overlay .modal .actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 0.75rem;
  }
  .overlay .modal input,
  .overlay .modal select,
  .overlay .modal textarea {
    font-size: 16px;
    width: -webkit-fill-available;

  }

  /* Announcement tetap center */
  #overlayAnnouncement.overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }
  #overlayAnnouncement .modal {
    width: min(520px, 94vw);
    max-height: 86dvh;
    border-radius: 16px;
    margin: 0;
    padding-bottom: 0;
  }
  #overlayAnnouncement .modal .actions {
    position: static;
    background: #fff;
  }

  /* NOTE (Catatan) tetap center */
  #overlayNote.overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }
  #overlayNote .modal {
    width: min(520px, 94vw) !important;
    max-height: 86dvh !important;
    border-radius: 16px !important;
    margin: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Stacked table (semua informasi terlihat) */
  .reports-section .reports-table thead {
    display: none;
  }
  .reports-section .reports-table,
  .reports-section .reports-table tbody,
  .reports-section .reports-table tr,
  .reports-section .reports-table td {
    display: block;
    width: 100%;
  }
  .reports-section .reports-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  .reports-section .reports-table td {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
  }
  .reports-section .reports-table td::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--muted);
    display: inline-block;
    width: 95px;
  }
  .reports-section .reports-table td.actions::before {
    content: "Aksi: ";
  }
}

/* Hide popover on desktop */
@media (min-width: 769px) {
  .rb-popover-overlay {
    display: none !important;
  }
}

/* ==========================================================================
   Leaflet helpers
   ========================================================================== */
.leaflet-my-pulse {
  box-shadow: 0 0 0 rgba(37, 99, 235, 0.35);
  animation: myPulse 1.6s infinite;
}
@keyframes myPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* ==========================================================================
   Modal Tindak Lanjut — selalu CENTER
   ========================================================================== */
#overlayTL.overlay,
#overlayFollowUp.overlay,
#overlayTindakLanjut.overlay {
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  z-index: 6000;
}
#overlayTL .modal,
#overlayFollowUp .modal,
#overlayTindakLanjut .modal {
  width: min(560px, 94vw);
  max-height: 86dvh;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: auto;
}
#overlayTL .modal .modal-head,
#overlayFollowUp .modal .modal-head,
#overlayTindakLanjut .modal .modal-head {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  padding-right: 56px;
}
#overlayTL .modal .modal-head header,
#overlayFollowUp .modal .modal-head header,
#overlayTindakLanjut .modal .modal-head header {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}
#overlayTL .modal .modal-head .close-x,
#overlayFollowUp .modal .modal-head .close-x,
#overlayTindakLanjut .modal .modal-head .close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
#overlayTL .modal .modal-head .close-x:hover,
#overlayFollowUp .modal .modal-head .close-x:hover,
#overlayTindakLanjut .modal .modal-head .close-x:hover {
  background: #f3f4f6;
}
#overlayTL .modal .body,
#overlayFollowUp .modal .body,
#overlayTindakLanjut .modal .body {
  padding: 1rem 1.25rem;
}
#overlayTL .tl-form,
#overlayFollowUp .tl-form,
#overlayTindakLanjut .tl-form {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.65rem 0.75rem;
  align-items: flex-start;
}
@media (max-width: 768px) {
  #overlayTL .tl-form,
  #overlayFollowUp .tl-form,
  #overlayTindakLanjut .tl-form {
    grid-template-columns: 1fr;
  }
}
#overlayTL .tl-form label,
#overlayFollowUp .tl-form label,
#overlayTindakLanjut .tl-form label {
  font-weight: 600;
  color: #374151;
  padding-top: 0.45rem;
}
#overlayTL .tl-form .field,
#overlayFollowUp .tl-form .field,
#overlayTindakLanjut .tl-form .field,
#overlayTL .tl-form select,
#overlayFollowUp .tl-form select,
#overlayTindakLanjut .tl-form select,
#overlayTL .tl-form textarea,
#overlayFollowUp .tl-form textarea,
#overlayTindakLanjut .tl-form textarea,
#overlayTL .tl-form input[type="file"],
#overlayFollowUp .tl-form input[type="file"],
#overlayTindakLanjut .tl-form input[type="file"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fff;
  font: inherit;
  color: var(--txt);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#overlayTL .tl-form textarea,
#overlayFollowUp .tl-form textarea,
#overlayTindakLanjut .tl-form textarea {
  min-height: 110px;
  resize: vertical;
}
#overlayTL .tl-form .field:focus,
#overlayFollowUp .tl-form .field:focus,
#overlayTindakLanjut .tl-form .field:focus,
#overlayTL .tl-form select:focus,
#overlayFollowUp .tl-form select:focus,
#overlayTindakLanjut .tl-form select:focus,
#overlayTL .tl-form textarea:focus,
#overlayFollowUp .tl-form textarea:focus,
#overlayTindakLanjut .tl-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
#overlayTL .tl-hint,
#overlayFollowUp .tl-hint,
#overlayTindakLanjut .tl-hint {
  color: var(--muted);
  font-size: 0.85rem;
}
#overlayTL .tl-form input[type="file"],
#overlayFollowUp .tl-form input[type="file"],
#overlayTindakLanjut .tl-form input[type="file"] {
  padding: 0.4rem 0.5rem;
}
#overlayTL .actions,
#overlayFollowUp .actions,
#overlayTindakLanjut .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
}
#overlayTL .btn,
#overlayFollowUp .btn,
#overlayTindakLanjut .btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: #111827;
  transition: filter 0.15s ease, transform 0.05s ease;
}
#overlayTL .btn.primary,
#overlayFollowUp .btn.primary,
#overlayTindakLanjut .btn.primary {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
}
#overlayTL .btn:hover,
#overlayFollowUp .btn:hover,
#overlayTindakLanjut .btn:hover {
  filter: brightness(0.98);
}
#overlayTL .btn:active,
#overlayFollowUp .btn:active,
#overlayTindakLanjut .btn:active {
  transform: translateY(1px);
}
@media (max-width: 768px) {
  #overlayTL .tl-form input,
  #overlayTL .tl-form select,
  #overlayTL .tl-form textarea,
  #overlayFollowUp .tl-form input,
  #overlayFollowUp .tl-form select,
  #overlayFollowUp .tl-form textarea,
  #overlayTindakLanjut .tl-form input,
  #overlayTindakLanjut .tl-form select,
  #overlayTindakLanjut .tl-form textarea {
    font-size: 16px;
  }
}
