@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Khmer Font Subscripts & Baseline Clipping Prevention */
* {
  font-family: 'Kantumruy Pro', 'Battambang', 'Segoe UI', sans-serif;
}

input, select, textarea, button, label, span, p, h1, h2, h3, h4, h5, h6 {
  font-family: 'Kantumruy Pro', 'Battambang', 'Segoe UI', sans-serif;
  line-height: 1.5;
}

select, input[type="text"], input[type="number"], input[type="search"], input[type="tel"], input[type="email"] {
  min-height: 42px !important;
  line-height: 1.5 !important;
  padding-top: 6px !important;
  padding-bottom: 7px !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
  box-sizing: border-box !important;
}

select option {
  font-family: 'Kantumruy Pro', 'Battambang', sans-serif !important;
  padding: 8px 12px !important;
  line-height: 1.6 !important;
  font-size: 0.92rem !important;
}

input::placeholder, textarea::placeholder {
  color: #94a3b8 !important;
  font-weight: 500 !important;
  font-style: italic !important;
  opacity: 0.65 !important;
  line-height: 1.5 !important;
}

:root {
  /* Color Palette */
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --primary-600: #475569;
  --primary-100: #f1f5f9;

  --accent-gold: #2563eb;
  --accent-gold-light: #eff6ff;
  --accent-gold-hover: #1d4ed8;

  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-100: #d1fae5;

  --telegram-blue: #0088cc;
  --facebook-blue: #1877f2;
  --whatsapp-green: #25d366;

  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Typography */
  --font-family: 'Kantumruy Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Radii & Shadows */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 6px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.12), 0 4px 8px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.25);

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary-900);
}

/* App Container Layout */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary-900);
  color: #ffffff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

/* Brand Logo Box with Vibrant Pulse Glow */
.navbar-brand img, .brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f59e0b 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4), 0 0 15px rgba(16, 185, 129, 0.3);
  animation: logoPulseGlow 3s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes logoPulseGlow {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4), 0 0 12px rgba(16, 185, 129, 0.25);
  }
  50% {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.65), 0 0 22px rgba(16, 185, 129, 0.5);
  }
}

/* Brand Name Text Styling */
.brand-title-styled {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-name-gold {
  color: #f59e0b;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  font-size: 1.25em;
  display: inline-block;
  vertical-align: baseline;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.4));
  letter-spacing: -0.01em;
}

.brand-name-white {
  color: #ffffff;
  font-size: 0.92em;
  font-weight: 700;
  vertical-align: baseline;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.brand-sub-styled {
  font-size: 0.74rem;
  color: #fbbf24;
  font-weight: 700;
  display: block;
  margin-top: 2px;
  letter-spacing: 0.03em;
  opacity: 0.95;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons System */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #b45309);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.35);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.35);
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: var(--primary-800);
  background: #ffffff;
}

.btn-outline:hover {
  background: var(--primary-100);
  border-color: var(--primary-600);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.btn-nav {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-nav:hover, .btn-nav.active {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--accent-gold);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-type {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(4px);
  color: var(--accent-gold);
  border: 1px solid rgba(217, 119, 6, 0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.badge-sale {
  background: #dbeafe;
  color: #1e40af;
}

.badge-rent {
  background: #fef3c7;
  color: #92400e;
}

.badge-sold {
  background: #fee2e2;
  color: #991b1b;
}

.badge-available {
  background: #d1fae5;
  color: #065f46;
}

/* Premium Attractive Badge Pills */
.badge-pill-attractive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.badge-pill-attractive:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.badge-pill-type {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.badge-pill-sale {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.badge-pill-rent {
  background: linear-gradient(135deg, #fef3c7, #fffbeb);
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-pill-hard {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  border: 1px solid #f59e0b;
}

.badge-pill-soft {
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.badge-pill-available {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  color: #047857;
  border: 1px solid #6ee7b7;
}

.badge-pill-sold {
  background: linear-gradient(135deg, #fee2e2, #fef2f2);
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.badge-title-hard {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  border: 1px solid #f59e0b;
}

.badge-title-soft {
  background: #e2e8f0;
  color: #334155;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: var(--transition);
  position: relative;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.modal-body {
  padding: 24px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-main);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

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

.toast {
  background: var(--primary-900);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  animation: slideInRight 0.3s forwards;
  border-left: 4px solid var(--accent-gold);
}

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

/* Utility Animations */
.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

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

/* Eye-Catching Keyframe Animations & Micro-Interactions */
@keyframes avatarPulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.6); }
  70% { box-shadow: 0 0 0 14px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

@keyframes shimmerBadge {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes btnPulseEmerald {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes btnPulseTelegram {
  0% { box-shadow: 0 0 0 0 rgba(0, 136, 204, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(0, 136, 204, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 136, 204, 0); }
}

.avatar-pulse-glow {
  animation: avatarPulseGlow 2.5s infinite ease-in-out;
}

.badge-shimmer-gold {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.15), rgba(253, 230, 138, 0.6), rgba(217, 119, 6, 0.15)) !important;
  background-size: 200% 100% !important;
  animation: shimmerBadge 3s infinite linear !important;
}

.stat-card-animated {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.stat-card-animated:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 24px -4px rgba(217, 119, 6, 0.2);
  border-color: var(--accent-gold) !important;
}

.service-card-animated {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.service-card-animated:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Sleek & Compact Luxury Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #090d16 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px 20px;
  margin-bottom: 18px;
  border: 1.5px solid transparent;
  background-image: linear-gradient(#0f172a, #0f172a), linear-gradient(135deg, #f59e0b 0%, #fbbf24 35%, #10b981 70%, #d97706 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 25px rgba(245, 158, 11, 0.18);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
  animation: heroBannerShimmer 6s infinite ease-in-out;
}

@keyframes heroBannerShimmer {
  0% { left: -150%; }
  30% { left: 200%; }
  100% { left: 200%; }
}

#heroTitle {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(90deg, #f59e0b 0%, #fef08a 35%, #38bdf8 70%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: textShineGold 4s linear infinite;
}

@keyframes textShineGold {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Animated Hero Agent Profile Box - Round Pill & Animated Wave Effects */
.hero-content-grid {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* Luxury Agent Profile Badge (Frameless Floating Avatar with Ambient Glow & Drop Shadows) */
.hero-agent-card.luxury-orbital-agent-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.65));
}

/* Glowing Ambient Aura Effect in Background */
.hero-agent-card.luxury-orbital-agent-badge::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 115px;
  height: 115px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45) 0%, rgba(16, 185, 129, 0.3) 50%, rgba(15, 23, 42, 0) 75%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
  animation: auraPulseGlow 3s infinite ease-in-out;
}

@keyframes auraPulseGlow {
  0%, 100% {
    opacity: 0.65;
    transform: translateX(-50%) scale(0.95);
    filter: blur(18px);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.18);
    filter: blur(26px);
  }
}

.hero-agent-card.luxury-orbital-agent-badge:hover {
  background: transparent;
  border: none;
  transform: translateY(-5px) scale(1.05);
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 25px rgba(245, 158, 11, 0.5));
}

/* Luxury Avatar Outer Halo Container */
.orbital-avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Outer Glowing Golden Halo Ring */
.orbital-ring-outer {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, #f59e0b, #fbbf24, #d97706, #f59e0b);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spinOrbitalRing 8s linear infinite;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

/* Inner Subtle Ring Arc */
.orbital-ring-inner {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #10b981, #f59e0b);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
}

/* Hide noisy floating satellite dots */
.orbital-particle-dot {
  display: none;
}

@keyframes spinOrbitalRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinOrbitalRingReverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* Luxury Photo Avatar Box with Dark Studio Vignette Overlay */
.luxury-avatar-photo-box {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #ffffff;
  z-index: 2;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  background: #0f172a;
}

.luxury-avatar-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: contrast(1.08) brightness(0.95);
  transition: transform 0.3s ease;
}

/* Elegant Dark Studio Vignette Overlay (Softens Cyan Passport Backgrounds) */
.luxury-avatar-photo-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at center, transparent 35%, rgba(15, 23, 42, 0.5) 75%, rgba(15, 23, 42, 0.85) 100%);
  pointer-events: none;
  z-index: 3;
}

/* Online Status Dot Badge */
.online-badge-dot {
  position: absolute;
  bottom: 2px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: #10b981;
  border: 2.5px solid #0f172a;
  border-radius: 50%;
  z-index: 5;
  box-shadow: 0 0 10px #10b981;
}

/* Agent Name & Badge Box */
.luxury-agent-name-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.luxury-agent-name-text {
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.luxury-agent-subtitle {
  font-size: 0.75rem;
  color: #fbbf24;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.hero-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(45deg, #d97706, #10b981, #3b82f6, #ec4899, #d97706);
  background-size: 300% 300%;
  animation: borderRotateGlow 3.5s infinite linear;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Radar Ripple Wave Effect around Avatar */
.radar-ring-1, .radar-ring-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.7);
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  animation: radarRipple 2.4s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.radar-ring-2 {
  animation-delay: 1.2s;
  border-color: rgba(217, 119, 6, 0.7);
}

@keyframes radarRipple {
  0% {
    width: 100%;
    height: 100%;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    width: 170%;
    height: 170%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.4);
  }
}

@keyframes borderRotateGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #ffffff;
  z-index: 2;
  position: relative;
}

.online-badge-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGreen 1.8s infinite;
  z-index: 3;
}

@keyframes pulseGreen {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px #10b981; }
  50% { transform: scale(1.25); box-shadow: 0 0 16px #10b981, 0 0 24px rgba(16, 185, 129, 0.8); }
}

.hero-agent-info {
  text-align: left;
}

.hero-agent-title {
  font-size: 0.76rem;
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-agent-name {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 800;
  margin: 2px 0;
}

.hero-agent-desc {
  color: #cbd5e1;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.hero-agent-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(217, 119, 6, 0.25);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.25s ease;
}

.hero-agent-card:hover .hero-agent-btn {
  background: var(--accent-gold);
  color: #ffffff;
}

.hero-text-block {
  flex: 1;
  min-width: 280px;
}

/* Footer */
.app-footer {
  margin-top: auto;
  background: var(--primary-900);
  color: var(--text-light);
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-app-footer {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-top: 1.5px solid #e2e8f0 !important;
  padding: 18px 20px 85px 20px !important;
  text-align: center !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  margin-top: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.admin-app-footer p,
#adminFooterCopyright {
  margin: 0 !important;
  color: #475569 !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
}

/* Language Switcher Base Box Styling */
.lang-switcher-box {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 3px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.lang-switcher-box .btn-nav {
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

/* Official Verified Agent Badge in Header */
.nav-agent-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4px 12px 4px 5px;
  border-radius: 99px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-agent-badge:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.nav-agent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #f59e0b;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.nav-agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-agent-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.nav-agent-tag {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 700;
}

/* Compact Hero Agent Pill Badge */
.compact-hero-agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 5px 14px 5px 6px;
  border-radius: 99px;
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.compact-hero-agent-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
  background: rgba(15, 23, 42, 0.75);
}

.agent-pill-avatar-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #f59e0b;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.agent-pill-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-pill-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}

.agent-pill-badge {
  font-size: 0.74rem;
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 768px) {
  /* 1. Header & Navigation Bar Mobile Optimization */
  .navbar {
    padding: 6px 12px 6px 8px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }
  
  .navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .brand-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.1rem !important;
  }

  .brand-title-styled {
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
  }

  .brand-title-styled span {
    font-size: 0.82rem !important;
  }

  .brand-sub-styled {
    display: none !important;
  }

  .lang-switcher-box {
    margin-left: auto !important;
    display: flex !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
  }

  .lang-switcher-box .btn-nav {
    padding: 3px 6px !important;
    font-size: 0.7rem !important;
  }

  .nav-agent-badge {
    padding: 3px 8px 3px 4px !important;
    gap: 5px !important;
    align-self: center !important;
  }

  .nav-agent-avatar {
    width: 26px !important;
    height: 26px !important;
  }

  .nav-agent-info {
    font-size: 0.74rem !important;
  }

  .nav-agent-tag {
    font-size: 0.64rem !important;
    padding: 1px 5px !important;
  }

  .hero-agent-badge {
    padding: 5px 14px 5px 5px !important;
    gap: 8px !important;
  }

  .hero-agent-avatar-wrap {
    width: 32px !important;
    height: 32px !important;
  }

  .hero-agent-text-info {
    font-size: 0.78rem !important;
    gap: 5px !important;
  }

  .hero-agent-verified-tag {
    font-size: 0.66rem !important;
    padding: 1px 6px !important;
  }

  .nav-actions {
    display: none !important;
  }

  /* 2. Hero Banner & Agent Profile Card Ultra-Compact Mobile Optimization */
  .hero-banner {
    padding: 12px 14px 12px 14px !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 10px !important;
  }

  .hero-agent-badge-container {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 6px !important;
  }

  .hero-agent-badge {
    padding: 3px 12px 3px 4px !important;
    gap: 6px !important;
  }

  .hero-agent-avatar-wrap {
    width: 26px !important;
    height: 26px !important;
  }

  .hero-agent-text-info {
    font-size: 0.74rem !important;
    gap: 4px !important;
  }

  .hero-agent-name {
    font-size: 0.76rem !important;
  }

  .hero-agent-verified-tag {
    font-size: 0.62rem !important;
    padding: 1px 5px !important;
  }

  #heroTitle {
    font-size: 1.02rem !important;
    margin: 0 0 4px 0 !important;
    line-height: 1.3 !important;
  }

  #heroSubtitle {
    display: none !important;
  }

  .category-pills {
    margin-top: 6px !important;
    gap: 6px !important;
    padding-bottom: 2px !important;
  }

  .cat-pill {
    padding: 4px 10px !important;
    font-size: 0.76rem !important;
  }

  /* Agent Profile Modal Mobile Enhancements */
  .modal-agent-card .agent-modal-header {
    padding: 16px 14px 14px 14px !important;
  }

  .modal-agent-card .avatar-pulse-glow {
    width: 68px !important;
    height: 68px !important;
  }

  .modal-agent-card h2 {
    font-size: 1.05rem !important;
  }

  .modal-agent-card .badge-shimmer-gold {
    font-size: 0.66rem !important;
    padding: 2px 7px !important;
  }

  .modal-agent-card .agent-modal-body {
    padding: 12px 14px !important;
    gap: 10px !important;
  }

  .modal-agent-card .agent-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .modal-agent-card .agent-stats-grid .stat-card-animated {
    padding: 8px 2px !important;
  }

  .hero-agent-card.luxury-orbital-agent-badge {
    padding: 4px;
  }

  .orbital-avatar-wrapper {
    width: 82px;
    height: 82px;
  }

  .luxury-avatar-photo-box {
    width: 72px;
    height: 72px;
  }

  .luxury-agent-name-text {
    font-size: 0.95rem;
  }

  .luxury-agent-subtitle {
    font-size: 0.72rem;
  }

  .hero-text-block {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .hero-banner h1 {
    font-size: 1.35rem !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
  }

  .hero-banner p {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
    margin-bottom: 14px !important;
  }

  .hero-cta-btn-shimmer {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px !important;
    border-radius: var(--radius-md) !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .hero-cta-content {
    gap: 10px !important;
    width: 100% !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }

  .hero-cta-icon-wrapper {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
  }

  .hero-cta-main-text {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
  }

  .hero-cta-sub-text {
    font-size: 0.72rem !important;
    margin-top: 2px !important;
  }

  /* 3. Category Pills Mobile Touch-Scroll Bar */
  .category-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto !important;
    padding: 6px 4px 8px 4px !important;
    gap: 8px !important;
    margin-top: 8px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .category-pills::-webkit-scrollbar {
    display: none;
  }

  .cat-pill {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
  }

  /* 4. Notice Animated Card Mobile */
  .notice-animated-card {
    padding: 10px 12px;
    font-size: 0.82rem;
    gap: 8px;
  }

  .notice-icon-spin {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .brand-sub-styled {
    display: none !important;
  }

  .nav-actions .btn {
    font-size: 0.75rem !important;
    padding: 6px 8px !important;
  }

  .hero-cta-main-text {
    font-size: 0.86rem !important;
  }
}

/* Modal Mobile Responsiveness */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 10px;
  }

  .modal-card {
    max-height: 94vh;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Hero CTA Shimmering Animated Button */
.hero-cta-btn-shimmer {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff !important;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-full);
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.5), 0 0 20px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.2px;
  animation: heroCtaPulse 3s infinite alternate;
}

.hero-cta-btn-shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 70%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-25deg);
  animation: heroShimmerGlow 3.5s infinite;
}

.hero-cta-btn-shimmer:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 14px 35px rgba(217, 119, 6, 0.7), 0 0 30px rgba(255, 215, 0, 0.6);
  border-color: #ffffff;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 50%, #92400e 100%);
}

.hero-cta-content {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 2;
}

.hero-cta-icon-wrapper {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
  animation: floatIcon 2.5s ease-in-out infinite alternate;
}

.hero-cta-main-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.3;
}

.hero-cta-sub-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fef3c7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  margin-top: 2px;
}

