/* ==========================================================================
   MultiMap Hub - Modern Styling & Responsive Layout
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.25);
  
  --secondary: #475569;
  --secondary-hover: #334155;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-floating: 0 12px 28px rgba(15, 23, 42, 0.12);
  
  --sidebar-width: 420px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
  width: 100%;
  font-family: var(--font-family);
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.5;
  overflow: hidden;
  position: fixed;
  inset: 0;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: flex;
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Tab Navigation */
.quick-toolbar {
  display: flex;
  padding: 0.5rem 0.75rem;
  background: #f1f5f9;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.btn-tab {
  flex: 1;
  padding: 0.6rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-tab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-main);
}

.btn-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Tab Content */
.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tab-content.hidden {
  display: none !important;
}

/* Search Box Geocoding */
.search-box-wrapper {
  position: relative;
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.input-with-action input {
  flex: 1;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 0.35rem;
}

.search-result-item {
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  transition: var(--transition);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.search-result-item i {
  margin-top: 0.2rem;
  color: var(--primary);
}

/* Form Styles */
.point-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-row .col {
  flex: 1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.required {
  color: var(--danger);
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
}

#colorHexPreview {
  font-size: 0.8rem;
  font-family: monospace;
  font-weight: 600;
  color: var(--text-muted);
}

.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0.25rem 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider-text span {
  padding: 0 0.65rem;
}

/* Buttons */
.btn {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: var(--text-muted);
}

.btn-light {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-light:hover {
  background: #e2e8f0;
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-main);
  background: #f1f5f9;
}

.text-danger {
  color: var(--danger) !important;
}

.text-danger:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* Info Cards */
.info-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #1e40af;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  line-height: 1.4;
}

.info-card i {
  font-size: 1.05rem;
  margin-top: 0.15rem;
}

.info-card code {
  background: #dbeafe;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  display: inline-block;
  margin: 0.2rem 0;
}

/* Point List */
.list-filter-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-mini {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-mini i {
  position: absolute;
  left: 0.75rem;
  color: var(--text-light);
  font-size: 0.8rem;
}

.search-mini input {
  padding-left: 2rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
  font-size: 0.8rem;
}

.point-list-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 480px;
  padding-right: 0.25rem;
}

.point-item-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  gap: 0.65rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.point-item-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.point-item-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.point-card-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.point-card-content {
  flex: 1;
  min-width: 0;
}

.point-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.point-card-coords {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 0.1rem;
}

.point-card-notes {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-top: 0.25rem;
  background: #f8fafc;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.point-card-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-light);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.65rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.empty-state span {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.list-bottom-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

.footer-actions {
  display: flex;
  gap: 0.4rem;
}

.footer-actions button,
.footer-actions label {
  flex: 1;
}

/* Map Area */
.map-wrapper {
  flex: 1;
  height: 100%;
  position: relative;
  background: #e5e7eb;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Floating Controls on Map */
.map-floating-bar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 500;
  pointer-events: none;
}

.map-floating-bar > * {
  pointer-events: auto;
}

.btn-floating {
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-floating);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-floating:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.floating-badge {
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-floating);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-layer-selector {
  margin-left: auto;
}

.map-layer-selector select {
  box-shadow: var(--shadow-floating);
  font-weight: 600;
  border-radius: var(--radius-md);
  background: #ffffff;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
}

.btn-gps {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  color: var(--primary);
}

/* Click Banner */
.click-banner {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  animation: slideUp 0.3s ease;
}

.click-banner button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.click-banner button:hover {
  background: rgba(255, 255, 255, 0.35);
}

.pulse-icon {
  animation: pulse 1.5s infinite;
  color: #60a5fa;
}

/* Leaflet Custom Marker & Popups */
.custom-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-pin:hover {
  transform: scale(1.18);
  z-index: 9999 !important;
}

.custom-pin-svg {
  filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.35));
}

.custom-pin-number {
  position: absolute;
  top: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Custom Popup Style */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-floating) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
}

.map-popup-card {
  padding: 1rem;
  width: 240px;
}

.popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.popup-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.popup-category-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: #eff6ff;
  color: var(--primary);
  white-space: nowrap;
}

