:root {
  /* Official UNIPI Brand Palette */
  --unipi-teal: #007978;
  --unipi-teal-dark: #005b5a;
  --unipi-teal-deep: #042f2e;
  --unipi-teal-soft: #f0fdfa;
  --unipi-teal-border: #99f6e4;
  --unipi-gold: #eab308;
  --unipi-gold-bright: #facc15;
  --unipi-red: #dc2626;

  /* UI Tokens */
  --bg: #eef5f5;
  --surface: #ffffff;
  --surface-alt: #f7fbfb;
  --border: #dce7e7;
  --text: #0f172a;
  --text-muted: #556868;
  --primary: var(--unipi-teal);
  --primary-hover: var(--unipi-teal-dark);
  --primary-soft: var(--unipi-teal-soft);

  --shadow-sm: 0 1px 3px rgba(4, 47, 46, 0.08);
  --shadow-md: 0 10px 26px rgba(4, 47, 46, 0.14);
  --shadow-lg: 0 20px 44px rgba(4, 47, 46, 0.22);
  --radius: 12px;
  --sidebar-w: clamp(350px, 29vw, 420px);
  --mobile-nav-h: 62px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85em;
  background: #eff5f5;
  color: var(--unipi-teal-dark);
  padding: 2px 6px;
  border-radius: 5px;
}

.hidden {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd8d8;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9fb5b5;
}

/* App Shell */
.app-shell {
  position: relative;
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar (Desktop Left Drawer) */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 900;
  box-shadow: 6px 0 28px rgba(4, 47, 46, 0.08);
  transition: margin-left 0.25s ease, opacity 0.2s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-w));
  opacity: 0;
  pointer-events: none;
}

/* Official UNIPI Brand Header */
.brand-header {
  position: relative;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 74, 73, 0.92) 0%, rgba(4, 47, 46, 0.95) 100%),
    url("assets/gedung-unipi.jpg") center 28% / cover no-repeat;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.brand-crest {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.brand-text {
  flex: 1;
  min-width: 0;
}

.brand-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: var(--unipi-gold-bright);
  text-transform: uppercase;
}

.brand-text h1 {
  margin: 2px 0 0;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.brand-subloc {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(240, 253, 250, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  border: none;
  background: #eff5f5;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.icon-btn:hover {
  background: #dce7e7;
}

.icon-btn-glass {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.icon-btn-glass:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* Search & Collapsible Filter Panel */
.filter-panel {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex-shrink: 0;
}

.search-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

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

.search-wrap input {
  width: 100%;
  height: 40px;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  background: var(--surface-alt);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 121, 120, 0.14);
}

.filter-toggle-btn {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--unipi-teal-deep);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.filter-toggle-btn:hover,
.filter-toggle-btn.active {
  border-color: var(--unipi-teal);
  background: var(--unipi-teal-soft);
  color: var(--unipi-teal-dark);
}

.filter-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--unipi-teal);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Single-line scrollable radius chips */
.radius-scroll-row {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.radius-scroll-row::-webkit-scrollbar {
  display: none;
}

.radius-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: max-content;
}

.chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Advanced Filters Drawer */
.advanced-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.filter-row select,
.sort-select {
  height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.filter-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sort-select {
  flex: 1;
}

/* Scrollable Sidebar Body */
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 11px 14px 8px;
  flex-shrink: 0;
}

.kpi-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 9px;
}