@keyframes heroShimmerGlow {
  0% { left: -100%; }
  30% { left: 150%; }
  100% { left: 150%; }
}

@keyframes heroCtaPulse {
  0% {
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.4), 0 0 15px rgba(245, 158, 11, 0.3);
  }
  100% {
    box-shadow: 0 12px 30px rgba(217, 119, 6, 0.7), 0 0 25px rgba(245, 158, 11, 0.6);
  }
}

@keyframes floatIcon {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

@keyframes warningPulseGlow {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.18), 0 0 0 0 rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
  }
  50% {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35), 0 0 0 6px rgba(245, 158, 11, 0.15);
    border-color: #d97706;
  }
}

/* Hero Banner Agent Badge (Centered Luxury Pill Card) & Animations */
.hero-agent-badge-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  width: 100%;
}

.hero-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 18px 6px 6px;
  border-radius: 99px;
  border: 1.8px solid var(--accent-gold);
  box-shadow: 0 6px 22px rgba(217, 119, 6, 0.3), 0 0 16px rgba(245, 158, 11, 0.25);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: agentBadgePulseGlow 3s infinite ease-in-out;
}

.hero-agent-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  animation: agentShimmerSweep 3.5s infinite ease-in-out;
}

.hero-agent-badge:hover {
  transform: translateY(-3px) scale(1.03);
  background: rgba(15, 23, 42, 0.92);
  border-color: #fbbf24;
  box-shadow: 0 12px 30px rgba(217, 119, 6, 0.5), 0 0 25px rgba(245, 158, 11, 0.45);
}

.hero-agent-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.hero-agent-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.online-indicator-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0f172a;
  box-shadow: 0 0 8px #10b981;
}

.hero-agent-text-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.hero-agent-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hero-agent-verified-tag {
  font-size: 0.74rem;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  padding: 2px 10px;
  border-radius: 99px;
  border: 1px solid rgba(16, 185, 129, 0.5);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-badge-arrow {
  color: var(--accent-gold);
  font-size: 0.82rem;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.hero-agent-badge:hover .hero-badge-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   LEFT SLIDING DRAWER NAVIGATION MENU SYSTEM (Menu bar នៅខាងឆ្វេង)
   ========================================================================== */

.btn-sidebar-toggle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  font-size: 1.12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-sidebar-toggle:hover {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
}

body.light-theme .btn-sidebar-toggle,
body.light-mode .btn-sidebar-toggle {
  background: #ffffff;
  border: 1.5px solid #a7f3d0;
  color: #059669;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

body.light-theme .btn-sidebar-toggle:hover,
body.light-mode .btn-sidebar-toggle:hover {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.left-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.left-sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.left-sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: #0f172a;
  color: #ffffff;
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.5);
  border-right: 1.5px solid rgba(255, 255, 255, 0.12);
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}

.left-sidebar-drawer.active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.sidebar-drawer-header {
  padding: 16px 18px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-sm {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f59e0b, #10b981);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.brand-title-sm {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.brand-sub-sm {
  font-size: 0.72rem;
  color: #94a3b8;
}

.btn-close-sidebar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-close-sidebar:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.sidebar-agent-card {
  margin: 14px 14px 6px 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-agent-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-gold);
}

.sidebar-agent-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  object-fit: cover;
}

.sidebar-agent-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.sidebar-agent-tag {
  font-size: 0.7rem;
  color: #10b981;
  font-weight: 600;
}

.sidebar-agent-card .arrow-icon {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--accent-gold);
}

.sidebar-scroll-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 14px 14px 24px 14px;
}

.sidebar-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fbbf24;
  margin: 14px 0 8px 4px;
}

.sidebar-menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-menu-list li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  transition: var(--transition);
}

.sidebar-menu-list li a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-menu-list li a i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-grid-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.sidebar-pill-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-pill-btn:hover {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #ffffff;
}

.sidebar-prov-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.prov-chip-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.prov-chip-btn:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

@keyframes agentBadgePulseGlow {
  0%, 100% {
    box-shadow: 0 6px 22px rgba(217, 119, 6, 0.3), 0 0 16px rgba(245, 158, 11, 0.25);
    border-color: var(--accent-gold);
  }
  50% {
    box-shadow: 0 12px 32px rgba(217, 119, 6, 0.6), 0 0 28px rgba(245, 158, 11, 0.5);
    border-color: #fbbf24;
  }
}

@keyframes agentShimmerSweep {
  0% { left: -100%; }
  35% { left: 150%; }
  100% { left: 150%; }
}


.notice-animated-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  border: 1.8px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: warningPulseGlow 2.5s infinite ease-in-out;
}

.notice-icon-spin {
  font-size: 1.4rem;
  color: #ea580c;
  flex-shrink: 0;
  animation: spinOrbitalRing 6s linear infinite;
}

/* Unified Map Pins & Filter Controls */
.map-filter-btn {
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--primary-800);
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-filter-btn:hover, .map-filter-btn.active {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.custom-map-price-pin div:hover {
  transform: scale(1.15) translateY(-2px);
  z-index: 999;
}

/* ==========================================================================
   MOBILE APP UI & BOTTOM NAVIGATION BAR SYSTEM
   ========================================================================== */

/* Hide Bottom Nav on PC / Desktop Web screens by default */
.mobile-bottom-nav {
  display: none !important;
}

/* Mobile Screen View (Phones & Tablets - 768px and below) */
@media (max-width: 768px) {
  #app {
    padding-bottom: 84px !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 68px;
    background: rgba(11, 19, 38, 0.78);
    backdrop-filter: blur(25px) saturate(210%);
    -webkit-backdrop-filter: blur(25px) saturate(210%);
    border-top: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 24px 24px 0 0;
    z-index: 990;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.22);
    transition: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 6px 6px;
    border-radius: var(--radius-full);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
    cursor: pointer;
    flex: 1;
    text-decoration: none;
  }

  body.light-theme .bottom-nav-item {
    color: #ffffff;
    font-weight: 800;
  }

  .bottom-nav-item .nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 28px;
    border-radius: 14px;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .bottom-nav-item i {
    font-size: 1.22rem;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    transition: transform 0.22s ease, color 0.22s ease, filter 0.22s ease;
  }

  body.light-theme .bottom-nav-item i {
    color: rgba(255, 255, 255, 0.92);
  }

  .bottom-nav-item span {
    white-space: nowrap;
    letter-spacing: 0.2px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  }

  body.light-theme .bottom-nav-item span {
    color: #ffffff;
    font-weight: 800;
  }

  .bottom-nav-item:hover {
    color: #f1f5f9;
  }

  body.light-theme .bottom-nav-item:hover {
    color: #0f172a;
  }

  .bottom-nav-item:hover .nav-icon-wrap {
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
  }

  .bottom-nav-item.active {
    color: #34d399;
    font-weight: 800;
  }

  .bottom-nav-item.active .nav-icon-wrap {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(16, 185, 129, 0.16));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(52, 211, 153, 0.4);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px) scale(1.05);
  }

  .bottom-nav-item.active i {
    transform: translateY(-1px) scale(1.1);
    color: #34d399;
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.7));
  }

  body.light-theme .bottom-nav-item.active {
    color: #059669;
  }

  body.light-theme .bottom-nav-item.active .nav-icon-wrap {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(5, 150, 105, 0.12));
    border: 1px solid rgba(16, 185, 129, 0.32);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.18);
  }

  body.light-theme .bottom-nav-item.active i {
    color: #059669;
    filter: drop-shadow(0 1px 3px rgba(5, 150, 105, 0.35));
  }

  /* Center Highlighted Floating Action Button (FAB) */
  .bottom-nav-item.center-fab {
    position: relative;
    top: -18px;
    padding: 0;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .bottom-nav-item.center-fab .fab-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid #ffffff;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.45), 0 0 0 3px rgba(16, 185, 129, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.75);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    animation: fabLuxuryFloat 3s infinite ease-in-out;
  }

  .bottom-nav-item.center-fab .fab-circle i {
    font-size: 1.55rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    margin: 0 !important;
    padding: 0 !important;
  }

  .bottom-nav-item.center-fab .fab-label,
  body.light-theme .bottom-nav-item.center-fab .fab-label {
    font-size: 0.78rem;
    font-weight: 900;
    color: #fbbf24;
    margin-top: 3px;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
    transition: all 0.2s ease;
  }

  .bottom-nav-item.center-fab:hover .fab-circle,
  .bottom-nav-item.center-fab:active .fab-circle {
    transform: scale(1.12) translateY(-2px);
    background: linear-gradient(135deg, #34d399 0%, #059669 60%, #065f46 100%);
    border-color: #ffffff;
    box-shadow: 0 12px 28px rgba(5, 150, 105, 0.65), 0 0 0 4px rgba(16, 185, 129, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.9);
  }

  @keyframes fabLuxuryFloat {
    0%, 100% {
      transform: translateY(0) scale(1);
      box-shadow: 0 8px 24px rgba(5, 150, 105, 0.45), 0 0 0 3px rgba(16, 185, 129, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.75);
    }
    50% {
      transform: translateY(-3px) scale(1.03);
      box-shadow: 0 12px 28px rgba(5, 150, 105, 0.65), 0 0 0 4px rgba(16, 185, 129, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.85);
    }
  }
}

/* ==========================================================================
   Admin Dark Theme Mode
   ========================================================================== */
body.dark-theme {
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --border-color: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --glass-bg: rgba(19, 27, 46, 0.88);
  --glass-border: rgba(255, 255, 255, 0.08);
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
}

body.dark-theme .navbar {
  background: #0f172a !important;
  border-bottom: 1px solid #1e293b !important;
}

body.dark-theme .card,
body.dark-theme .stat-card,
body.dark-theme .property-card,
body.dark-theme .table-container,
body.dark-theme .admin-sidebar,
body.dark-theme .modal-card,
body.dark-theme .tab-nav-btn {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .stat-card h3 {
  color: #f8fafc !important;
}

body.dark-theme .table-responsive table {
  color: #f8fafc !important;
}

body.dark-theme .table th {
  background: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #1e293b !important;
}

body.dark-theme .table td {
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

body.dark-theme .filter-bar,
body.dark-theme .search-box {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .btn-outline {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .btn-outline:hover {
  background: #334155 !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   UNIFIED MAP DYNAMIC PIN SCALING (EXPANDS ON ZOOM IN, SCALES ON ZOOM OUT)
   ========================================================================== */
.custom-map-smart-icon-pin > div,
.custom-map-smart-ocr-pin > div {
  transform: scale(var(--unified-map-pin-scale, 1)) !important;
  transform-origin: 50% 100% !important;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.25, 1) !important;
  will-change: transform;
}

/* Close-up view: Prominent luxury pins */
#unifiedMapContainer.map-zoom-detailed .custom-map-smart-icon-pin > div,
#unifiedMapContainer.map-zoom-detailed .custom-map-smart-ocr-pin > div {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.55)) !important;
}

/* Mid zoom: Soft neat shadow */
#unifiedMapContainer.map-zoom-mid .custom-map-smart-icon-pin > div,
#unifiedMapContainer.map-zoom-mid .custom-map-smart-ocr-pin > div {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35)) !important;
}

/* Far / Province zoom: Ultra-clean micro needle styling */
#unifiedMapContainer.map-zoom-far .custom-map-smart-icon-pin > div,
#unifiedMapContainer.map-zoom-far .custom-map-smart-ocr-pin > div {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)) !important;
}
#unifiedMapContainer.map-zoom-far .custom-map-smart-icon-pin i,
#unifiedMapContainer.map-zoom-far .custom-map-smart-ocr-pin i {
  display: none !important;
}

/* Custom Luxury Real Estate Cluster Badges */
.custom-luxury-map-cluster {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  cursor: pointer !important;
}
.custom-luxury-map-cluster:hover {
  transform: scale(1.18) !important;
  z-index: 10000 !important;
}
.custom-luxury-map-cluster div {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ==========================================================================
   GLOWING ADMINISTRATIVE BOUNDARY POLYGON STYLING (GOOGLE MAPS RED DASHED)
   ========================================================================== */
.glowing-location-boundary-polygon {
  filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.6)) !important;
  stroke-dasharray: 6 6 !important;
  animation: boundaryDashFlow 25s linear infinite !important;
  transition: all 0.3s ease !important;
}

@keyframes boundaryDashFlow {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: 200;
  }
}

.luxury-boundary-tooltip {
  background: #0f172a !important;
  color: #ef4444 !important;
  border: 1.5px solid #dc2626 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
  padding: 4px 8px !important;
}
.luxury-boundary-tooltip::before {
  border-top-color: #dc2626 !important;
}

/* ==========================================================================
   Modern Real Estate Map Cluster Badges
   ========================================================================== */
.custom-modern-cluster-wrapper {
  background: transparent !important;
  border: none !important;
}

.modern-map-cluster-bubble {
  position: relative;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: clusterBubbleFloat 3s infinite ease-in-out;
}

.modern-map-cluster-bubble:hover {
  transform: scale(1.22) !important;
  z-index: 99999 !important;
}

.modern-map-cluster-bubble.cluster-large {
  animation: clusterBubbleFloat 2.4s infinite ease-in-out, clusterNeonPulse 2s infinite ease-in-out;
}

@keyframes clusterBubbleFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.04);
  }
}