.popup-coords {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.popup-notes {
  font-size: 0.78rem;
  color: var(--secondary);
  background: #f8fafc;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.popup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.popup-btn-gmaps {
  background: #1a73e8;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.popup-btn-gmaps:hover {
  background: #1557b0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: scaleUp 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #0f172a;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-floating);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideLeft 0.3s ease;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }

/* Utilities & Animations */
.hidden { display: none !important; }
.mobile-close-btn { display: none; }
.sidebar-toggle-btn { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideLeft {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Mobile Backdrop & Drawer Overlay
   ========================================================================== */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Mobile Bottom Floating Dock (Diangkat Lebih ke Atas dari Navigasi HP)
   ========================================================================== */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: calc(2.2rem + env(safe-area-inset-bottom, 0px));
  left: 0.85rem;
  right: 0.85rem;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px -2px rgba(15, 23, 42, 0.28), 0 4px 12px -2px rgba(15, 23, 42, 0.12);
  z-index: 700;
  padding: 0.4rem 0.45rem;
  justify-content: space-around;
  align-items: center;
  gap: 0.3rem;
}

.mobile-bar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
}

.mobile-bar-btn i {
  font-size: 1.15rem;
  color: var(--primary);
}

.mobile-bar-btn:active {
  background: var(--primary-light);
  transform: scale(0.95);
}

/* ==========================================================================
   Responsive Breakpoints Khusus Smartphone (6.1" s.d 6.9" & Tablet)
   ========================================================================== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 88vw;
    max-width: 380px;
    height: 100%;
    height: 100dvh;
    transform: translateX(-100%);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-close-btn {
    display: flex;
    font-size: 1.25rem;
    padding: 0.5rem;
  }

  .sidebar-toggle-btn {
    display: flex;
  }

  .mobile-bottom-bar {
    display: flex;
  }

  /* Fixed Floating Top Bar */
  .map-floating-bar {
    position: fixed;
    top: max(0.65rem, env(safe-area-inset-top, 0.65rem));
    left: 0.65rem;
    right: 0.65rem;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    z-index: 700;
  }

  .map-layer-selector {
    margin-left: 0;
    flex: 1;
    min-width: 0;
  }

  .map-layer-selector select {
    width: 100%;
    font-size: 0.78rem !important;
    padding: 0.45rem 0.6rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .btn-gps {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .floating-badge {
    display: none;
  }

  /* Leaflet Controls adjustment on mobile */
  .leaflet-top.leaflet-right {
    top: 4.2rem !important;
    right: 0.65rem !important;
    z-index: 600;
  }

  .leaflet-bar {
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    box-shadow: var(--shadow-floating) !important;
    border: 1px solid var(--border-color) !important;
  }

  .leaflet-bar a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
  }
}

/* Penyesuaian khusus Smartphone Modern 6.1" - 6.9" (Viewport Width <= 480px) */
@media (max-width: 480px) {
  :root {
    --sidebar-width: 100vw;
  }

  .sidebar {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
  }

  .sidebar-header {
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem 0.85rem 1rem;
  }

  /* Cegah auto-zoom di iOS Safari dengan memastikan minimal 16px */
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-md);
  }

  .form-row {
    flex-direction: column;
    gap: 0.85rem;
  }

  .quick-toolbar {
    padding: 0.45rem;
    gap: 0.25rem;
  }

  .btn-tab {
    font-size: 0.76rem;
    padding: 0.55rem 0.35rem;
  }

  .btn {
    min-height: 44px;
    font-size: 0.88rem;
  }

  .btn-floating {
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    min-height: 38px;
    flex-shrink: 0;
  }

  .click-banner {
    bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
    width: 92%;
    padding: 0.65rem 0.85rem;
    font-size: 0.78rem;
  }

  /* Modal on Mobile: Slide up sheet */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    z-index: 2500;
  }

  .modal-card {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 1.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .point-list-container {
    max-height: calc(100dvh - 280px);
  }

  .point-item-card {
    padding: 0.85rem;
  }

  .point-card-title {
    font-size: 0.92rem;
  }
}