.kpi-card.kpi-primary {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  border-color: var(--unipi-teal-border);
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-val {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 800;
  color: var(--unipi-teal-deep);
}

.kpi-val small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

/* Action Bar */
.action-bar {
  display: flex;
  gap: 6px;
  padding: 6px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  min-height: 38px;
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-sm {
  min-height: 34px;
  font-size: 12px;
  padding: 6px 10px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  flex: 1;
  box-shadow: 0 2px 8px rgba(0, 121, 120, 0.22);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #eff5f5;
  color: var(--unipi-teal-deep);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #e1eded;
}

.btn-outline {
  background: #fff;
  color: var(--unipi-teal-deep);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--unipi-teal-soft);
}

.btn-danger-outline {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

/* Campus List */
.campus-list {
  padding: 10px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.campus-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}

.campus-card:hover {
  border-color: #5eead4;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.campus-card.active {
  border-color: var(--unipi-teal);
  background: var(--unipi-teal-soft);
  box-shadow: 0 0 0 2px rgba(0, 121, 120, 0.18);
}

.campus-card.is-pusat {
  background: linear-gradient(135deg, #f0fdfa 0%, #fefce8 100%);
  border: 1.5px solid var(--unipi-teal);
  box-shadow: 0 4px 14px rgba(0, 121, 120, 0.12);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.card-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-pusat {
  background: linear-gradient(135deg, var(--unipi-teal) 0%, var(--unipi-teal-dark) 100%);
  color: var(--unipi-gold-bright);
  border: 1px solid rgba(250, 204, 21, 0.55);
}
.badge-univ { background: #dbeafe; color: #1e40af; }
.badge-inst { background: #ede9fe; color: #5b21b6; }
.badge-poltek { background: #d1fae5; color: #065f46; }
.badge-st { background: #ffedd5; color: #9a3412; }
.badge-akad { background: #fce7f3; color: #9d174d; }

.card-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  gap: 8px;
}

.dist-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--unipi-teal-dark);
  background: #e6f4f4;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.is-pusat .dist-pill {
  background: #fef08a;
  color: #854d0e;
}

.card-addr {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Map Stage — Strict stacking context isolation so Leaflet controls NEVER leak out */
.map-stage {
  position: relative;
  z-index: 1;
  isolation: isolate;
  flex: 1;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  background: #dce8e8;
}

/* Top-Left Brand Dock (Shown when sidebar collapsed) */
.map-brand-dock {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.floating-pill,
.map-watermark-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 121, 120, 0.25);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: var(--unipi-teal-deep);
  box-shadow: var(--shadow-md);
}

.floating-pill {
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  background: var(--unipi-teal);
  color: #fff;
  border-color: var(--unipi-teal-dark);
}

.floating-pill:hover {
  background: var(--unipi-teal-dark);
}

.map-watermark-pill img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.wm-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--unipi-teal-dark);
  line-height: 1.1;
}

.wm-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Unified Top-Right Map Control Pill */
.map-top-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 810;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.control-bar-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.ctrl-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 2px;
}

.basemap-inline {
  display: inline-flex;
  gap: 3px;
}

.map-ctrl-btn,
.basemap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--unipi-teal-deep);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-logo-mini {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.map-ctrl-btn:hover,
.basemap-btn:hover {
  background: var(--unipi-teal-soft);
  color: var(--unipi-teal);
}

.map-ctrl-btn.active,
.basemap-btn.active {
  background: var(--unipi-teal-deep);
  color: #fff;
}

.map-ctrl-unipi {
  background: var(--unipi-teal-soft);
  border-color: rgba(0, 121, 120, 0.25);
}

/* Popover for Layers & Basemap */
.map-layers-popover {
  pointer-events: auto;
  width: 280px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popover-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.basemap-switcher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.basemap-switcher-grid .basemap-btn {
  border-color: var(--border);
  background: var(--surface-alt);
  font-size: 11.5px;
  padding: 7px 6px;
}

.basemap-switcher-grid .basemap-btn.active {
  background: var(--unipi-teal-deep);
  border-color: var(--unipi-teal-deep);
}

.popover-toggles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popover-toggles .map-ctrl-btn {
  justify-content: flex-start;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  width: 100%;
  min-height: 38px;
}

.popover-toggles .map-ctrl-btn.active {
  background: var(--unipi-teal);
  border-color: var(--unipi-teal);
  color: #fff;
}

/* Check / Uncheck Category Filter Pills */
.cat-check-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-check-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.cat-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cat-check-grid-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.cat-check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all 0.12s;
}

.cat-check-pill:hover {
  border-color: var(--unipi-teal);
  background: var(--unipi-teal-soft);
}

.cat-check-pill input[type="checkbox"] {
  accent-color: var(--unipi-teal);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.cat-check-pill span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.show-tablet,
.show-mobile-only {
  display: none;
}

/* Pick Coord Banner */
.pick-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  background: var(--unipi-teal-deep);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  max-width: calc(100% - 28px);
  box-shadow: var(--shadow-lg);
}

/* Detail Drawer on Map — Anchored top-right below controls on desktop (zero collision with zoom/legend) */
.detail-drawer {
  position: absolute;
  top: 66px;
  right: 14px;
  width: min(390px, calc(100% - 28px));
  max-height: calc(100% - 88px);
  overflow-y: auto;
  z-index: 1050;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.detail-hero-photo {
  position: relative;
  height: 122px;
  width: 100%;
  background: var(--unipi-teal-deep);
  overflow: hidden;
}

.detail-hero-photo img.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 47, 46, 0.1) 0%, rgba(4, 47, 46, 0.88) 100%);
  display: flex;
  align-items: flex-end;
  padding: 10px 14px;
  color: #fff;
}

.detail-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--unipi-gold-bright);
}