@keyframes clusterNeonPulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.7), 0 0 0 3px rgba(244, 114, 182, 0.4), inset 0 1px 2px rgba(255,255,255,0.6);
  }
  50% {
    box-shadow: 0 6px 24px rgba(236, 72, 153, 0.95), 0 0 0 6px rgba(244, 114, 182, 0.6), inset 0 1px 2px rgba(255,255,255,0.8);
  }
}

.unified-map-modal-overlay {
  z-index: 200000 !important;
  pointer-events: auto !important;
  touch-action: auto !important;
}

#unifiedMapContainer {
  pointer-events: auto !important;
  touch-action: pan-x pan-y pinch-zoom !important;
  cursor: grab;
}

#unifiedMapContainer .leaflet-pane,
#unifiedMapContainer .leaflet-map-pane,
#unifiedMapContainer .leaflet-tile-pane,
#unifiedMapContainer .leaflet-marker-pane,
#unifiedMapContainer .leaflet-control-container,
#unifiedMapContainer .leaflet-interactive {
  pointer-events: auto !important;
}

/* Global Backup & Restore Modal Styling */
.backup-restore-modal-card {
  background: #ffffff !important;
  color: #0f172a !important;
}

.backup-restore-body {
  background: #ffffff !important;
  color: #0f172a !important;
}

.backup-summary-box {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
}

.backup-stat-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

.backup-action-card-export {
  background: #ecfdf5 !important;
  border: 1.5px solid #10b981 !important;
}

.backup-card-title-green {
  color: #065f46 !important;
}

.backup-action-card-import {
  background: #f0f9ff !important;
  border: 1.5px solid #0284c7 !important;
}

.backup-card-title-blue {
  color: #075985 !important;
}

.backup-action-card-cloud {
  background: #faf5ff !important;
  border: 1.5px solid #a855f7 !important;
}

.backup-card-title-purple {
  color: #581c87 !important;
}

/* ==========================================================================
   ANIMATED CLUSTERS & TEARDROP MICRO-PINS SYSTEM
   ========================================================================== */
@keyframes pinFloatBob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes pinSonarPing {
  0% {
    transform: scale(0.8);
    opacity: 0.85;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

@keyframes clusterBreathing {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.05);
  }
}

@keyframes clusterRippleWave {
  0% {
    transform: scale(0.9);
    opacity: 0.85;
  }
  50% {
    opacity: 0.45;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* ==========================================================================
   LUXURY CRISP 3D MAP PIN & MARKER SYSTEM (NO UGLY BLURRY HALOS)
   ========================================================================== */

.prop-point-container {
  background: transparent !important;
  border: none !important;
}

.prop-point-wrapper {
  position: relative;
  width: 26px;
  height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  will-change: transform;
}

.prop-point-wrapper:hover {
  transform: scale(1.25) translateY(-5px) !important;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.65)) !important;
  z-index: 99999 !important;
}

/* NO BLURRY RING FOR NORMAL OR RESEARCH PINS - ONLY CRITICAL FOCUSED PINS */
.pin-radar-ring {
  display: none !important;
}

.prop-point-wrapper.is-focused-target-pin .pin-radar-ring {
  display: block !important;
  position: absolute;
  top: 13px;
  left: 13px;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  margin-left: -16px;
  border-radius: 50%;
  opacity: 0.85;
  pointer-events: none;
  animation: pinSonarPing 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  z-index: 0;
}

.prop-point-wrapper.is-focused-target-pin {
  z-index: 999999 !important;
}

.prop-point-wrapper.is-focused-target-pin .prop-point-pin {
  transform: rotate(-45deg) scale(1.35) !important;
  box-shadow: 0 0 20px #38bdf8, 0 0 0 3px #ffffff, 0 6px 16px rgba(0,0,0,0.6) !important;
  border-color: #ffffff !important;
  animation: pinTargetPulse 1.2s ease-in-out infinite alternate !important;
}

@keyframes pinTargetPulse {
  0% { transform: rotate(-45deg) scale(1.25); }
  100% { transform: rotate(-45deg) scale(1.45); filter: drop-shadow(0 0 8px #38bdf8); }
}

/* 3D Teardrop Pin Marker Body */
.prop-point-pin {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  box-sizing: border-box;
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Crisp Centered Icon */
.prop-point-icon {
  transform: rotate(45deg);
  color: #ffffff;
  font-size: 0.68rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Crisp Realistic Ground Shadow Dot */
.prop-point-ground-shadow {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 10px;
  height: 4px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 75%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

/* Compact Price Tag on Map Pin */
.prop-point-price-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 3;
}

/* ==========================================================================
   PROPERTY TYPE COLOR CODING (14 RICH LUXURY GRADIENTS)
   ========================================================================== */

/* 1. ដីធ្លី / Land (Emerald Green) */
.pin-bg-land {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

/* 2. ផ្ទះ / House (Amber / Warm Gold) */
.pin-bg-house {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

/* 3. ផ្ទះអាជីវកម្ម / Shophouse (Vibrant Orange) */
.pin-bg-shophouse {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
}

/* 4. វីឡា / Villa (Royal Purple) */
.pin-bg-villa {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
}

/* 5. ខុនដូ / Condo (Ocean Sky Blue) */
.pin-bg-condo {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
}

/* 6. អាផាតមិន / Apartment (Indigo) */
.pin-bg-apartment {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
}

/* 7. សណ្ឋាគារ & រីស៊ត / Hotel & Resort (Teal Cyan) */
.pin-bg-hotel {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
}

/* 8. ឃ្លាំង & រោងចក្រ / Warehouse & Factory (Rose Ruby) */
.pin-bg-warehouse {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important;
}

/* 9. អគារពាណិជ្ជកម្ម / Commercial Building (Electric Blue) */
.pin-bg-building {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
}

/* 10. កសិដ្ឋាន & ចំការ / Farm & Plantation (Lime Green) */
.pin-bg-farm {
  background: linear-gradient(135deg, #84cc16 0%, #4d7c0f 100%) !important;
}

/* 11. បន្ទប់ជួល / Room / Studio (Pink Magenta) */
.pin-bg-room {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%) !important;
}

/* 12. អចលនទ្រព្យទូទៅ / Default (Deep Azure) */
.pin-bg-default {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
}

/* 13. ភ្នាក់ងារក្រៅ / Agent (Teal Cyan) */
.pin-bg-agent {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important;
}

/* 14. អតិថិជន AI / AI Lead (Rose Pink) */
.pin-bg-ai-lead {
  background: linear-gradient(135deg, #db2777 0%, #9d174d 100%) !important;
}

/* 15. ការិយាល័យកណ្តាល / Company HQ (Gold Amber) */
.pin-bg-hq {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%) !important;
  border-color: #fde047 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.75), inset 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.luxury-animated-cluster {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: clusterBreathing 3s ease-in-out infinite;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.luxury-animated-cluster:hover {
  transform: translateY(-5px) scale(1.22) !important;
  filter: brightness(1.15) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)) !important;
  z-index: 99999 !important;
}

.cluster-ripple-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  animation: clusterRippleWave 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  z-index: 1;
}

.cluster-core-bubble {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 2;
  box-sizing: border-box;
}

.cluster-small .cluster-core-bubble,
.cluster-density-low .cluster-core-bubble {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.cluster-small .cluster-ripple-ring,
.cluster-density-low .cluster-ripple-ring {
  background: rgba(16, 185, 129, 0.4);
}

.cluster-mid-small .cluster-core-bubble,
.cluster-density-medium .cluster-core-bubble {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.45), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.cluster-mid-small .cluster-ripple-ring,
.cluster-density-medium .cluster-ripple-ring {
  background: rgba(2, 132, 199, 0.4);
}

.cluster-medium .cluster-core-bubble,
.cluster-density-high .cluster-core-bubble {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.45), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.cluster-medium .cluster-ripple-ring,
.cluster-density-high .cluster-ripple-ring {
  background: rgba(245, 158, 11, 0.4);
}

.cluster-large .cluster-core-bubble,
.cluster-density-very-high .cluster-core-bubble {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.5), 0 4px 14px rgba(0, 0, 0, 0.55);
}
.cluster-large .cluster-ripple-ring,
.cluster-density-very-high .cluster-ripple-ring {
  background: rgba(239, 68, 68, 0.5);
}

.cluster-icon-tag {
  font-size: 0.62rem;
  margin-right: 2px;
  display: inline-flex;
  align-items: center;
}
.cluster-num-tag {
  font-size: 0.80rem;
  font-weight: 900;
  line-height: 1;
}

/* Area Density Quick-Fly Bar & Interactive Pills */
.admin-map-density-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  scrollbar-width: none;
  z-index: 10;
  position: relative;
}
.admin-map-density-bar::-webkit-scrollbar {
  display: none;
}

body.light-theme .admin-map-density-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.map-density-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.map-density-pill span {
  color: inherit;
}
.map-density-pill:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}
.map-density-pill.pill-very-high {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}
.map-density-pill.pill-very-high span:last-child {
  background: #ef4444 !important;
  color: #ffffff !important;
}
.map-density-pill.pill-high {
  background: rgba(245, 158, 11, 0.35) !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
}
.map-density-pill.pill-high span:last-child {
  background: #f59e0b !important;
  color: #000000 !important;
}
.map-density-pill.pill-medium {
  background: rgba(2, 132, 199, 0.35) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}
.map-density-pill.pill-medium span:last-child {
  background: #0284c7 !important;
  color: #ffffff !important;
}
.map-density-pill.pill-low {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}
.map-density-pill.pill-low span:last-child {
  background: #10b981 !important;
  color: #ffffff !important;
}

body.light-theme .map-density-pill {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}
body.light-theme .map-density-pill.pill-very-high {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
}
body.light-theme .map-density-pill.pill-high {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #b45309;
}
body.light-theme .map-density-pill.pill-medium {
  background: #f0f9ff;
  border-color: #38bdf8;
  color: #0284c7;
}
body.light-theme .map-density-pill.pill-low {
  background: #f0fdf4;
  border-color: #4ade80;
  color: #15803d;
}

/* ==========================================================================
   ADMIN & PUBLIC UNIFIED MAP EXPLORER & ADVANCED PROPERTY FILTER (THEME ENGINE)
   ========================================================================== */
.admin-map-modal-wrap {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 200000 !important;
  background: #0b1329 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.admin-map-header-bar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box !important;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  padding-left: calc(12px + env(safe-area-inset-left, 0px)) !important;
  padding-right: calc(12px + env(safe-area-inset-right, 0px)) !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  flex-shrink: 0;
  min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
}

.admin-map-header-title {
  color: #ffffff !important;
  font-weight: 900 !important;
}

.admin-map-btn-circle {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  transition: all 0.2s ease;
}

.admin-map-btn-circle:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.admin-map-header-btn-reset {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #e2e8f0 !important;
  transition: all 0.2s ease;
}

.admin-map-header-btn-reset:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.admin-map-search-row {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  z-index: 999;
}

.admin-map-search-box {
  position: relative;
  flex: 1;
  min-width: 0;
}

.admin-map-search-input,
input.admin-map-search-input[type="text"] {
  width: 100% !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 76px 0 38px !important;
  border-radius: 99px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
  background: rgba(255, 255, 255, 0.10) !important;
  color: #ffffff !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

.admin-map-search-input:focus,
input.admin-map-search-input[type="text"]:focus {
  border-color: #38bdf8 !important;
  background: rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45) !important;
}

.admin-map-search-input::placeholder,
input.admin-map-search-input[type="text"]::placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  font-weight: 600 !important;
}

.admin-map-search-icon {
  color: #38bdf8 !important;
}

.admin-map-chips-row {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding: 6px 12px 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 998;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.admin-map-chips-row::-webkit-scrollbar {
  display: none;
}

.admin-map-chip {
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(255, 255, 255, 0.10) !important;
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.admin-map-chip:hover {
  background: rgba(255, 255, 255, 0.20) !important;
  border-color: rgba(255, 255, 255, 0.40) !important;
  color: #ffffff !important;
}

.admin-map-chip.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.6) !important;
}

.admin-map-chip span[id^="adminMapPillCount"] {
  color: #38bdf8 !important;
  font-weight: 900 !important;
}

.admin-map-chip.active span[id^="adminMapPillCount"] {
  color: #ffffff !important;
}

.admin-map-chip.chip-gis-only {
  background: rgba(16, 185, 129, 0.20) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  color: #34d399 !important;
  font-weight: 800 !important;
}

.admin-map-chip.chip-gis-only.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.5) !important;
}

body.light-theme .admin-map-chip.chip-gis-only {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  color: #059669 !important;
}

body.light-theme .admin-map-chip.chip-gis-only.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
}

.admin-map-chip.chip-my-research {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  color: #fbbf24 !important;
  font-weight: 800 !important;
}

.admin-map-chip.chip-my-research.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.5) !important;
}

body.light-theme .admin-map-chip.chip-my-research {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: #b45309 !important;
}

body.light-theme .admin-map-chip.chip-my-research.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   ADMIN MAP ON / OFF TOGGLE CHIPS STYLING
   ========================================================================== */
.admin-map-chip .toggle-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  border-radius: 99px;
  font-size: 0.60rem;
  font-weight: 900;
  margin-left: 3px;
  letter-spacing: 0.3px;
  line-height: 1.2;
  transition: all 0.15s ease;
}
.admin-map-chip .toggle-indicator.on {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.4);
}
.admin-map-chip#adminMapChipAll .toggle-indicator.on {
  background: #ffffff !important;
  color: #0284c7 !important;
}
.admin-map-chip.is-off {
  opacity: 0.55 !important;
  background: rgba(148, 163, 184, 0.12) !important;
  border: 1.5px dashed #94a3b8 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}
.admin-map-chip.is-off:hover {
  opacity: 0.8 !important;
  background: rgba(148, 163, 184, 0.22) !important;
}
.admin-map-chip.is-off .toggle-indicator {
  background: #64748b !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}
.admin-map-chip.is-off span[id^="adminMapPillCount"] {
  color: #94a3b8 !important;
}

body.light-theme .admin-map-chip.is-off {
  background: #f1f5f9 !important;
  border: 1.5px dashed #cbd5e1 !important;
  color: #94a3b8 !important;
  opacity: 0.55 !important;
}
body.light-theme .admin-map-chip.is-off .toggle-indicator {
  background: #cbd5e1 !important;
  color: #64748b !important;
}

.admin-map-density-label {
  font-size: 0.78rem;
  font-weight: 900;
  color: #38bdf8 !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
}

body.light-theme .admin-map-density-label {
  color: #0284c7 !important;
}

.admin-map-filter-toggle-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1.5px solid #38bdf8 !important;
  background: rgba(2, 132, 199, 0.25) !important;
  color: #38bdf8 !important;
  font-size: 0.76rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-map-filter-toggle-btn.has-filters {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.5);
}

/* Unified Floating Action Column on Map (Bottom Right - 32px Compact Spheres) */
.admin-map-floating-layer {
  position: absolute !important;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  top: auto !important;
  right: calc(12px + env(safe-area-inset-right, 0px)) !important;
  z-index: 1000 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 5px !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

body.light-theme .admin-map-floating-layer {
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Floating Map Tile Switcher & GIS Controls (Top Right on Map) */
.admin-map-tile-layer {
  position: absolute !important;
  top: 12px !important;
  bottom: auto !important;
  right: 12px !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: auto !important;
}

/* Cadastral Plan Drawing Shortcut Button (Top Right next to Satellite icon) */
.admin-map-tile-layer .btn-map-cadastral-shortcut {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  border-radius: 16px !important;
  border: 1.5px solid #059669 !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.45), 0 2px 5px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-size: 0.80rem !important;
  font-weight: 800 !important;
  font-family: inherit !important;
  white-space: nowrap !important;
  user-select: none !important;
  text-decoration: none !important;
}

body.light-theme .admin-map-tile-layer .btn-map-cadastral-shortcut {
  border: 1.5px solid #059669 !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35), 0 2px 5px rgba(0, 0, 0, 0.15) !important;
}

.admin-map-tile-layer .btn-map-cadastral-shortcut:hover {
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.65), 0 3px 8px rgba(0, 0, 0, 0.3) !important;
  background: linear-gradient(135deg, #059669, #047857) !important;
}

.admin-map-tile-layer .btn-map-cadastral-shortcut:active {
  transform: translateY(0) scale(0.97) !important;
}

.admin-map-tile-layer .btn-map-cadastral-shortcut i {
  font-size: 0.85rem !important;
  color: #ffffff !important;
}

.admin-map-tile-layer .btn-map-cadastral-shortcut span {
  font-size: 0.80rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1 !important;
}

.admin-map-tile-layer .btn-tile-switch {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding: 0 !important;
  user-select: none !important;
}

body.light-theme .admin-map-tile-layer .btn-tile-switch {
  border: 1.5px solid #cbd5e1 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.15) !important;
}

.admin-map-tile-layer .btn-tile-switch:hover {
  transform: translateY(-2px) scale(1.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.admin-map-floating-layer .btn-tile-switch {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding: 0 !important;
  font-size: 0.85rem !important;
}

body.light-theme .admin-map-floating-layer .btn-tile-switch {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
  color: #334155 !important;
}

.admin-map-floating-layer .btn-tile-switch:hover {
  transform: scale(1.14) !important;
}

/* Street Tile Active (Legacy Support) */
.admin-map-floating-layer .btn-tile-switch.active#btnAdminTileStreet,
.admin-map-floating-layer .btn-tile-switch.active#btnPublicTileStreet {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8) !important;
}

.admin-map-floating-layer .btn-tile-switch.active#btnAdminTileStreet i,
.admin-map-floating-layer .btn-tile-switch.active#btnPublicTileStreet i {
  color: #ffffff !important;
}

/* Satellite Tile Active (Legacy Support) */
.admin-map-floating-layer .btn-tile-switch.active#btnAdminTileSat,
.admin-map-floating-layer .btn-tile-switch.active#btnPublicTileSat {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8) !important;
}

.admin-map-floating-layer .btn-tile-switch.active#btnAdminTileSat i,
.admin-map-floating-layer .btn-tile-switch.active#btnPublicTileSat i {
  color: #ffffff !important;
}

/* Combined Unified Main Map Tile Toggle (Satellite / Street) */
.admin-map-tile-layer .btn-tile-switch#btnAdminToggleTile,
.admin-map-tile-layer .btn-tile-switch#btnPublicToggleTile,
.admin-map-floating-layer .btn-tile-switch#btnAdminToggleTile,
.admin-map-floating-layer .btn-tile-switch#btnPublicToggleTile {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-map-tile-layer .btn-tile-switch#btnAdminToggleTile i,
.admin-map-tile-layer .btn-tile-switch#btnPublicToggleTile i,
.admin-map-floating-layer .btn-tile-switch#btnAdminToggleTile i,
.admin-map-floating-layer .btn-tile-switch#btnPublicToggleTile i {
  color: #38bdf8 !important;
  font-size: 1.05rem;
  transition: all 0.25s ease;
}

.admin-map-tile-layer .btn-tile-switch.active#btnAdminToggleTile,
.admin-map-tile-layer .btn-tile-switch.active#btnPublicToggleTile,
.admin-map-tile-layer .btn-tile-switch.is-sat#btnAdminToggleTile,
.admin-map-tile-layer .btn-tile-switch.is-sat#btnPublicToggleTile,
.admin-map-floating-layer .btn-tile-switch.active#btnAdminToggleTile,
.admin-map-floating-layer .btn-tile-switch.active#btnPublicToggleTile,
.admin-map-floating-layer .btn-tile-switch.is-sat#btnAdminToggleTile,
.admin-map-floating-layer .btn-tile-switch.is-sat#btnPublicToggleTile {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9) !important;
}

.admin-map-tile-layer .btn-tile-switch.active#btnAdminToggleTile i,
.admin-map-tile-layer .btn-tile-switch.active#btnPublicToggleTile i,
.admin-map-tile-layer .btn-tile-switch.is-sat#btnAdminToggleTile i,
.admin-map-tile-layer .btn-tile-switch.is-sat#btnPublicToggleTile i,
.admin-map-floating-layer .btn-tile-switch.active#btnAdminToggleTile i,
.admin-map-floating-layer .btn-tile-switch.active#btnPublicToggleTile i,
.admin-map-floating-layer .btn-tile-switch.is-sat#btnAdminToggleTile i,
.admin-map-floating-layer .btn-tile-switch.is-sat#btnPublicToggleTile i {
  color: #ffffff !important;
}

/* Light Theme Support */
body.light-theme .admin-map-tile-layer .btn-tile-switch#btnAdminToggleTile,
body.light-theme .admin-map-tile-layer .btn-tile-switch#btnPublicToggleTile,
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnAdminToggleTile,
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnPublicToggleTile {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
}

body.light-theme .admin-map-tile-layer .btn-tile-switch#btnAdminToggleTile:not(.active):not(.is-sat) i,
body.light-theme .admin-map-tile-layer .btn-tile-switch#btnPublicToggleTile:not(.active):not(.is-sat) i,
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnAdminToggleTile:not(.active):not(.is-sat) i,
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnPublicToggleTile:not(.active):not(.is-sat) i {
  color: #0284c7 !important;
}

body.light-theme .admin-map-tile-layer .btn-tile-switch.active#btnAdminToggleTile,
body.light-theme .admin-map-tile-layer .btn-tile-switch.active#btnPublicToggleTile,
body.light-theme .admin-map-tile-layer .btn-tile-switch.is-sat#btnAdminToggleTile,
body.light-theme .admin-map-tile-layer .btn-tile-switch.is-sat#btnPublicToggleTile,
body.light-theme .admin-map-floating-layer .btn-tile-switch.active#btnAdminToggleTile,
body.light-theme .admin-map-floating-layer .btn-tile-switch.active#btnPublicToggleTile,
body.light-theme .admin-map-floating-layer .btn-tile-switch.is-sat#btnAdminToggleTile,
body.light-theme .admin-map-floating-layer .btn-tile-switch.is-sat#btnPublicToggleTile {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.8) !important;
}

body.light-theme .admin-map-tile-layer .btn-tile-switch.active#btnAdminToggleTile i,
body.light-theme .admin-map-tile-layer .btn-tile-switch.active#btnPublicToggleTile i,
body.light-theme .admin-map-tile-layer .btn-tile-switch.is-sat#btnAdminToggleTile i,
body.light-theme .admin-map-tile-layer .btn-tile-switch.is-sat#btnPublicToggleTile i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.active#btnAdminToggleTile i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.active#btnPublicToggleTile i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.is-sat#btnAdminToggleTile i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.is-sat#btnPublicToggleTile i {
  color: #ffffff !important;
}

/* Inactive Street/Sat Icon Color in Light Theme */
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnAdminTileStreet:not(.active) i,
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnPublicTileStreet:not(.active) i,
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnAdminTileSat:not(.active) i,
body.light-theme .admin-map-floating-layer .btn-tile-switch#btnPublicTileSat:not(.active) i {
  color: #0284c7 !important;
}

/* Cadastral Parcel Button (ALWAYS Bright Emerald Green with Crisp White Icon) */
.admin-map-floating-layer .btn-tile-switch.btn-tool-cadastral,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-tool-cadastral {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: 1.5px solid #059669 !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.55) !important;
  color: #ffffff !important;
}

.admin-map-floating-layer .btn-tile-switch.btn-tool-cadastral i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-tool-cadastral i {
  color: #ffffff !important;
  font-size: 0.90rem !important;
}

/* Side Lengths Toggle (Active) */
.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides.active,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides.active {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.45) !important;
}

.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides.active i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides.active i {
  color: #0284c7 !important;
  font-size: 0.85rem !important;
}

/* Side Lengths Toggle (Inactive) */
.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides:not(.active),
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides:not(.active) {
  opacity: 0.45 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides:not(.active) i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-sides:not(.active) i {
  color: #94a3b8 !important;
}

/* Area Toggle (Active) */
.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area.active,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area.active {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45) !important;
}

.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area.active i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area.active i {
  color: #10b981 !important;
  font-size: 0.85rem !important;
}

/* Area Toggle (Inactive) */
.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area:not(.active),
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area:not(.active) {
  opacity: 0.45 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area:not(.active) i,
body.light-theme .admin-map-floating-layer .btn-tile-switch.btn-toggle-gis-area:not(.active) i {
  color: #94a3b8 !important;
}

/* GPS & Fit Bounds buttons within the stack */
.admin-map-floating-layer .btn-tile-switch.btn-gps-locate:hover,
.admin-map-floating-layer .btn-tile-switch.btn-fit-bounds:hover {
  transform: scale(1.15) !important;
}

.admin-map-floating-btn {
  position: absolute;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
}

.admin-map-floating-btn:active {
  transform: scale(0.92);
}

/* Filter Drawer (Bottom Sheet) */
.admin-map-filter-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeInOverlay 0.2s ease;
}

.admin-map-filter-drawer-card {
  background: #0f172a;
  border-top: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 22px 22px 0 0;
  max-height: 82vh;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.75);
  animation: slideUpDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.admin-map-drawer-header {
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
}

.admin-map-drawer-body {
  padding: 14px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0b1120;
}

.admin-map-drawer-title {
  color: #ffffff !important;
  font-weight: 900 !important;
}

.admin-map-drawer-close {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  transition: all 0.2s ease;
}

.admin-map-drawer-close:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

/* Grouped Executive Section Card */
.admin-map-drawer-section {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: all 0.2s ease;
}

.admin-map-drawer-section-title {
  font-size: 0.80rem;
  font-weight: 800;
  color: #e2e8f0 !important;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  letter-spacing: 0.01em;
}

.admin-map-drawer-section-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* Symmetrical Mathematical Grids */
.admin-map-drawer-pill-grid {
  display: grid;
  gap: 7px;
  width: 100%;
}

.admin-map-drawer-pill-grid.grid-col-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-map-drawer-pill-grid.grid-col-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-map-drawer-pill-grid .span-all {
  grid-column: 1 / -1 !important;
}

.admin-map-drawer-pill {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.77rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1 !important;
  cursor: pointer;
  transition: all 0.16s ease;
  outline: none !important;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.admin-map-drawer-pill:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
  transform: translateY(-1px);
}

.admin-map-drawer-pill:active {
  transform: translateY(0);
}

.admin-map-drawer-pill:focus-visible {
  outline: none !important;
}

.admin-map-drawer-pill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.45) !important;
}

.admin-map-drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  background: #0f172a;
}

.admin-map-drawer-btn-reset {
  flex: 1;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  color: #cbd5e1 !important;
  font-weight: 800 !important;
  font-size: 0.80rem !important;
  padding: 10px !important;
  border-radius: 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.admin-map-drawer-btn-reset:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.admin-map-drawer-btn-apply {
  flex: 2;
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.82rem !important;
  padding: 10px !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.admin-map-drawer-btn-apply:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5) !important;
  transform: translateY(-1px);
}

/* Floating Bottom Sheet Property Preview */
.admin-map-preview-card {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 94%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  padding: 12px 14px;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: slideUpPreview 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

@keyframes slideUpDrawer {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpPreview {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.admin-map-legend-bar {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  z-index: 1000;
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  max-width: calc(100vw - 120px);
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-map-legend-bar::-webkit-scrollbar {
  display: none;
}

.admin-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
}

.admin-map-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.prop-point-price-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 2;
}

/* Property Type Color Definitions (Refined Modern Hues) */
.pin-bg-villa {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%) !important;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.5) !important;
}

.pin-bg-shophouse {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5) !important;
}

.pin-bg-condo {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.5) !important;
}

.pin-bg-land {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5) !important;
}

.pin-bg-warehouse {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important;
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.5) !important;
}

.pin-bg-apartment {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.5) !important;
}

.pin-bg-default {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.5) !important;
}

/* --- Admin Map Popup Photo Card --- */
.admin-map-photo-card {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  outline: none;
}
.admin-map-photo-card:hover {
  transform: translateY(-2px) scale(1.01);
  border-color: #0284c7 !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35) !important;
}
.admin-map-photo-card:active {
  transform: scale(0.98);
}
.admin-map-photo-card:hover img {
  transform: scale(1.06);
}

/* ==========================================================================
   UNIFIED MAP EXPLORER - LIGHT THEME ENGINE (FOR PUBLIC APP & ADMIN APP)
   ========================================================================== */
body.light-theme .admin-map-modal-wrap,
body.light-theme .admin-map-modal-inner,
body.light-theme .admin-map-canvas-wrap {
  background: #f1f5f9 !important;
}

body.light-theme .admin-map-header-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .admin-map-header-title {
  color: #0f172a !important;
}