.detail-hero-badge img {
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 99px;
  padding: 2px;
}

.detail-body {
  padding: 14px 16px 15px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.detail-header h3 {
  margin: 5px 0 0;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--unipi-teal-deep);
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.metric-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}

.metric-box .m-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-box .m-val {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 800;
  color: var(--unipi-teal);
  font-family: "JetBrains Mono", monospace;
}

.detail-addr {
  font-size: 12.5px;
  color: #334e4e;
  line-height: 1.45;
  margin-bottom: 9px;
}

.detail-note {
  font-size: 11.5px;
  background: #fefce8;
  border: 1px solid #fde047;
  color: #854d0e;
  padding: 7px 9px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Legend */
.map-legend {
  position: absolute;
  bottom: 20px;
  left: 14px;
  z-index: 800;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 13px;
  box-shadow: var(--shadow-md);
}

.legend-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--unipi-teal-dark);
  margin-bottom: 6px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
}

.legend-compact {
  gap: 8px 12px;
  font-size: 11.5px;
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  display: inline-block;
}

.dot-pusat { background: var(--unipi-teal); box-shadow: 0 0 0 3px var(--unipi-gold-bright); }
.dot-univ { background: #1d4ed8; }
.dot-inst { background: #7c3aed; }
.dot-poltek { background: #059669; }
.dot-st { background: #ea580c; }
.dot-akad { background: #db2777; }

/* Custom Leaflet Markers */
.campus-marker-wrap {
  background: transparent;
  border: none;
}

.marker-pin {
  width: 24px;
  height: 24px;
  border-radius: 99px;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(4, 47, 46, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  transition: transform 0.15s;
}

.marker-pin:hover,
.marker-pin.selected {
  transform: scale(1.24);
  box-shadow: 0 0 0 3px rgba(0, 121, 120, 0.35), 0 4px 12px rgba(4, 47, 46, 0.45);
}

/* Official UNIPI Crest Map Marker */
.marker-unipi {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 99px;
  background: #ffffff;
  border: 3px solid var(--unipi-teal);
  box-shadow:
    0 0 0 3px var(--unipi-gold-bright),
    0 8px 22px rgba(0, 74, 73, 0.42);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-unipi img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.unipi-halo {
  position: absolute;
  inset: -10px;
  border-radius: 99px;
  border: 2.5px solid rgba(0, 121, 120, 0.55);
  animation: unipiRadar 2.4s infinite ease-out;
  pointer-events: none;
}

@keyframes unipiRadar {
  0% { transform: scale(0.85); opacity: 0.9; }
  80% { transform: scale(1.38); opacity: 0; }
  100% { transform: scale(1.38); opacity: 0; }
}

.unipi-tooltip {
  background: var(--unipi-teal-deep) !important;
  color: var(--unipi-gold-bright) !important;
  border: 1.5px solid var(--unipi-gold-bright) !important;
  font-weight: 800 !important;
  font-size: 11.5px !important;
  border-radius: 8px !important;
  padding: 4px 9px !important;
  box-shadow: var(--shadow-md) !important;
}

.campus-tooltip {
  background: rgba(255, 255, 255, 0.96) !important;
  color: var(--unipi-teal-deep) !important;
  border: 1px solid #b8cece !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  border-radius: 6px !important;
  padding: 2px 6px !important;
}

.ring-label {
  background: rgba(4, 47, 46, 0.86);
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

/* Mobile Bottom Nav hidden on desktop */
.mobile-bottom-nav {
  display: none;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 47, 46, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: min(580px, 100%);
  max-height: 90vh;
  max-height: 90dvh;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.modal-wide {
  width: min(1080px, 100%);
}

.modal-campus-card {
  width: min(700px, 100%);
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header-brand {
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.modal-title-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--unipi-teal-deep);
}

.modal-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

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

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-size: 12px;
  font-weight: 700;
  color: #334e4e;
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
}

.input-with-btn,
.coord-helper {
  display: flex;
  gap: 8px;
}

.input-with-btn input,
.coord-helper input {
  flex: 1;
}

.form-feedback {
  margin-top: 8px;
  font-size: 12px;
  color: var(--primary);
  min-height: 18px;
}

/* Table */
.table-wrap {
  padding: 0;
  overflow: auto;
}

#pmb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

#pmb-table th {
  position: sticky;
  top: 0;
  background: #f4fafa;
  border-bottom: 2px solid var(--border);
  text-align: left;
  padding: 10px 12px;
  font-weight: 800;
  color: var(--unipi-teal-deep);
  white-space: nowrap;
}

#pmb-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

#pmb-table tr:hover td {
  background: var(--unipi-teal-soft);
}

/* SQL Console */
.db-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.sql-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sql-editor-wrap label {
  font-size: 12.5px;
  font-weight: 700;
}

.sql-editor-wrap textarea {
  width: 100%;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--unipi-teal-deep);
  color: #ecfdf5;
}

.sql-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sql-result-wrap {
  margin-top: 14px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.sql-result-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sql-result-wrap th,
.sql-result-wrap td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.sql-result-wrap th {
  background: #f4fafa;
  font-weight: 700;
}

/* AI Import Modal & Tabs */
.modal-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px 0;
  background: #f6fbfb;
  border-bottom: 1px solid var(--border);
}

.modal-tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-tab:hover {
  color: var(--unipi-teal);
}

.modal-tab.active {
  background: #fff;
  color: var(--unipi-teal-deep);
  border-color: var(--border);
  margin-bottom: -1px;
  padding-bottom: 10px;
}

.ai-step-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ai-step-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ai-step-num {
  width: 24px;
  height: 24px;
  border-radius: 99px;
  background: var(--unipi-teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-step-head strong {
  font-size: 13px;
  color: var(--unipi-teal-deep);
}

.ai-step-desc {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

.ai-step-card input[type="text"],
.ai-step-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  outline: none;
}

.ai-step-card textarea {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  line-height: 1.45;
}

.ai-step-card input:focus,
.ai-step-card textarea:focus {
  border-color: var(--unipi-teal);
}

.ai-prompt-details summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--unipi-teal);
  cursor: pointer;
  user-select: none;
}

.ai-prompt-details textarea {
  margin-top: 8px;
  background: var(--unipi-teal-deep);
  color: #ecfdf5;
}

.ai-paste-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #334e4e;
  cursor: pointer;
}

.ai-preview-box {
  border: 1px solid var(--unipi-teal-border);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ai-preview-summary {
  padding: 9px 12px;
  background: var(--unipi-teal-soft);
  border-bottom: 1px solid var(--unipi-teal-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--unipi-teal-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-preview-list {
  max-height: 180px;
  overflow-y: auto;
}

.ai-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

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

.ai-preview-item.is-dup {
  background: #fefce8;
  opacity: 0.78;
}

.ai-preview-item.is-invalid {
  background: #fef2f2;
}

.ai-status-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.tag-ok { background: #d1fae5; color: #065f46; }
.tag-dup { background: #fef08a; color: #854d0e; }
.tag-err { background: #fee2e2; color: #991b1b; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  background: var(--unipi-teal-deep);
  color: #fff;
  border: 1px solid rgba(250, 204, 21, 0.5);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  text-align: center;
}

/* Medium Laptops / Tablets (901px - 1180px): Move inline basemap into Tampilan popover */
@media (max-width: 1180px) {
  .hide-tablet {
    display: none !important;
  }
  .show-tablet {
    display: block;
  }
}

/* Mobile & Portrait Tablet Clean 2-Tab Mode (<= 900px) */
@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .map-stage {
    width: 100vw;
    height: calc(100dvh - var(--mobile-nav-h) - env(safe-area-inset-bottom, 0px));
  }

  .hide-mobile,
  .map-brand-dock,
  .map-legend,
  #btn-collapse-sidebar,
  .action-bar {
    display: none !important;
  }

  .show-mobile-only {
    display: inline-flex;
  }

  .map-top-controls {
    top: 10px;
    right: 10px;
    left: 10px;
    align-items: flex-end;
    z-index: 1060;
  }

  .control-bar-pill {
    width: auto;
    max-width: 100%;
    padding: 4px;
    border-radius: 12px;
  }

  .map-ctrl-btn {
    min-height: 38px;
    padding: 6px 10px;
  }

  .map-layers-popover {
    width: min(300px, calc(100vw - 20px));
  }

  /* Dedicated Full-Height Campus List View when Tab "Kampus" is active */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    width: 100%;
    min-width: 100%;
    height: auto;
    border-right: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 1100;
    margin-left: 0 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    display: none;
  }

  .sidebar.mobile-open {
    display: flex;
  }

  .brand-header-inner {
    padding: 11px 14px;
  }

  .brand-crest {
    width: 38px;
    height: 38px;
  }

  .brand-text h1 {
    font-size: 13.5px;
  }

  .filter-panel {
    padding: 10px 14px;
  }

  /* Compact single-row KPI strip on mobile so Campus Cards take most of screen */
  .kpi-grid {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    background: #f9fcfc;
  }

  .kpi-grid::-webkit-scrollbar {
    display: none;
  }

  .kpi-card {
    flex: 1 0 auto;
    min-width: 82px;
    padding: 6px 10px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
  }

  .kpi-val {
    margin-top: 0;
    font-size: 13.5px;
  }

  /* Prevent iOS Safari auto-zoom on input focus (>= 16px) */
  .search-wrap input,
  .form-field input,
  .form-field select,
  .form-field textarea,
  .filter-row select,
  .sort-select,
  .ai-step-card input[type="text"],
  .ai-step-card textarea {
    font-size: 16px;
  }

  .search-wrap input,
  .filter-toggle-btn {
    height: 42px;
  }

  .chip {
    padding: 7px 12px;
    font-size: 12.5px;
  }

  /* Detail Drawer sits neatly at bottom of map stage above bottom nav */
  .detail-drawer {
    top: auto;
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 10px;
    max-height: calc(100% - 76px);
    overflow-y: auto;
    z-index: 1080;
  }

  .detail-hero-photo {
    height: 92px;
  }

  /* Thumb-Friendly Mobile Bottom Navigation */
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(4, 47, 46, 0.08);
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .mnav-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .mnav-btn.active {
    color: var(--unipi-teal);
    background: var(--unipi-teal-soft);
  }

  /* Modals slide up like native sheets on mobile */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card,
  .modal-card.modal-wide,
  .modal-campus-card {
    width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
  }

  .modal-header {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .modal-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .input-with-btn,
  .coord-helper {
    flex-direction: column;
  }

  .toast {
    bottom: calc(var(--mobile-nav-h) + 14px);
  }
}

@media (max-width: 420px) {
  .hide-xs {
    display: none;
  }
}

/* Print Report Styling */
@media print {
  .app-shell,
  .toast,
  .modal-header-actions {
    display: none !important;
  }
  #modal-table {
    position: static !important;
    background: #fff !important;
    padding: 0 !important;
    display: block !important;
  }
  #modal-table .modal-card {
    box-shadow: none !important;
    max-height: none !important;
    width: 100% !important;
  }
  #modal-table .table-wrap {
    overflow: visible !important;
  }
}