body.light-theme .admin-map-btn-circle,
body.light-theme .admin-map-header-btn-reset {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.light-theme .admin-map-search-row {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .admin-map-search-input,
body.light-theme input.admin-map-search-input[type="text"] {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  padding: 0 76px 0 38px !important;
}

body.light-theme .admin-map-search-input::placeholder,
body.light-theme input.admin-map-search-input[type="text"]::placeholder {
  color: #94a3b8 !important;
}

body.light-theme .admin-map-search-icon {
  color: #64748b !important;
}

body.light-theme .admin-map-filter-toggle-btn {
  background: rgba(2, 132, 199, 0.1) !important;
  border: 1.5px solid #0284c7 !important;
  color: #0284c7 !important;
}

body.light-theme .admin-map-chips-row {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .admin-map-chip {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

body.light-theme .admin-map-chip.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.45) !important;
}

body.light-theme .admin-map-chip.chip-today {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #d97706 !important;
}

body.light-theme .admin-map-chip.chip-week {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #059669 !important;
}

body.light-theme .admin-map-floating-layer {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.light-theme .admin-map-floating-layer .btn-tile-switch {
  color: #ffffff !important;
}

body.light-theme .admin-map-floating-btn {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme .admin-map-legend-bar {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .admin-map-legend-item {
  color: #1e293b !important;
}

body.light-theme .admin-map-filter-drawer-card {
  background: #ffffff !important;
  border-top: 2.5px solid #0284c7 !important;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22) !important;
}

body.light-theme .admin-map-drawer-header {
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
}

body.light-theme .admin-map-drawer-title {
  color: #0f172a !important;
}

body.light-theme .admin-map-drawer-close {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

body.light-theme .admin-map-drawer-close:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-theme .admin-map-drawer-body {
  background: #f8fafc !important;
}

body.light-theme .admin-map-drawer-section {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .admin-map-drawer-section-title {
  color: #0f172a !important;
}

body.light-theme .admin-map-drawer-pill {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .admin-map-drawer-pill:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-theme .admin-map-drawer-pill.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35) !important;
}

body.light-theme .admin-map-drawer-footer {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .admin-map-drawer-btn-reset {
  background: #f1f5f9 !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #475569 !important;
}

body.light-theme .admin-map-drawer-btn-reset:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-theme .admin-map-drawer-btn-apply {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
}


/* ==========================================================================
   Phone Cross-Intelligence Badges & Modal Styles (Modern Light Theme)
   ========================================================================== */
.phone-intel-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.phone-intel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  text-decoration: none;
  line-height: 1.2;
}

.phone-intel-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.phone-intel-badge.badge-research {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.phone-intel-badge.badge-research:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.phone-intel-badge.badge-official {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.phone-intel-badge.badge-official:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.phone-intel-badge.badge-fb {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
.phone-intel-badge.badge-fb:hover {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
}

.phone-intel-badge.badge-sub {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.phone-intel-badge.badge-sub:hover {
  background: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
}

.phone-intel-badge.badge-all {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.phone-intel-tab-btn {
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.phone-intel-tab-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.phone-intel-tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3) !important;
}

.phone-intel-item-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.phone-intel-item-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.12);
}

/* ==========================================================================
   Tactile 3D Action Buttons (Luxury Push Effect)
   ========================================================================== */
.btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 10px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-3d:active {
  transform: translateY(2.5px);
}

/* Soft 3D Green - ទៅកាន់ទីតាំង */
.btn-3d-location, .btn-3d-gps {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46 !important;
  border: 1.5px solid #a7f3d0;
  border-bottom: 3.5px solid #6ee7b7;
  box-shadow: 0 2px 5px rgba(16,185,129,0.15), inset 0 1px 0 #ffffff;
}
.btn-3d-location:hover, .btn-3d-gps:hover {
  background: linear-gradient(180deg, #d1fae5 0%, #a7f3d0 100%);
  color: #047857 !important;
  border-color: #6ee7b7;
  border-bottom-color: #34d399;
}
.btn-3d-location:active, .btn-3d-gps:active {
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 2px rgba(16,185,129,0.1);
}

/* 3D Ocean Primary - កែសម្រួល */
.btn-3d-primary {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  border: 1px solid #0284c7;
  border-bottom: 3.5px solid #075985;
  box-shadow: 0 4px 12px rgba(2,132,199,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-3d-primary:hover {
  background: linear-gradient(180deg, #0369a1 0%, #075985 100%);
}
.btn-3d-primary:active {
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 3px rgba(2,132,199,0.2);
}

.btn-3d-fb {
  background: linear-gradient(180deg, #1877f2 0%, #0d65d9 100%);
  color: #ffffff !important;
  border: 1px solid #1877f2;
  border-bottom: 3.5px solid #0a4da6;
  box-shadow: 0 4px 12px rgba(24,119,242,0.35), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-3d-fb:hover {
  background: linear-gradient(180deg, #0d65d9 0%, #0a4da6 100%);
}
.btn-3d-fb:active {
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 3px rgba(24,119,242,0.2);
}

.btn-3d-sub {
  background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff !important;
  border: 1px solid #ea580c;
  border-bottom: 3.5px solid #9a3412;
  box-shadow: 0 4px 12px rgba(234,88,12,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-3d-sub:hover {
  background: linear-gradient(180deg, #c2410c 0%, #9a3412 100%);
}
.btn-3d-sub:active {
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 3px rgba(234,88,12,0.2);
}

/* Soft 3D Red - បិទ */
.btn-3d-close, .btn-3d-close-red {
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  color: #be123c !important;
  border: 1.5px solid #fecdd3;
  border-bottom: 3.5px solid #fda4af;
  box-shadow: 0 2px 5px rgba(225,29,72,0.12), inset 0 1px 0 #ffffff;
}
.btn-3d-close:hover, .btn-3d-close-red:hover {
  background: linear-gradient(180deg, #ffe4e6 0%, #fecdd3 100%);
  color: #9f1239 !important;
  border-color: #fda4af;
  border-bottom-color: #fb7185;
}
.btn-3d-close:active, .btn-3d-close-red:active {
  border-bottom-width: 1.5px;
  box-shadow: 0 1px 2px rgba(225,29,72,0.1);
}

/* ==========================================================================
   Cadastral GIS Land Parcel Drawer & Polygon Map Engine
   ========================================================================== */
.cadastral-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.88);
  z-index: 99990 !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  transition: padding 0.25s ease;
}

.cadastral-drawer-overlay.is-fullscreen {
  padding: 0 !important;
}

.cadastral-drawer-card {
  width: 90vw;
  max-width: 1280px;
  height: 84vh;
  max-height: 840px;
  background: #0f172a;
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 45px rgba(16, 185, 129, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin: auto;
}

.cadastral-drawer-card.is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  inset: 0 !important;
  position: fixed !important;
  margin: 0 !important;
  z-index: 1000002 !important;
}

.cadastral-drawer-header {
  background: linear-gradient(135deg, #0b0f19 0%, #1e293b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-sizing: border-box !important;
  padding: 12px 18px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  padding-left: calc(18px + env(safe-area-inset-left, 0px)) !important;
  padding-right: calc(18px + env(safe-area-inset-right, 0px)) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-height: calc(52px + env(safe-area-inset-top, 0px)) !important;
}

.cadastral-header-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.2);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.cadastral-header-title {
  margin: 0;
  font-size: 1.12rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.cadastral-header-sub {
  font-size: 0.82rem !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  margin-top: 2px;
}

.cadastral-live-area-pill {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.cadastral-live-area-pill span {
  color: #fde68a !important;
  font-weight: 900 !important;
}

.cadastral-drawer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cadastral-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.30);
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  padding: 0;
}

.cadastral-icon-btn i {
  color: #ffffff !important;
  font-size: 0.92rem;
  pointer-events: none;
}

.cadastral-icon-btn:hover {
  background: rgba(56, 189, 248, 0.35);
  border-color: #38bdf8;
  color: #ffffff !important;
  transform: scale(1.08);
}

.cadastral-icon-btn.cadastral-btn-close:hover {
  background: rgba(239, 68, 68, 0.5);
  border-color: #ef4444;
}

.cadastral-icon-btn.cadastral-btn-close:hover i {
  color: #ffffff !important;
}

.cadastral-drawer-toolbar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-sizing: border-box;
  width: 100%;
}

.cadastral-drawer-toolbar::-webkit-scrollbar {
  display: none;
}

/* Search Wrapper & Compact Input (Flexible layout, shrinks gracefully on mobile - Zero Overlap) */
.cadastral-search-wrapper {
  position: relative;
  flex: 1 1 auto !important;
  min-width: 80px !important;
  max-width: 250px !important;
  width: auto !important;
  height: 30px;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 7px;
  padding: 0 3px 0 7px !important;
  gap: 4px !important;
  transition: all 0.2s ease;
}

.cadastral-search-wrapper:focus-within {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.cadastral-search-icon {
  position: static !important;
  transform: none !important;
  color: #94a3b8;
  font-size: 0.74rem !important;
  pointer-events: none;
  flex-shrink: 0 !important;
}

.cadastral-search-input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  padding: 0 4px !important;
  margin: 0 !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  text-overflow: ellipsis;
}

.cadastral-search-btn {
  position: static !important;
  transform: none !important;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
  border-radius: 5px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.68rem;
  transition: all 0.15s ease;
  flex-shrink: 0 !important;
}

.cadastral-search-btn:hover {
  background: #0284c7;
  transform: scale(1.08);
}

.cadastral-search-btn.btn-add-point {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4) !important;
}

.cadastral-search-btn.btn-add-point:hover {
  background: #059669 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.75) !important;
  transform: scale(1.08);
}

/* Standard Button Height: 30px & Compact Padding to Fit on Single Row */
.btn-cadastral-tool {
  height: 30px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
  flex-shrink: 0;
}

.btn-cadastral-tool:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.btn-cadastral-tool.btn-tool-import {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
}

.btn-cadastral-tool.btn-tool-import:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.btn-cadastral-tool.btn-tool-export {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fef3c7;
}

.btn-cadastral-tool.btn-tool-export:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
  color: #ffffff;
}

.btn-cadastral-tool.btn-tool-redo {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.4);
  color: #e0f2fe;
}

.btn-cadastral-tool.btn-tool-redo:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
}

.btn-cadastral-tool.btn-tool-coords {
  background: rgba(168, 85, 247, 0.18) !important;
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
  color: #f3e8ff !important;
}

.btn-cadastral-tool.btn-tool-coords span {
  color: #f3e8ff !important;
  font-weight: 800 !important;
}

.btn-cadastral-tool.btn-tool-coords i {
  color: #c084fc !important;
}

.btn-cadastral-tool.btn-tool-coords:hover {
  background: rgba(168, 85, 247, 0.32) !important;
  border-color: #c084fc !important;
  color: #ffffff !important;
}

.btn-cadastral-tool.btn-tool-clear {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.btn-cadastral-tool.btn-tool-clear:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
}

/* Save Boundary Button */
.btn-cadastral-save {
  height: 30px;
  box-sizing: border-box;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1.5px solid #34d399;
  color: #ffffff;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.btn-cadastral-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(16, 185, 129, 0.6);
  border-color: #6ee7b7;
}



/* Locate Me Button */
.btn-locate-me {
  background: rgba(2, 132, 199, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.btn-locate-me:hover {
  background: rgba(2, 132, 199, 0.35) !important;
  border-color: #38bdf8 !important;
}

.cadastral-map-canvas {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 520px;
  position: relative;
}

/* Ensure all Cadastral GIS parcels and lines are solid, smooth and continuous (មិនដាច់ៗ) */
.cadastral-active-parcel,
.cadastral-active-line,
.cadastral-existing-ref-polygon,
.cadastral-existing-ref-line,
path.cadastral-existing-ref-polygon,
path.cadastral-active-parcel {
  stroke-dasharray: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Frosted Glassmorphism Points Counter Badge (ព្រាលៗបែបទំនើប) */
.cadastral-points-counter-badge {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  left: calc(16px + env(safe-area-inset-left, 0px)) !important;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.45) !important;
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
  pointer-events: none;
}

/* Frosted Glassmorphism Leaflet Zoom Controls (ព្រាលៗបែបទំនើប មិនជាន់គ្នា) */
.cadastral-map-canvas .leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  background: rgba(255, 255, 255, 0.65) !important;
  margin-top: 14px !important;
  margin-left: 14px !important;
}

.cadastral-map-canvas .leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.55) !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 1.10rem !important;
  font-weight: 700 !important;
  transition: all 0.2s ease !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.cadastral-map-canvas .leaflet-control-zoom a:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #0284c7 !important;
  transform: scale(1.04);
}

/* Dark Mode Frosted Glassmorphism Controls */
body.dark-theme .cadastral-map-canvas .leaflet-control-zoom,
body.dark-mode .cadastral-map-canvas .leaflet-control-zoom,
body:not(.light-theme):not(.light-mode) .cadastral-map-canvas .leaflet-control-zoom {
  background: rgba(15, 23, 42, 0.70) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .cadastral-map-canvas .leaflet-control-zoom a,
body.dark-mode .cadastral-map-canvas .leaflet-control-zoom a,
body:not(.light-theme):not(.light-mode) .cadastral-map-canvas .leaflet-control-zoom a {
  background: rgba(15, 23, 42, 0.65) !important;
  color: #f8fafc !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
}

body.dark-theme .cadastral-map-canvas .leaflet-control-zoom a:hover,
body.dark-mode .cadastral-map-canvas .leaflet-control-zoom a:hover,
body:not(.light-theme):not(.light-mode) .cadastral-map-canvas .leaflet-control-zoom a:hover {
  background: rgba(30, 41, 59, 0.90) !important;
  color: #38bdf8 !important;
}

/* Light Mode Frosted Glassmorphism Badge */
body.light-theme .cadastral-points-counter-badge,
body.light-mode .cadastral-points-counter-badge {
  background: rgba(255, 255, 255, 0.78) !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(16, 185, 129, 0.55) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

@media (max-width: 768px) {
  .cadastral-drawer-overlay {
    padding: 10px;
    box-sizing: border-box;
  }
  .cadastral-drawer-overlay.is-fullscreen {
    padding: 0 !important;
  }
  .cadastral-drawer-card {
    width: 96vw !important;
    height: 86vh !important;
    max-width: 96vw !important;
    max-height: 86vh !important;
    border-radius: 16px !important;
    border: 1.5px solid rgba(16, 185, 129, 0.5) !important;
    margin: auto !important;
  }
  .cadastral-drawer-card.is-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
  }
  .cadastral-drawer-header {
    box-sizing: border-box !important;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
    padding-left: calc(12px + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(12px + env(safe-area-inset-right, 0px)) !important;
    gap: 8px;
    min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
  }
  .cadastral-header-badge {
    width: 34px;
    height: 34px;
  }
  .cadastral-header-title {
    font-size: 0.92rem !important;
  }
  .cadastral-header-sub {
    font-size: 0.70rem !important;
  }
  .cadastral-live-area-pill {
    padding: 4px 8px;
    font-size: 0.74rem;
    gap: 4px;
  }
  .cadastral-icon-btn {
    width: 32px;
    height: 32px;
  }
  .cadastral-icon-btn i {
    font-size: 0.80rem;
  }
  .cadastral-drawer-toolbar {
    padding: 5px 6px !important;
    gap: 4px !important;
    justify-content: flex-start !important;
  }
  .cadastral-search-wrapper {
    flex: 1 1 auto !important;
    min-width: 65px !important;
    max-width: 165px !important;
    padding: 0 2px 0 5px !important;
    gap: 2px !important;
  }
  .cadastral-search-icon {
    font-size: 0.68rem !important;
  }
  .cadastral-search-input {
    font-size: 0.68rem !important;
    padding: 0 2px !important;
  }
  .cadastral-search-btn {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.62rem !important;
  }
  .btn-cadastral-tool {
    padding: 0 5px !important;
    font-size: 0.68rem !important;
    gap: 3px !important;
  }
  .btn-cadastral-save {
    padding: 0 7px !important;
    font-size: 0.70rem !important;
    gap: 3px !important;
    margin-left: auto !important;
  }
}

/* Vertex Pin Markers on Map */
.cadastral-vertex-handle {
  background: transparent !important;
  border: none !important;
}

/* ArcGIS Style Vertex Marker Container */
.arcgis-vertex-marker {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.arcgis-vertex-marker:active {
  cursor: grabbing;
}

/* ArcGIS Style Small Floating Number Badge Above Point */
.arcgis-vertex-badge {
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 8px;
  font-weight: 800;
  line-height: 11px;
  height: 12px;
  padding: 0 3px;
  border-radius: 3.5px;
  background: rgba(15, 23, 42, 0.90);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  margin-bottom: 2px;
  white-space: nowrap;
  pointer-events: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  z-index: 2;
}

/* ArcGIS Style Small Vertex Dot (Crisp High-Precision Surveying Point) */
.arcgis-vertex-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #10b981;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  pointer-events: none;
  z-index: 1;
}

/* Line Mode Theme */
.arcgis-vertex-marker.is-line .arcgis-vertex-dot {
  border-color: #f59e0b;
}
.arcgis-vertex-marker.is-line .arcgis-vertex-badge {
  border-color: rgba(245, 158, 11, 0.5);
}

/* Interactive Hover / Active State */
.arcgis-vertex-marker:hover .arcgis-vertex-dot,
.arcgis-vertex-marker:active .arcgis-vertex-dot {
  transform: scale(1.6);
  background: #38bdf8;
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.9);
}

.arcgis-vertex-marker:hover .arcgis-vertex-badge,
.arcgis-vertex-marker:active .arcgis-vertex-badge {
  transform: scale(1.2);
  background: #0f172a;
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.4);
}

/* Toggle Points Visibility (Hides all vertex dots and markers) */
.cadastral-hide-points .cadastral-vertex-handle,
.cadastral-hide-points .arcgis-vertex-marker {
  display: none !important;
  pointer-events: none !important;
}

/* Toggle Point Numbers Visibility */
.cadastral-hide-point-numbers .arcgis-vertex-badge {
  display: none !important;
}

.cadastral-hide-point-numbers .arcgis-vertex-marker:hover .arcgis-vertex-badge {
  display: block !important;
}

/* Backwards compatibility */
.vertex-pin-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Cadastral GIS Map Typography (Luxury Geometric 'Outfit' Font & Ultra-Sharp)
   ========================================================================== */

/* Side Length Badges along parcel perimeter (Luxury, Crisp, Razor-sharp) */
.cadastral-side-length-label {
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important;
  z-index: 650 !important;
}

/* CSS Variables for Dynamic GIS Label Fonts & Sizes */
:root {
  --gis-label-font: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --gis-side-font-size: 0.66rem;
  --gis-area-font-size: 0.88rem;
  --gis-pill-padding: 1px 5px;
}

body.gis-font-kantumruy { --gis-label-font: 'Kantumruy Pro', 'Outfit', sans-serif; }
body.gis-font-battambang { --gis-label-font: 'Battambang', 'Outfit', sans-serif; }
body.gis-font-poppins { --gis-label-font: 'Poppins', 'Outfit', sans-serif; }
body.gis-font-inter { --gis-label-font: 'Inter', sans-serif; }
body.gis-font-roboto { --gis-label-font: 'Roboto', sans-serif; }
body.gis-font-outfit { --gis-label-font: 'Outfit', sans-serif; }

body.gis-size-slim {
  --gis-side-font-size: 0.62rem;
  --gis-area-font-size: 0.82rem;
  --gis-pill-padding: 1px 4px;
}
body.gis-size-medium {
  --gis-side-font-size: 0.72rem;
  --gis-area-font-size: 0.94rem;
  --gis-pill-padding: 2px 7px;
}
body.gis-size-large {
  --gis-side-font-size: 0.82rem;
  --gis-area-font-size: 1.06rem;
  --gis-pill-padding: 3px 9px;
}

/* High-Visibility Slim & Elegant Metric Pill positioned directly ON the line / edge */
.cadastral-line-metric-pill {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  border-radius: 5px !important;
  padding: var(--gis-pill-padding, 1px 5px) !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1.5px 5px rgba(0, 0, 0, 0.6) !important;
  transition: transform 0.15s ease !important;
  pointer-events: auto !important;
  cursor: default !important;
}

/* Line Mode Metric Pill (Vibrant Amber/Orange border) */
.cadastral-line-metric-pill.line-mode {
  border: 1px solid #f59e0b !important;
}

.cadastral-line-metric-pill.line-mode span {
  color: #fbbf24;
  font-family: var(--gis-label-font, 'Outfit', sans-serif) !important;
  font-size: var(--gis-side-font-size, 0.66rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  line-height: 1 !important;
  -webkit-text-stroke: 0 !important;
  filter: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
}

/* Polygon Mode Metric Pill (Jewel Emerald border) */
.cadastral-line-metric-pill.poly-mode {
  border: 1px solid #10b981 !important;
}

.cadastral-line-metric-pill.poly-mode span {
  color: #34d399;
  font-family: var(--gis-label-font, 'Outfit', sans-serif) !important;
  font-size: var(--gis-side-font-size, 0.66rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  line-height: 1 !important;
  -webkit-text-stroke: 0 !important;
  filter: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
}

.cadastral-line-metric-pill:hover {
  transform: scale(1.18) !important;
}

.cadastral-side-length-label span {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  display: inline-block !important;
  font-family: var(--gis-label-font, 'Outfit', sans-serif) !important;
  font-size: var(--gis-side-font-size, 0.66rem) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0.2px !important;
  font-feature-settings: "tnum" 1 !important;
}

/* Center Area Badge on Map (Compact, Slim & Refined) */
.cadastral-area-center-badge {
  background: transparent !important;
  border: none !important;
}

.cadastral-area-center-badge .area-pill {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  white-space: nowrap !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.cadastral-area-center-badge .area-pill span {
  font-family: var(--gis-label-font, 'Outfit', sans-serif) !important;
  font-size: var(--gis-area-font-size, 0.88rem) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: 0.3px !important;
  font-feature-settings: "tnum" 1 !important;
  paint-order: stroke fill !important;
  -webkit-text-stroke: 2.5px #ffffff !important;
  filter: drop-shadow(0 1.5px 3px rgba(0, 0, 0, 0.5)) !important;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.cadastral-area-center-badge .area-pill:hover span {
  transform: scale(1.15) !important;
}

/* Toggle Visibility for Side Lengths and Area Labels */
body.hide-gis-side-lengths .cadastral-side-length-label,
.hide-gis-side-lengths .cadastral-side-length-label,
.hide-gis-side-lengths-auto .cadastral-side-length-label,
#cadastralDrawerOverlay.hide-gis-side-lengths .cadastral-side-length-label,
#cadastralDrawerMapContainer.hide-gis-side-lengths .cadastral-side-length-label,
body.hide-gis-side-lengths #cadastralDrawerMapContainer .cadastral-side-length-label {
  display: none !important;
}

/* Ensure Side Length Badges in Drawer Map are ALWAYS displayed unless hidden by toggle */
#cadastralDrawerMapContainer .cadastral-side-length-label {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.hide-gis-area-labels .cadastral-area-center-badge,
.hide-gis-area-labels .cadastral-area-center-badge,
#cadastralDrawerOverlay.hide-gis-area-labels .cadastral-area-center-badge,
#cadastralDrawerMapContainer.hide-gis-area-labels .cadastral-area-center-badge,
body.hide-gis-area-labels #cadastralDrawerMapContainer .cadastral-area-center-badge,
body.hide-gis-area-labels .cadastral-existing-parcel-badge,
#cadastralDrawerMapContainer.hide-gis-area-labels .cadastral-existing-parcel-badge {
  display: none !important;
}

/* Existing Saved Parcels in Drawer */
.cadastral-existing-parcel-badge {
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 650 !important;
}

.existing-parcel-pill {
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1.5px dashed rgba(255, 255, 255, 0.45) !important;
  border-radius: 99px !important;
  padding: 2px 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(4px) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.existing-parcel-pill span {
  font-family: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  line-height: 1 !important;
}

.cadastral-bar-btn.btn-toggle-existing-cadastral.active i {
  color: #38bdf8 !important;
}

.cadastral-bar-btn.btn-toggle-existing-cadastral:not(.active) i {
  color: #64748b !important;
  opacity: 0.5 !important;
}

/* Inactive styling for GIS toggle buttons */
.btn-tile-switch.btn-toggle-gis-sides:not(.active),
.btn-tile-switch.btn-toggle-gis-area:not(.active) {
  opacity: 0.55 !important;
  background: rgba(30, 41, 59, 0.75) !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  text-decoration: line-through !important;
}

.cadastral-bar-btn.btn-toggle-gis-sides:not(.active) i,
.cadastral-bar-btn.btn-toggle-gis-area:not(.active) i {
  color: #64748b !important;
  opacity: 0.5 !important;
}

/* Location Search Box in Drawer (Maintained via .cadastral-search-wrapper above) */

/* Locate Me Button */
.btn-locate-me {
  background: rgba(2, 132, 199, 0.25) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
}

.btn-locate-me:hover {
  background: rgba(2, 132, 199, 0.5) !important;
}

/* User GPS Pulse */
.cadastral-user-pos-icon {
  background: transparent;
  border: none;
}

.user-gps-pulse-ring {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gpsPulse 2s infinite ease-out;
}

.user-gps-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0284c7;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px #0284c7;
}

@keyframes gpsPulse {
  0% { transform: scale(0.7); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Parcel Overlay Hover Glow */
.leaflet-interactive.cadastral-active-parcel {
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
  transition: all 0.3s ease;
}

.leaflet-interactive.cadastral-active-parcel:hover {
  stroke-width: 4.5px !important;
  fill-opacity: 0.45 !important;
}

/* Reference Point Markers */
.cadastral-ref-point-marker {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cadastral-ref-point-marker:hover {
  transform: scale(1.25);
  z-index: 1000 !important;
}

/* Modal animation */
.cadastral-modal-overlay {
  z-index: 2000005 !important;
  animation: cadastralFadeIn 0.2s ease;
}

@keyframes cadastralFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Cadastral Unified Control Bar (Mini Compact Vertical Column on Bottom-Right)
   ========================================================================== */
.cadastral-floating-unified-bar {
  position: absolute;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.cadastral-bar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: #0f172a !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  opacity: 1 !important;
}

.cadastral-bar-btn:hover {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
}

.cadastral-bar-btn#btnCadastralTileStreet i,
.cadastral-bar-btn#btnCadastralTileSat i,
.cadastral-bar-btn#btnToggleCadastralTile i {
  color: #38bdf8;
}

.cadastral-bar-btn.active#btnCadastralTileStreet,
.cadastral-bar-btn.active#btnCadastralTileSat,
.cadastral-bar-btn#btnToggleCadastralTile.is-sat,
.cadastral-bar-btn#btnToggleCadastralTile:not(.is-street) {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.85) !important;
}

.cadastral-bar-btn#btnToggleCadastralTile.is-street {
  background: linear-gradient(135deg, #059669, #047857) !important;
  border: 2px solid #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.85) !important;
}

.cadastral-bar-btn.active#btnCadastralTileStreet i,
.cadastral-bar-btn.active#btnCadastralTileSat i,
.cadastral-bar-btn#btnToggleCadastralTile i {
  color: #ffffff !important;
}

/* Unified Geometry Drawing Mode Selector (Combined Tool) */
.cadastral-mode-selector-wrapper {
  position: relative;
}

.cadastral-bar-btn.btn-cadastral-mode-toggle {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: 2px solid #34d399 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.85) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cadastral-bar-btn.btn-cadastral-mode-toggle:hover,
.cadastral-bar-btn.btn-cadastral-mode-toggle.flyout-active {
  transform: scale(1.15);
  filter: brightness(1.15);
}

.cadastral-bar-btn.btn-cadastral-mode-toggle i {
  color: #ffffff !important;
  font-size: 0.95rem;
}

/* Flyout Submenu to the Left */
.cadastral-mode-flyout {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  display: none;
  flex-direction: column;
  gap: 5px;
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
  z-index: 1010;
  min-width: 155px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cadastral-mode-flyout.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.cadastral-flyout-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.cadastral-flyout-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(-2px);
}

.cadastral-flyout-item.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.6);
  color: #34d399;
}

.cadastral-flyout-item[data-flyout-mode="point"].active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
}

.cadastral-flyout-item[data-flyout-mode="line"].active {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
}

/* Light Mode for Mode Flyout */
body.light-theme .cadastral-mode-flyout,
body.light-mode .cadastral-mode-flyout {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18) !important;
}

body.light-theme .cadastral-flyout-item,
body.light-mode .cadastral-flyout-item {
  color: #1e293b !important;
}

body.light-theme .cadastral-flyout-item:hover,
body.light-mode .cadastral-flyout-item:hover {
  background: #f1f5f9 !important;
}

/* Legacy support for individual mode buttons */
.cadastral-bar-btn[data-mode="polygon"] {
  border-color: rgba(16, 185, 129, 0.6);
}

.cadastral-bar-btn[data-mode="polygon"] i {
  color: #10b981;
}

.cadastral-bar-btn.active[data-mode="polygon"] {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.9) !important;
  transform: scale(1.12);
}

.cadastral-bar-btn.active[data-mode="polygon"] i {
  color: #ffffff !important;
}

.cadastral-bar-btn[data-mode="point"] {
  border-color: rgba(56, 189, 248, 0.6);
}

.cadastral-bar-btn[data-mode="point"] i {
  color: #38bdf8;
}

.cadastral-bar-btn.active[data-mode="point"] {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9) !important;
  transform: scale(1.12);
}

.cadastral-bar-btn.active[data-mode="point"] i {
  color: #ffffff !important;
}

.cadastral-bar-btn[data-mode="line"] {
  border-color: rgba(245, 158, 11, 0.6);
}

.cadastral-bar-btn[data-mode="line"] i {
  color: #fbbf24;
}

.cadastral-bar-btn.active[data-mode="line"] {
  background: #d97706 !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.9) !important;
  transform: scale(1.12);
}

.cadastral-bar-btn.active[data-mode="line"] i {
  color: #ffffff !important;
}

/* Side Lengths Toggle (📏 ជើងម៉ែត្រ) inside Drawer - ULTRA-CLEAR HIGH CONTRAST */
.cadastral-bar-btn.btn-toggle-gis-sides {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  opacity: 1 !important;
}

.cadastral-bar-btn.btn-toggle-gis-sides i {
  color: #94a3b8 !important;
  font-size: 0.92rem;
}

.cadastral-bar-btn.btn-toggle-gis-sides.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9) !important;
  transform: scale(1.1);
}

.cadastral-bar-btn.btn-toggle-gis-sides.active i {
  color: #ffffff !important;
  font-size: 1rem;
}

/* Area Toggle (📐 ទំហំដី m²) inside Drawer - ULTRA-CLEAR HIGH CONTRAST */
.cadastral-bar-btn.btn-toggle-gis-area {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  opacity: 1 !important;
}

.cadastral-bar-btn.btn-toggle-gis-area i {
  color: #94a3b8 !important;
  font-size: 0.92rem;
}

.cadastral-bar-btn.btn-toggle-gis-area.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: 2px solid #34d399 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.9) !important;
  transform: scale(1.1);
}

.cadastral-bar-btn.btn-toggle-gis-area.active i {
  color: #ffffff !important;
  font-size: 1rem;
}

/* Saved Cadastral Toggle (👁️ បង្ហាញប្លង់ចាស់) */
.cadastral-bar-btn.btn-toggle-existing-cadastral {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  opacity: 1 !important;
}

.cadastral-bar-btn.btn-toggle-existing-cadastral i {
  color: #94a3b8 !important;
}

.cadastral-bar-btn.btn-toggle-existing-cadastral.active {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  border: 2px solid #a78bfa !important;
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.9) !important;
  transform: scale(1.1);
}

.cadastral-bar-btn.btn-toggle-existing-cadastral.active i {
  color: #ffffff !important;
}

/* ==========================================================================
   Cadastral Floating History Bar (Undo / Redo directly under Leaflet + - Zoom buttons)
   ========================================================================== */
.cadastral-floating-history-bar {
  position: absolute;
  top: 86px;
  left: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  pointer-events: auto;
}

/* Floating Undo & Redo Buttons */
.cadastral-bar-btn.btn-cadastral-undo,
.cadastral-bar-btn.btn-cadastral-redo {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  opacity: 1;
  transition: all 0.2s ease;
}

.cadastral-bar-btn.btn-cadastral-undo:hover {
  background: rgba(251, 191, 36, 0.22) !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.7) !important;
  transform: scale(1.1);
}

.cadastral-bar-btn.btn-cadastral-redo:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7) !important;
  transform: scale(1.1);
}

.cadastral-bar-btn.btn-cadastral-locate {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  opacity: 1;
  transition: all 0.2s ease;
}

.cadastral-bar-btn.btn-cadastral-locate i {
  color: #38bdf8 !important;
}

.cadastral-bar-btn.btn-cadastral-locate:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.75) !important;
  transform: scale(1.1);
}

body.light-theme .cadastral-bar-btn.btn-cadastral-locate,
body.light-mode .cadastral-bar-btn.btn-cadastral-locate {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
}

/* Display Options Trigger Button */
.cadastral-bar-btn.btn-cadastral-display-menu {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  opacity: 1 !important;
}

.cadastral-bar-btn.btn-cadastral-display-menu i {
  color: #38bdf8 !important;
  font-size: 0.95rem;
}

.cadastral-bar-btn.btn-cadastral-display-menu.active,
.cadastral-bar-btn.btn-cadastral-display-menu:hover {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9) !important;
  transform: scale(1.1);
}

.cadastral-bar-btn.btn-cadastral-display-menu.active i,
.cadastral-bar-btn.btn-cadastral-display-menu:hover i {
  color: #ffffff !important;
}

/* Additional Floating Action Buttons: XY, Layers, Clear */
.cadastral-bar-btn.btn-cadastral-coords {
  background: #1e293b !important;
  border: 1.5px solid #64748b !important;
  opacity: 1;
  transition: all 0.2s ease;
}

.cadastral-bar-btn.btn-cadastral-coords i,
.cadastral-bar-btn.btn-cadastral-coords .cadastral-xy-icon {
  color: #c084fc !important;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
  transition: all 0.2s ease;
}

.cadastral-bar-btn.btn-cadastral-coords:hover {
  background: rgba(192, 132, 252, 0.22) !important;
  border-color: #c084fc !important;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.75) !important;
  transform: scale(1.12);
}

.cadastral-bar-btn.btn-cadastral-coords:hover i,
.cadastral-bar-btn.btn-cadastral-coords:hover .cadastral-xy-icon {
  color: #ffffff !important;
}

.cadastral-bar-btn.btn-cadastral-layers-toggle {
  background: #1e293b !important;
  border: 1.5px solid #38bdf8 !important;
  opacity: 1;
  transition: all 0.2s ease;
}

.cadastral-bar-btn.btn-cadastral-layers-toggle i {
  color: #38bdf8 !important;
  font-size: 0.95rem;
}

.cadastral-bar-btn.btn-cadastral-layers-toggle:hover,
.cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active,
.cadastral-bar-btn.btn-cadastral-layers-toggle.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.85) !important;
  transform: scale(1.12);
}

.cadastral-bar-btn.btn-cadastral-layers-toggle:hover i,
.cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active i,
.cadastral-bar-btn.btn-cadastral-layers-toggle.active i {
  color: #ffffff !important;
}

.cadastral-bar-btn.btn-cadastral-clear {
  background: #1e293b !important;
  border: 1.5px solid #f87171 !important;
  opacity: 1;
  transition: all 0.2s ease;
}

.cadastral-bar-btn.btn-cadastral-clear i {
  color: #f87171 !important;
  font-size: 0.95rem;
}

.cadastral-bar-btn.btn-cadastral-clear:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.85) !important;
  transform: scale(1.12);
}

.cadastral-bar-btn.btn-cadastral-clear:hover i {
  color: #ffffff !important;
}

/* Light mode for floating cadastral buttons */
body.light-theme .cadastral-bar-btn.btn-cadastral-coords,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords {
  background: #faf5ff !important;
  border: 1.5px solid #c084fc !important;
  box-shadow: 0 2px 8px rgba(192, 132, 252, 0.2) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-coords i,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords i,
body.light-theme .cadastral-bar-btn.btn-cadastral-coords .cadastral-xy-icon,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords .cadastral-xy-icon {
  color: #9333ea !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-coords:hover,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords:hover {
  background: #9333ea !important;
  border-color: #9333ea !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-coords:hover i,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords:hover i,
body.light-theme .cadastral-bar-btn.btn-cadastral-coords:hover .cadastral-xy-icon,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords:hover .cadastral-xy-icon {
  color: #ffffff !important;
}

/* Light mode for Layers (ស្រទាប់) Button - High Contrast & Clearly Visible */
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle {
  background: #f0f9ff !important;
  border: 2px solid #0284c7 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle i {
  color: #0284c7 !important;
  font-size: 0.95rem !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle:hover,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.active,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle:hover,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45) !important;
  transform: scale(1.12);
}

body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle:hover i,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active i,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.active i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle:hover i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.active i {
  color: #ffffff !important;
}

/* Light mode for Clear (លុបចេញ) Button */
body.light-theme .cadastral-bar-btn.btn-cadastral-clear,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear {
  background: #fef2f2 !important;
  border: 1.5px solid #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-clear i,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear i {
  color: #dc2626 !important;
  font-size: 0.95rem !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-clear:hover,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4) !important;
  transform: scale(1.12);
}

body.light-theme .cadastral-bar-btn.btn-cadastral-clear:hover i,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear:hover i {
  color: #ffffff !important;
}

/* ==========================================================================
   Cadastral Unified Display Options Popup (Flyout Card)
   ========================================================================== */
.cadastral-display-popup {
  position: absolute;
  top: 90px;
  right: 56px;
  z-index: 1050;
  width: 295px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 20px rgba(56, 189, 248, 0.15);
  padding: 12px;
  color: #ffffff;
  display: none;
  animation: cadastralPopupSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  user-select: none;
}

.cadastral-display-popup.open {
  display: block;
}

@keyframes cadastralPopupSlideIn {
  from {
    opacity: 0;
    transform: translateX(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.cadastral-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cadastral-popup-header-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.2px;
}

.cadastral-popup-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.cadastral-popup-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

.cadastral-popup-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cadastral-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cadastral-popup-row:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateX(-2px);
}

.cadastral-popup-row-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cadastral-popup-icon-box {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.cadastral-popup-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cadastral-popup-row-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.2;
}

.cadastral-popup-row-desc {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.2;
  margin-top: 2px;
}

/* Modern iOS-Style Toggle Switch */
.cadastral-popup-switch {
  width: 38px;
  height: 20px;
  background: #334155;
  border-radius: 20px;
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.cadastral-popup-switch-thumb {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cadastral-popup-switch.active {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

.cadastral-popup-switch.active .cadastral-popup-switch-thumb {
  transform: translateX(18px);
}

@media (max-width: 640px) {
  .cadastral-display-popup {
    right: 48px;
    width: 260px;
    top: 60px;
    padding: 10px;
  }
}

/* ==========================================================================
   Cadastral Interactive Layer Manager Panel (Drawer Map Overlays List)
   ========================================================================== */
.btn-cadastral-layers-active {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

.cadastral-layers-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 290px;
  max-width: calc(100vw - 40px);
  max-height: calc(100% - 30px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cadastralFadeIn 0.2s ease;
}

.cadastral-layers-header {
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cadastral-layers-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cadastral-layers-body {
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
}

.cadastral-layer-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
}

.cadastral-layer-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cadastral-layer-item.active {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.08);
}

.cadastral-layer-info {
  min-width: 0;
  flex: 1;
}

.cadastral-layer-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cadastral-layer-meta {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 2px;
}

.cadastral-layer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cadastral-layer-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.cadastral-layer-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.cadastral-layer-btn.is-hidden {
  color: #64748b;
  opacity: 0.6;
}

/* ==========================================================================
   Cadastral Feature Leaflet Popup (Adaptive Dark & Light Theme System)
   ========================================================================== */

/* Light Theme Popup (Default when body is light theme or popup has light class) */
body.light-theme #cadastralDrawerModal .leaflet-popup-content-wrapper,
body.light-mode #cadastralDrawerModal .leaflet-popup-content-wrapper,
body.light-theme .leaflet-popup-content-wrapper,
body.light-mode .leaflet-popup-content-wrapper,
.cadastral-leaflet-popup-light .leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

body.light-theme #cadastralDrawerModal .leaflet-popup-tip,
body.light-mode #cadastralDrawerModal .leaflet-popup-tip,
body.light-theme .leaflet-popup-tip,
body.light-mode .leaflet-popup-tip,
.cadastral-leaflet-popup-light .leaflet-popup-tip {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
}

body.light-theme #cadastralDrawerModal .leaflet-popup-close-button,
body.light-mode #cadastralDrawerModal .leaflet-popup-close-button,
body.light-theme .leaflet-popup-close-button,
body.light-mode .leaflet-popup-close-button,
.cadastral-leaflet-popup-light .leaflet-popup-close-button {
  color: #64748b !important;
  top: 10px !important;
  right: 10px !important;
}

body.light-theme .leaflet-popup-close-button:hover,
body.light-mode .leaflet-popup-close-button:hover {
  color: #dc2626 !important;
}

/* Dark Theme Popup (When body is NOT light theme, or popup has dark class) */
body:not(.light-theme):not(.light-mode) #cadastralDrawerModal .leaflet-popup-content-wrapper,
body.dark-theme #cadastralDrawerModal .leaflet-popup-content-wrapper,
body.dark-mode #cadastralDrawerModal .leaflet-popup-content-wrapper,
body:not(.light-theme):not(.light-mode) .cadastral-leaflet-popup .leaflet-popup-content-wrapper,
body.dark-theme .cadastral-leaflet-popup .leaflet-popup-content-wrapper,
body.dark-mode .cadastral-leaflet-popup .leaflet-popup-content-wrapper,
.cadastral-leaflet-popup-dark .leaflet-popup-content-wrapper {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(16, 185, 129, 0.2) !important;
}

body:not(.light-theme):not(.light-mode) #cadastralDrawerModal .leaflet-popup-tip,
body.dark-theme #cadastralDrawerModal .leaflet-popup-tip,
body.dark-mode #cadastralDrawerModal .leaflet-popup-tip,
body:not(.light-theme):not(.light-mode) .cadastral-leaflet-popup .leaflet-popup-tip,
body.dark-theme .cadastral-leaflet-popup .leaflet-popup-tip,
body.dark-mode .cadastral-leaflet-popup .leaflet-popup-tip,
.cadastral-leaflet-popup-dark .leaflet-popup-tip {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

body:not(.light-theme):not(.light-mode) #cadastralDrawerModal .leaflet-popup-close-button,
body.dark-theme #cadastralDrawerModal .leaflet-popup-close-button,
body.dark-mode #cadastralDrawerModal .leaflet-popup-close-button,
body:not(.light-theme):not(.light-mode) .cadastral-leaflet-popup .leaflet-popup-close-button,
body.dark-theme .cadastral-leaflet-popup .leaflet-popup-close-button,
body.dark-mode .cadastral-leaflet-popup .leaflet-popup-close-button,
.cadastral-leaflet-popup-dark .leaflet-popup-close-button {
  color: #94a3b8 !important;
  top: 10px !important;
  right: 10px !important;
}

body:not(.light-theme):not(.light-mode) .leaflet-popup-close-button:hover,
body.dark-theme .leaflet-popup-close-button:hover {
  color: #f87171 !important;
}

/* ==========================================================================
   Cadastral Drawer Light Theme Adaptation (High-Contrast, Crisp & Readable)
   ========================================================================== */
body.light-theme .cadastral-drawer-card,
body.light-mode .cadastral-drawer-card {
  background: #ffffff !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25) !important;
}

body.light-theme .cadastral-drawer-header,
body.light-mode .cadastral-drawer-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

body.light-theme .cadastral-header-title,
body.light-mode .cadastral-header-title {
  color: #0f172a !important;
  text-shadow: none !important;
}

body.light-theme .cadastral-header-sub,
body.light-mode .cadastral-header-sub {
  color: #475569 !important;
}

/* Controls: Fullscreen & Close (X) Buttons */
body.light-theme .cadastral-icon-btn,
body.light-mode .cadastral-icon-btn {
  background: #f1f5f9 !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .cadastral-icon-btn i,
body.light-mode .cadastral-icon-btn i {
  color: #334155 !important;
}

body.light-theme .cadastral-icon-btn.cadastral-btn-close,
body.light-mode .cadastral-icon-btn.cadastral-btn-close {
  background: #fee2e2 !important;
  border: 1.5px solid #fca5a5 !important;
  color: #dc2626 !important;
}

body.light-theme .cadastral-icon-btn.cadastral-btn-close i,
body.light-mode .cadastral-icon-btn.cadastral-btn-close i {
  color: #dc2626 !important;
}

body.light-theme .cadastral-icon-btn:hover,
body.light-mode .cadastral-icon-btn:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
}

body.light-theme .cadastral-icon-btn.cadastral-btn-close:hover,
body.light-mode .cadastral-icon-btn.cadastral-btn-close:hover {
  background: #ef4444 !important;
  border-color: #dc2626 !important;
}

body.light-theme .cadastral-icon-btn.cadastral-btn-close:hover i,
body.light-mode .cadastral-icon-btn.cadastral-btn-close:hover i {
  color: #ffffff !important;
}

/* Light Mode Live Area Pill */
body.light-theme .cadastral-live-area-pill,
body.light-mode .cadastral-live-area-pill {
  background: #ffffff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .cadastral-live-area-pill span,
body.light-mode .cadastral-live-area-pill span {
  color: #0f172a !important;
}

body.light-theme .cadastral-drawer-toolbar,
body.light-mode .cadastral-drawer-toolbar {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

body.light-theme .cadastral-search-wrapper,
body.light-mode .cadastral-search-wrapper {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
}

body.light-theme .cadastral-search-input,
body.light-mode .cadastral-search-input {
  background: transparent !important;
  color: #0f172a !important;
  border: none !important;
}

body.light-theme .cadastral-search-icon,
body.light-mode .cadastral-search-icon {
  color: #64748b !important;
}

/* Light Mode Toolbar Action Buttons */
body.light-theme .btn-cadastral-tool,
body.light-mode .btn-cadastral-tool {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #1e293b !important;
  box-shadow: 0 1.5px 4px rgba(0,0,0,0.06) !important;
}

body.light-theme .btn-cadastral-tool:hover,
body.light-mode .btn-cadastral-tool:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-undo span,
body.light-mode .btn-cadastral-tool.btn-tool-undo span {
  color: #854d0e !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-undo,
body.light-mode .btn-cadastral-tool.btn-tool-undo {
  background: #fefce8 !important;
  border-color: #fde047 !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-redo span,
body.light-mode .btn-cadastral-tool.btn-tool-redo span {
  color: #0369a1 !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-redo,
body.light-mode .btn-cadastral-tool.btn-tool-redo {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-coords,
body.light-mode .btn-cadastral-tool.btn-tool-coords {
  background: #faf5ff !important;
  border: 1.5px solid #d8b4fe !important;
  color: #6b21a8 !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-coords span,
body.light-mode .btn-cadastral-tool.btn-tool-coords span {
  color: #6b21a8 !important;
  font-weight: 800 !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-coords i,
body.light-mode .btn-cadastral-tool.btn-tool-coords i {
  color: #9333ea !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-coords:hover,
body.light-mode .btn-cadastral-tool.btn-tool-coords:hover {
  background: #f3e8ff !important;
  border-color: #c084fc !important;
  color: #581c87 !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-clear span,
body.light-mode .btn-cadastral-tool.btn-tool-clear span {
  color: #b91c1c !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-clear,
body.light-mode .btn-cadastral-tool.btn-tool-clear {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}

body.light-theme .btn-cadastral-tool.btn-locate-me,
body.light-mode .btn-cadastral-tool.btn-locate-me {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
  color: #0369a1 !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-import,
body.light-mode .btn-cadastral-tool.btn-tool-import {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
  color: #166534 !important;
}

body.light-theme .btn-cadastral-tool.btn-tool-export,
body.light-mode .btn-cadastral-tool.btn-tool-export {
  background: #fef3c7 !important;
  border-color: #fcd34d !important;
  color: #b45309 !important;
}

body.light-theme .btn-cadastral-tool.btn-cadastral-layers-toggle,
body.light-mode .btn-cadastral-tool.btn-cadastral-layers-toggle {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
  color: #0369a1 !important;
}

body.light-theme .cadastral-stats-pill-strip,
body.light-mode .cadastral-stats-pill-strip {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .cadastral-instruction-badge,
body.light-mode .cadastral-instruction-badge {
  color: #334155 !important;
}

/* Light Mode Right-hand floating map bar */
body.light-theme .cadastral-bar-btn,
body.light-mode .cadastral-bar-btn {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #334155 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

body.light-theme .cadastral-bar-btn i,
body.light-mode .cadastral-bar-btn i {
  color: #334155 !important;
}

body.light-theme .cadastral-bar-btn.active,
body.light-mode .cadastral-bar-btn.active {
  background: #0f172a !important;
  border-color: #0f172a !important;
}

body.light-theme .cadastral-bar-btn.active i,
body.light-mode .cadastral-bar-btn.active i {
  color: #ffffff !important;
}

/* Light mode for Layers (ស្រទាប់) Button - High Contrast & Clearly Visible */
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle {
  background: #f0f9ff !important;
  border: 2px solid #0284c7 !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle i {
  color: #0284c7 !important;
  font-size: 0.95rem !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle:hover,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.active,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle:hover,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border: 2px solid #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45) !important;
  transform: scale(1.12);
}

body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle:hover i,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active i,
body.light-theme .cadastral-bar-btn.btn-cadastral-layers-toggle.active i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle:hover i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.btn-cadastral-layers-active i,
body.light-mode .cadastral-bar-btn.btn-cadastral-layers-toggle.active i {
  color: #ffffff !important;
}

/* Light mode for Clear (លុបចេញ) Button */
body.light-theme .cadastral-bar-btn.btn-cadastral-clear,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear {
  background: #fef2f2 !important;
  border: 1.5px solid #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-clear i,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear i {
  color: #dc2626 !important;
  font-size: 0.95rem !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-clear:hover,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4) !important;
  transform: scale(1.12);
}

body.light-theme .cadastral-bar-btn.btn-cadastral-clear:hover i,
body.light-mode .cadastral-bar-btn.btn-cadastral-clear:hover i {
  color: #ffffff !important;
}

/* Light mode for Coords (XY) Button */
body.light-theme .cadastral-bar-btn.btn-cadastral-coords,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords {
  background: #faf5ff !important;
  border: 1.5px solid #c084fc !important;
  box-shadow: 0 2px 8px rgba(192, 132, 252, 0.2) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-coords i,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords i,
body.light-theme .cadastral-bar-btn.btn-cadastral-coords .cadastral-xy-icon,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords .cadastral-xy-icon {
  color: #9333ea !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-coords:hover,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords:hover {
  background: #9333ea !important;
  border-color: #9333ea !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-coords:hover i,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords:hover i,
body.light-theme .cadastral-bar-btn.btn-cadastral-coords:hover .cadastral-xy-icon,
body.light-mode .cadastral-bar-btn.btn-cadastral-coords:hover .cadastral-xy-icon {
  color: #ffffff !important;
}

/* ==========================================================================
   Leaflet Popup Screen Overflow Protection (For Large Cadastral Parcels)
   ========================================================================== */
.leaflet-popup-content-wrapper {
  max-height: 75vh !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  border-radius: 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-content {
  margin: 10px 12px !important;
  line-height: 1.4 !important;
  max-height: calc(75vh - 20px) !important;
  overflow-y: auto !important;
}

.cadastral-popup-inner {
  max-height: 65vh !important;
  overflow-y: auto !important;
}

/* ==========================================================================
   CADASTRAL GIS LIGHT THEME ENGINE (Popups, Panels & Floating Toolbars)
   ========================================================================== */

/* 1. Display Options Popup (ជម្រើសបង្ហាញលើផែនទី) Light Mode */
body.light-theme .cadastral-display-popup,
body.light-mode .cadastral-display-popup {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.06) !important;
  color: #0f172a !important;
}

body.light-theme .cadastral-popup-header,
body.light-mode .cadastral-popup-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .cadastral-popup-header-title,
body.light-mode .cadastral-popup-header-title {
  color: #0284c7 !important;
}

body.light-theme .cadastral-popup-close-btn,
body.light-mode .cadastral-popup-close-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}

body.light-theme .cadastral-popup-close-btn:hover,
body.light-mode .cadastral-popup-close-btn:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

body.light-theme .cadastral-popup-row,
body.light-mode .cadastral-popup-row {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .cadastral-popup-row:hover,
body.light-mode .cadastral-popup-row:hover {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
  transform: translateX(-2px);
}

body.light-theme .cadastral-popup-row-title,
body.light-mode .cadastral-popup-row-title {
  color: #0f172a !important;
}

body.light-theme .cadastral-popup-row-desc,
body.light-mode .cadastral-popup-row-desc {
  color: #64748b !important;
}

body.light-theme .cadastral-popup-switch,
body.light-mode .cadastral-popup-switch {
  background: #cbd5e1 !important;
}

body.light-theme .cadastral-popup-switch.active,
body.light-mode .cadastral-popup-switch.active {
  background: #10b981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45) !important;
}

body.light-theme .cadastral-popup-switch-thumb,
body.light-mode .cadastral-popup-switch-thumb {
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
}

/* 2. Interactive Layers Panel (ស្រទាប់ទិន្នន័យ Layers & Points) Light Mode */
body.light-theme .cadastral-layers-panel,
body.light-mode .cadastral-layers-panel {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16) !important;
}

body.light-theme .cadastral-layers-header,
body.light-mode .cadastral-layers-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .cadastral-layers-title,
body.light-mode .cadastral-layers-title {
  color: #0f172a !important;
}

body.light-theme .cadastral-layers-title i,
body.light-mode .cadastral-layers-title i {
  color: #0284c7 !important;
}

body.light-theme .cadastral-layer-btn,
body.light-mode .cadastral-layer-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}

body.light-theme .cadastral-layer-btn:hover,
body.light-mode .cadastral-layer-btn:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

body.light-theme .cadastral-layer-item,
body.light-mode .cadastral-layer-item {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .cadastral-layer-item:hover,
body.light-mode .cadastral-layer-item:hover {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
}

body.light-theme .cadastral-layer-item.active,
body.light-mode .cadastral-layer-item.active {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
}

body.light-theme .cadastral-layer-name,
body.light-mode .cadastral-layer-name {
  color: #0f172a !important;
}

body.light-theme .cadastral-layer-meta,
body.light-mode .cadastral-layer-meta {
  color: #64748b !important;
}

body.light-theme .cadastral-layers-body,
body.light-mode .cadastral-layers-body {
  color: #475569 !important;
}

/* 3. Floating Toolbar Buttons in Light Mode */
body.light-theme .cadastral-bar-btn.btn-cadastral-mode-toggle,
body.light-mode .cadastral-bar-btn.btn-cadastral-mode-toggle,
body.light-theme .cadastral-bar-btn.btn-cadastral-mode-toggle.active,
body.light-mode .cadastral-bar-btn.btn-cadastral-mode-toggle.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: 2px solid #34d399 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-mode-toggle i,
body.light-mode .cadastral-bar-btn.btn-cadastral-mode-toggle i {
  color: #ffffff !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-display-menu,
body.light-mode .cadastral-bar-btn.btn-cadastral-display-menu {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-display-menu i,
body.light-mode .cadastral-bar-btn.btn-cadastral-display-menu i {
  color: #0284c7 !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-display-menu:hover,
body.light-theme .cadastral-bar-btn.btn-cadastral-display-menu.active,
body.light-mode .cadastral-bar-btn.btn-cadastral-display-menu:hover,
body.light-mode .cadastral-bar-btn.btn-cadastral-display-menu.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-display-menu:hover i,
body.light-theme .cadastral-bar-btn.btn-cadastral-display-menu.active i,
body.light-mode .cadastral-bar-btn.btn-cadastral-display-menu:hover i,
body.light-mode .cadastral-bar-btn.btn-cadastral-display-menu.active i {
  color: #ffffff !important;
}

/* History Bar (Undo, Redo, Locate) */
body.light-theme .cadastral-bar-btn.btn-cadastral-undo,
body.light-mode .cadastral-bar-btn.btn-cadastral-undo {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
body.light-theme .cadastral-bar-btn.btn-cadastral-undo i,
body.light-mode .cadastral-bar-btn.btn-cadastral-undo i {
  color: #d97706 !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-redo,
body.light-mode .cadastral-bar-btn.btn-cadastral-redo {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
body.light-theme .cadastral-bar-btn.btn-cadastral-redo i,
body.light-mode .cadastral-bar-btn.btn-cadastral-redo i {
  color: #0284c7 !important;
}

body.light-theme .cadastral-bar-btn.btn-cadastral-locate,
body.light-mode .cadastral-bar-btn.btn-cadastral-locate {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
body.light-theme .cadastral-bar-btn.btn-cadastral-locate i,
body.light-mode .cadastral-bar-btn.btn-cadastral-locate i {
  color: #0284c7 !important;
}

/* ==============================================================================
   UNIVERSAL IOS NOTCH & STATUS BAR SAFE AREA ENGINE (PWA & SAFARI)
   ============================================================================== */
:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

header.navbar,
.navbar {
  box-sizing: border-box !important;
  padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
  min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
  height: auto !important;
}

/* Standalone Mode / Installed to Home Screen */
@media all and (display-mode: standalone) {
  header.navbar,
  .navbar {
    padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
    min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
    height: auto !important;
  }

  .left-sidebar-drawer .sidebar-drawer-header {
    padding-top: max(8px, env(safe-area-inset-top, 0px)) !important;
  }
}

/* Class-based iOS hooks for notch avoidance */
html.ios-device header.navbar,
html.ios-device .navbar {
  padding-top: max(10px, env(safe-area-inset-top, 0px)) !important;
  min-height: calc(50px + env(safe-area-inset-top, 0px)) !important;
  height: auto !important;
}

html.ios-standalone header.navbar,
html.ios-standalone .navbar {
  padding-top: max(10px, env(safe-area-inset-top, 0px)) !important;
  min-height: calc(50px + env(safe-area-inset-top, 0px)) !important;
  height: auto !important;
}

html.ios-standalone .left-sidebar-drawer .sidebar-drawer-header {
  padding-top: max(10px, env(safe-area-inset-top, 0px)) !important;
}

/* ==============================================================================
   REAL ESTATE PROPERTY MAP & CADASTRAL PARCEL TOOL SAFE AREA ENGINE
   ============================================================================== */
.admin-map-header-bar {
  padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
}

.cadastral-drawer-header {
  padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
  min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
}

/* On iOS Devices in Browser Mode: comfortable spacing for status bar / notch */
html.ios-device .admin-map-header-bar,
html.ios-device .cadastral-drawer-header {
  padding-top: max(12px, calc(8px + env(safe-area-inset-top, 0px))) !important;
  min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
}

/* On iOS Devices in Standalone PWA Mode: automatic safe drop below Notch & Dynamic Island */
html.ios-standalone .admin-map-header-bar,
html.ios-standalone .cadastral-drawer-header {
  padding-top: max(44px, calc(8px + env(safe-area-inset-top, 44px))) !important;
  min-height: calc(48px + max(44px, env(safe-area-inset-top, 44px))) !important;
}

/* Bottom Safe Areas for iOS Home Indicator */
html.ios-device .admin-map-legend-bar,
html.ios-standalone .admin-map-legend-bar {
  bottom: max(20px, calc(12px + env(safe-area-inset-bottom, 20px))) !important;
}

html.ios-device .admin-map-floating-layer,
html.ios-standalone .admin-map-floating-layer {
  bottom: max(24px, calc(12px + env(safe-area-inset-bottom, 20px))) !important;
}

html.ios-device .cadastral-floating-unified-bar,
html.ios-standalone .cadastral-floating-unified-bar {
  bottom: max(22px, calc(12px + env(safe-area-inset-bottom, 20px))) !important;
}

html.ios-device .cadastral-points-counter-badge,
html.ios-standalone .cadastral-points-counter-badge {
  bottom: max(16px, calc(10px + env(safe-area-inset-bottom, 16px))) !important;
}

@media all and (display-mode: standalone) {
  .admin-map-legend-bar {
    bottom: max(20px, calc(12px + env(safe-area-inset-bottom, 20px))) !important;
  }
  .admin-map-floating-layer {
    bottom: max(24px, calc(12px + env(safe-area-inset-bottom, 20px))) !important;
  }
  .cadastral-floating-unified-bar {
    bottom: max(22px, calc(12px + env(safe-area-inset-bottom, 20px))) !important;
  }
  .cadastral-points-counter-badge {
    bottom: max(16px, calc(10px + env(safe-area-inset-bottom, 16px))) !important;
  }
}

/* ==========================================================================
   GLOBAL IMMERSIVE FULLSCREEN MAP PICKER MODAL (STANDALONE BODY LEVEL)
   ========================================================================== */
#globalFullscreenMapModal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 2147483647 !important;
  background: #0f172a !important;
  display: none !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#globalFullscreenMapModal.active {
  display: flex !important;
  animation: gFullMapFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes gFullMapFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

.gfull-map-top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 12px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  border: 1.5px solid rgba(226, 232, 240, 0.85);
  box-sizing: border-box;
  pointer-events: auto !important;
}

@media (max-width: 480px) {
  .gfull-map-top-bar {
    top: 6px;
    left: 6px;
    right: 6px;
    padding: 8px 10px;
  }
}

.gfull-map-bottom-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.gfull-map-coords-badge {
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gfull-map-confirm-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  font-size: 0.96rem;
  font-weight: 900;
  padding: 12px 32px;
  border-radius: 99px;
  border: 2.5px solid #ffffff;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gfull-map-confirm-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 36px rgba(16, 185, 129, 0.65);
}







