/* ==========================================================================
   Admin Portal & Role-Based Access Control (RBAC) Styling
   ========================================================================== */

/* Login Modal / Screen */
.login-screen-wrap {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: all 0.3s ease;
}

.login-card .login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.login-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-gold, #f59e0b), #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

.login-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.login-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  font-weight: 600;
}

.login-info-strip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.login-card .form-group {
  margin-bottom: 0;
}

.login-form-label {
  font-weight: 800;
  font-size: 0.82rem;
  color: #1e293b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-form-sublabel {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.login-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
  height: 46px;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

.login-input-wrap:focus-within {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important;
  background: #ffffff !important;
}

.login-input-icon {
  width: 42px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.95rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.02);
  border-right: 1px solid #e2e8f0;
}

.login-input-field {
  flex: 1;
  height: 100% !important;
  min-height: 0 !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: 0 12px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  font-size: 0.95rem !important;
  box-shadow: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.login-input-field::placeholder {
  color: #94a3b8 !important;
  font-weight: 500 !important;
  opacity: 0.8 !important;
}

.login-toggle-pass-btn {
  width: 42px;
  height: 100%;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.login-footer-links {
  margin-top: 14px;
  text-align: center;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
}

.login-back-link {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0284c7;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.login-back-link:hover {
  color: #0369a1;
  text-decoration: underline;
}

/* User Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  white-space: nowrap;
}

.role-badge.superadmin {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1.5px solid #f59e0b;
}

.role-badge.admin {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: #0369a1;
  border: 1.5px solid #38bdf8;
}

.role-badge.agent {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d;
  border: 1.5px solid #4ade80;
}

.role-badge.editor {
  background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
  color: #7e22ce;
  border: 1.5px solid #c084fc;
}

/* Modern User Card Styles */
.user-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.user-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  border-color: #cbd5e1;
}

.user-card.role-theme-superadmin {
  border-top: 4px solid #f59e0b;
}

.user-card.role-theme-admin {
  border-top: 4px solid #0284c7;
}

.user-card.role-theme-agent {
  border-top: 4px solid #10b981;
}

.user-card.role-theme-editor {
  border-top: 4px solid #8b5cf6;
}

body.dark-theme .user-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

body.dark-theme .user-card:hover {
  border-color: #475569;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}

/* User Management Table */
.users-table-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-top: 24px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.users-table th, .users-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.users-table th {
  background: var(--bg-main);
  font-weight: 700;
  color: var(--primary-900);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.users-table tr:hover {
  background: #f8fafc;
}

/* Disabled Action Tooltip State */
.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

/* User Profile Badge in Nav */
.user-profile-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-profile-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

/* ==========================================================================
   VIP Animated Glassmorphic Tab Bar for Admin
   ========================================================================== */
.admin-tabs-nav-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 16px;
}

.tab-buttons-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 6px 8px;
  background: #ffffff;
  border-radius: 14px;
  border: 1.5px solid var(--border-color);
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  cursor: grab;
  user-select: none;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-buttons-row.is-dragging {
  cursor: grabbing !important;
  scroll-behavior: auto !important;
}

.tab-buttons-row::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.admin-tab-scroll-btn {
  display: none !important;
}

body.dark-theme .tab-buttons-row {
  background: #131b2e !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.tab-btn {
  flex: 0 0 auto !important;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: visible;
  flex-shrink: 0 !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab-btn::before {
  display: none;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.04);
}

.tab-btn:active {
  transform: scale(0.98);
}

body.dark-theme .tab-btn {
  color: #94a3b8;
}

body.dark-theme .tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Active VIP Pill Tab with Glow & Gradient */
.tab-btn.active {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22), 0 0 10px rgba(245, 158, 11, 0.2) !important;
  flex-shrink: 0 !important;
}

body.dark-theme .tab-btn.active {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.3) !important;
}

.tab-btn.active i {
  color: var(--accent-gold) !important;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
}

.tab-btn i {
  font-size: 0.95rem;
}

.tab-btn .tab-label {
  display: inline-block !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

@keyframes tab-pop {
  0% { transform: scale(0.94); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1) translateY(-1px); }
}

@keyframes icon-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25) rotate(-8deg); }
}

/* Tab Live Badges (Inline, Crisp & Beautiful next to Label) */
.tab-live-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  top: auto !important;
  right: auto !important;
  min-width: 20px !important;
  height: 20px !important;
  padding: 0 6px !important;
  border-radius: 99px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #ffffff;
  margin-left: 4px !important;
  line-height: 1 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12) !important;
  border: none !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

body.dark-theme .tab-live-badge {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.tab-live-badge.emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.45);
  animation: pulse-emerald 2s infinite;
}

.tab-live-badge.orange {
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.45);
  animation: pulse-orange 2s infinite;
}

.tab-live-badge.danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.15) !important;
}

body.dark-theme .tab-live-badge.danger {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
}

.tab-live-badge.neutral {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 900 !important;
}

body.dark-theme .tab-live-badge.neutral {
  background: #334155 !important;
  color: #f8fafc !important;
  border-color: #64748b !important;
}

.tab-btn.active .tab-live-badge {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45) !important;
  font-weight: 900 !important;
}

.tab-btn.active .tab-live-badge.neutral {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #ffffff !important;
}

.tab-btn.active .tab-live-badge.emerald {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

.tab-btn.active .tab-live-badge.orange {
  background: #f97316 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

.tab-btn.active .tab-live-badge.danger {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

.tab-live-badge.ai-badge,
.tab-btn.active .tab-live-badge.ai-badge {
  background: #ea580c !important;
  color: #ffffff !important;
  border: 1.5px solid #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45) !important;
}

@keyframes pulse-emerald {
  0%, 100% {
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.75);
    transform: scale(1.05);
  }
}

@keyframes pulse-orange {
  0%, 100% {
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.75);
    transform: scale(1.05);
  }
}

/* Top Admin Header Brand Positioning (Flush to far-left) */
.navbar {
  padding: 8px 16px 8px 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.nav-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.navbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.navbar-brand img {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Mobile Responsive Admin Enhancements */
@media (max-width: 768px) {
  /* Navbar Mobile Layout */
  .navbar {
    padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 6px !important;
    padding-left: max(6px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(6px, env(safe-area-inset-right, 0px)) !important;
    min-height: calc(46px + env(safe-area-inset-top, 0px)) !important;
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .nav-left {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .navbar-brand {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    min-width: max-content !important;
    width: auto !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .navbar-brand img {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    border-radius: 9px !important;
    background: #ffffff !important;
    border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    filter: none !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .brand-title-styled {
    font-size: 0.92rem !important;
    gap: 4px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  .brand-title-styled .brand-name-gold {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    display: inline !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  .brand-title-styled .brand-name-adaptive {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    display: inline !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  .brand-admin-badge {
    font-size: 0.58rem !important;
    padding: 1px 5px !important;
    border-radius: 99px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    line-height: 1.1 !important;
  }

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

  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    padding: 1px 0 !important;
    box-sizing: border-box !important;
  }
  .nav-actions::-webkit-scrollbar {
    display: none !important;
  }

  /* Show All Nav Action Controls as Clean Uniform Circular Icon Buttons */
  #adminFlagLangBtn, 
  #adminThemeToggleBtn,
  #adminHeaderNotifBtn,
  #adminMoreActionsBtn,
  #btnAdminTopMap,
  #publicWebBtn,
  #btnAdminRefresh,
  #btnSupabaseSync,
  #btnBackupRestore,
  #userNavInfo button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
    max-width: 29px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    font-size: 0.78rem !important;
    box-sizing: border-box !important;
  }

  #adminHeaderNotifBtn {
    position: relative !important;
  }

  #adminHeaderNotifBtn i {
    font-size: 0.75rem !important;
  }

  #adminHeaderNotifBadge {
    position: absolute !important;
    top: -3px !important;
    right: -3px !important;
    min-width: 14px !important;
    height: 14px !important;
    font-size: 0.52rem !important;
    padding: 0 2px !important;
    line-height: 14px !important;
    border-width: 1px !important;
  }

  /* Hide all inner text labels on mobile to keep icons perfectly spaced */
  #btnAdminRefresh span,
  #publicWebBtn span,
  #btnSupabaseSync span,
  #btnBackupRestore span,
  #userNavInfo button span,
  .user-profile-nav {
    display: none !important;
  }

  #adminFlagLangIcon svg {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    display: block !important;
  }

  #adminThemeIcon {
    font-size: 0.72rem !important;
  }

  #userNavInfo {
    display: flex !important;
    align-items: center !important;
    gap: 2.5px !important;
    flex-shrink: 0 !important;
  }
}

@media (max-width: 380px) {
  .navbar {
    padding: 3px 4px !important;
    gap: 2px !important;
  }

  .navbar-brand img {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(245, 158, 11, 0.5) !important;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.15)) !important;
  }

  .brand-title-styled {
    font-size: 0.82rem !important;
    gap: 3px !important;
  }

  .brand-title-styled .brand-name-gold,
  .brand-title-styled .brand-name-adaptive {
    font-size: 0.82rem !important;
  }

  .brand-admin-badge {
    font-size: 0.52rem !important;
    padding: 1px 4px !important;
  }

  .nav-actions {
    gap: 2px !important;
  }

  #adminFlagLangBtn, 
  #adminThemeToggleBtn,
  #adminHeaderNotifBtn,
  #adminMoreActionsBtn,
  #btnAdminTopMap,
  #publicWebBtn,
  #btnAdminRefresh,
  #btnSupabaseSync,
  #btnBackupRestore,
  #userNavInfo button {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    font-size: 0.7rem !important;
  }

  #adminFlagLangIcon svg {
    width: 14px !important;
    height: 14px !important;
  }
}

@media (max-width: 768px) {
  /* Top Tabs Bar on Mobile (Clean Representative Icons Only - No Text) */
  .tab-buttons-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
    scrollbar-width: none !important;
    background: #ffffff !important;
  }

  body.dark-theme .tab-buttons-row {
    background: #131b2e !important;
  }

  .tab-buttons-row .desktop-only-tab {
    display: none !important;
  }

  .tab-buttons-row::-webkit-scrollbar {
    display: none !important;
  }

  .tab-btn {
    flex: 0 0 auto !important;
    min-width: 44px !important;
    height: 40px !important;
    padding: 0 8px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    gap: 3px !important;
  }

  .tab-btn .tab-label {
    display: none !important; /* Hide text on mobile, only show icons */
  }

  .tab-btn i {
    font-size: 1.15rem !important;
  }

  .tab-live-badge {
    position: absolute !important;
    top: -3px !important;
    right: -4px !important;
    min-width: 17px !important;
    height: 17px !important;
    font-size: 0.62rem !important;
    font-weight: 900 !important;
    padding: 0 4px !important;
    margin-left: 0 !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 99px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22) !important;
    border: 1.5px solid #ffffff !important;
    z-index: 5 !important;
    pointer-events: none !important;
  }

  body.dark-theme .tab-live-badge {
    border-color: #131b2e !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
  }

  .tab-icon-wrap {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Banner Card on Mobile */
  .dashboard-container {
    padding: 10px 8px 80px 8px !important;
  }

  .banner-card {
    padding: 12px 14px !important;
    border-radius: 12px !important;
    gap: 8px !important;
  }

  .banner-title {
    font-size: 0.95rem !important;
  }

  .banner-desc {
    font-size: 0.72rem !important;
  }

  #btnAddProp {
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
    border-radius: 7px !important;
  }

  /* Stats Grid on Mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .stat-card {
    padding: 10px 12px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }

  .stat-value {
    font-size: 1.2rem !important;
  }

  .stat-title {
    font-size: 0.72rem !important;
  }

  /* Floating Map Button Position */
  .floating-map-btn-mobile {
    bottom: 76px !important;
    right: 10px !important;
    padding: 6px 11px !important;
    font-size: 0.72rem !important;
  }

  .users-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .user-card {
    padding: 10px !important;
    border-radius: 12px !important;
  }

  .user-full-name {
    font-size: 0.85rem !important;
  }

  .login-card {
    padding: 20px 16px !important;
  }

  .users-table-card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .users-table {
    min-width: 550px;
  }
}

/* ==========================================================================
   Admin Dark Theme Mode Overrides for Login & RBAC
   ========================================================================== */
body.dark-theme .login-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .login-card .login-title {
  color: #ffffff !important;
}

body.dark-theme .login-card .login-subtitle {
  color: #94a3b8 !important;
}

body.dark-theme .login-card .login-info-strip {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
}

body.dark-theme .login-card .login-form-label {
  color: #e2e8f0 !important;
}

body.dark-theme .login-card .login-form-sublabel {
  color: #94a3b8 !important;
}

body.dark-theme .login-card .login-input-wrap {
  background: #0f172a !important;
  border-color: #334155 !important;
}

body.dark-theme .login-card .login-input-wrap:focus-within {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
  background: #0f172a !important;
}

body.dark-theme .login-card .login-input-icon {
  background: rgba(255, 255, 255, 0.03) !important;
  border-right-color: #334155 !important;
  color: #94a3b8 !important;
}

body.dark-theme .login-card .login-input-field {
  color: #ffffff !important;
  background: transparent !important;
}

body.dark-theme .login-card .login-input-field::placeholder {
  color: #64748b !important;
}

body.dark-theme .login-card .login-toggle-pass-btn {
  color: #94a3b8 !important;
}

body.dark-theme .login-card .login-footer-links {
  border-top-color: #1e293b !important;
}

body.dark-theme .login-card .login-back-link {
  color: #38bdf8 !important;
}

/* Chrome/Safari Autofill for Admin Login Input */
body.dark-theme .login-card .login-input-wrap input:-webkit-autofill,
body.dark-theme .login-card .login-input-wrap input:-webkit-autofill:hover, 
body.dark-theme .login-card .login-input-wrap input:-webkit-autofill:focus, 
body.dark-theme .login-card .login-input-wrap input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff !important;
  font-weight: 700 !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

body.light-theme .login-card .login-input-wrap input:-webkit-autofill,
body.light-theme .login-card .login-input-wrap input:-webkit-autofill:hover, 
body.light-theme .login-card .login-input-wrap input:-webkit-autofill:focus, 
body.light-theme .login-card .login-input-wrap input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a !important;
}

body.dark-theme .users-table-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

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

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

/* Responsive Owners Directory Grid: 3 columns on Desktop/Web, 2 columns on Mobile */
.owners-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 992px) {
  .owners-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .owners-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* Portfolio Modal Properties Grid (2 columns on mobile/tablet, 3-4 on wide desktop) */
.portfolio-props-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 1024px) {
  .portfolio-props-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 1400px) {
  .portfolio-props-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

/* Research Hub Responsive Cards Grid: 2 columns on Mobile & Tablet, 3 on Web Admin / Desktop */
.admin-research-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 640px) and (max-width: 1023px) {
  .admin-research-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

@media (min-width: 1024px) {
  .admin-research-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

@media (max-width: 639px) {
  .admin-research-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .public-research-modal-card {
    width: 99% !important;
    max-width: 99vw !important;
  }
  .public-research-modal-body {
    padding: 8px 6px !important;
  }
  .admin-research-hub,
  #adminResearchPanel {
    padding-bottom: 0 !important;
  }
  #adminResearchContentContainer {
    padding-bottom: 8px !important;
  }
  .research-card-photo-box {
    height: 125px !important;
  }
  .research-lead-card {
    border-radius: 10px !important;
  }
  .research-card-title {
    font-size: 0.76rem !important;
    -webkit-line-clamp: 1 !important;
  }
  .research-card-price {
    font-size: 0.78rem !important;
  }
  .research-phone-text {
    font-size: 0.64rem !important;
  }
  .research-card-actions-dropdown-btn {
    height: 28px !important;
    font-size: 0.68rem !important;
    padding: 0 4px !important;
  }
}


.research-card-photo-box {
  position: relative;
  width: 100%;
  height: 180px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}

@media (min-width: 900px) {
  .research-card-photo-box {
    height: 195px;
  }
}

.research-card-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s;
}

.research-card-photo-box:hover img {
  transform: scale(1.04);
}

/* ==========================================================================
   DEDICATED OWNER SUBMISSIONS ALERT BANNER (LIGHT & DARK THEME ENGINE)
   ========================================================================== */
.admin-submissions-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}

.admin-submissions-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.12);
}

.admin-sub-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.admin-sub-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 3px 6px rgba(234, 88, 12, 0.25);
}

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

.admin-sub-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: #9a3412;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-sub-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffffff;
  background: #ea580c;
  padding: 1px 7px;
  border-radius: 99px;
}

.admin-sub-desc {
  margin: 1px 0 0 0;
  font-size: 0.75rem;
  color: #c2410c;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sub-desc strong {
  color: #9a3412;
  font-weight: 900;
}

.admin-sub-arrow {
  color: #ea580c;
  font-size: 0.84rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* --- Dark Theme Overrides for Owner Submissions Banner --- */
body.dark-theme .admin-submissions-banner {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.16) 0%, #131b2e 100%) !important;
  border: 1.5px solid rgba(249, 115, 22, 0.35) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}

body.dark-theme .admin-submissions-banner:hover {
  border-color: rgba(249, 115, 22, 0.6) !important;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.2) !important;
}

body.dark-theme .admin-sub-icon {
  background: linear-gradient(135deg, #f97316, #ea580c) !important;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4) !important;
}

body.dark-theme .admin-sub-title {
  color: #fdba74 !important;
}

body.dark-theme .admin-sub-badge {
  background: #f97316 !important;
  color: #0f172a !important;
  font-weight: 900 !important;
}

body.dark-theme .admin-sub-desc {
  color: #cbd5e1 !important;
}

body.dark-theme .admin-sub-desc strong {
  color: #fdba74 !important;
}

body.dark-theme .admin-sub-arrow {
  color: #fb923c !important;
}

/* ==========================================================================
   TOOLBAR, SEARCH HUB & AUTO-HIDE FILTER DRAWER (DARK THEME SUPPORT)
   ========================================================================== */
.luxury-search-hub {
  padding: 10px 12px;
  background: #ffffff;
  border-radius: 14px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.search-input-wrap input {
  padding-left: 34px;
  min-height: 40px;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-wrap input:focus {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-filter-toggle {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  transition: all 0.2s ease;
}

.btn-filter-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* --- Dark Mode Overrides for Toolbar & Filter Hub --- */
body.dark-theme .luxury-search-hub {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

body.dark-theme .search-input-wrap input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .search-input-wrap input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

body.dark-theme .search-input-wrap i {
  color: #94a3b8 !important;
}

body.dark-theme .btn-filter-toggle,
body.dark-theme #adminPropFilterToggleBtn {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .btn-filter-toggle:hover,
body.dark-theme #adminPropFilterToggleBtn:hover {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}

body.dark-theme .admin-filter-drawer {
  background: #0f172a !important;
  border-color: #334155 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

body.dark-theme .admin-filter-drawer-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme .admin-filter-drawer-title {
  color: #f8fafc !important;
}

body.dark-theme .admin-filter-field label {
  color: #cbd5e1 !important;
}

body.dark-theme .admin-filter-field select,
body.dark-theme .admin-filter-drawer .filter-select {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .admin-filter-field select:hover,
body.dark-theme .admin-filter-drawer .filter-select:hover {
  background: #334155 !important;
  border-color: #475569 !important;
}

body.dark-theme .admin-filter-field select:focus,
body.dark-theme .admin-filter-drawer .filter-select:focus {
  border-color: #38bdf8 !important;
  background: #1e293b !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

body.dark-theme .btn-filter-close {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-theme .btn-filter-close:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

body.dark-theme .btn-filter-reset {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
}

body.dark-theme .btn-filter-reset:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ef4444 !important;
}

/* ==========================================================================
   FIELD RESEARCH OCR HUB (LIGHT & DARK THEME ENGINE)
   ========================================================================== */
.research-hub-hero-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.research-hub-title {
  color: #0f172a;
}

.research-hub-desc {
  color: #64748b;
}

.research-stat-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.research-stat-label {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 700;
}

.research-stat-val {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
}

.research-filter-toolbar {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: all 0.3s ease;
}

.research-search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s;
}

.research-search-input:focus {
  border-color: #0284c7;
}

.research-select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.80rem;
  font-weight: 700;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  outline: none;
}

.research-view-toggle-wrap {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.research-lead-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s ease, border-color 0.3s ease;
}

.research-card-title {
  color: #0f172a;
}

.research-phone-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.research-phone-text {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
}

.research-copy-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 0.58rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Dark Theme Overrides for Field Research Hub --- */
body.dark-theme .research-hub-hero-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25) !important;
}

body.dark-theme .research-hub-title {
  color: #f8fafc !important;
}

body.dark-theme .research-hub-desc {
  color: #94a3b8 !important;
}

body.dark-theme .research-stat-pill {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .research-stat-label {
  color: #94a3b8 !important;
}

body.dark-theme .research-stat-val {
  color: #f8fafc !important;
}

body.dark-theme .research-filter-toolbar {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important;
}

body.dark-theme .research-search-input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .research-search-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

body.dark-theme .research-select {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .research-view-toggle-wrap {
  background: #0f172a !important;
  border-color: #334155 !important;
}

body.dark-theme .research-lead-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
}

body.dark-theme .research-lead-card:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35) !important;
}

body.dark-theme .research-card-title {
  color: #f8fafc !important;
}

body.dark-theme .research-phone-strip {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .research-phone-text {
  color: #f8fafc !important;
}

body.dark-theme .research-copy-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .research-card-actions-row {
  border-top-color: #1e293b !important;
}

body.dark-theme .research-tag-pill {
  background: #0f172a !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   PHOTO LIGHTBOX & VERIFICATION MODAL (LIGHT & DARK THEME ENGINE)
   ========================================================================== */
.lightbox-modal-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.7);
  max-width: 1050px;
  width: 96vw;
  max-height: 94vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.lightbox-info-panel {
  padding: 20px 24px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}

.lightbox-verify-box {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1.5px solid #6ee7b7;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-verify-title {
  font-weight: 900;
  font-size: 0.85rem;
  color: #065f46;
}

.lightbox-verify-sub {
  font-size: 0.72rem;
  color: #047857;
}

.lightbox-phone-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.lightbox-phone-num {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.lightbox-phone-idx {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-phone-label {
  font-size: 0.76rem;
  font-weight: 900;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-modal-actions .lightbox-close-btn {
  flex: 1;
  background: #e2e8f0;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* --- Dark Theme Overrides for Lightbox Modal --- */
body.dark-theme .lightbox-modal-card {
  background: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-theme .lightbox-info-panel {
  background: #131b2e !important;
}

body.dark-theme .lightbox-verify-box {
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.35), rgba(5, 150, 105, 0.15)) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

body.dark-theme .lightbox-verify-title {
  color: #6ee7b7 !important;
}

body.dark-theme .lightbox-verify-sub {
  color: #a7f3d0 !important;
}

body.dark-theme .lightbox-phone-label {
  color: #cbd5e1 !important;
}

body.dark-theme .lightbox-phone-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .lightbox-phone-num {
  color: #f8fafc !important;
}

body.dark-theme .lightbox-phone-idx {
  background: #1e293b !important;
  color: #94a3b8 !important;
}

body.dark-theme .lightbox-modal-actions .lightbox-close-btn {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-theme .lightbox-modal-actions .lightbox-close-btn:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   ADMIN ADD CHOICE MODAL (LIGHT & DARK THEME ENGINE)
   ========================================================================== */
.admin-choice-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideUpModal 0.25s ease;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

.admin-choice-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-choice-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-choice-close {
  background: rgba(241, 245, 249, 0.8);
  border: none;
  font-size: 1.1rem;
  color: #64748b;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-choice-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.admin-choice-item.choice-prop {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1.5px solid #bfdbfe;
}

.admin-choice-item.choice-research {
  background: linear-gradient(135deg, #ecfeff 0%, #ffffff 100%);
  border: 1.5px solid #a5f3fc;
}

.admin-choice-item.choice-fb {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1.5px solid #bbf7d0;
}

.admin-choice-item-title {
  font-size: 0.92rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
}

.choice-prop .admin-choice-item-title { color: #1e3a8a; }
.choice-research .admin-choice-item-title { color: #155e75; }
.choice-fb .admin-choice-item-title { color: #166534; }

.admin-choice-item-desc {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.admin-choice-cancel-btn {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

/* --- Dark Theme Overrides for Add Choice Modal --- */
body.dark-theme .admin-choice-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .admin-choice-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme .admin-choice-title {
  color: #f8fafc !important;
}

body.dark-theme .admin-choice-close {
  background: #1e293b !important;
  color: #94a3b8 !important;
}

body.dark-theme .admin-choice-item.choice-prop {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, #131b2e 100%) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

body.dark-theme .admin-choice-item.choice-research {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.15) 0%, #131b2e 100%) !important;
  border-color: rgba(6, 182, 212, 0.35) !important;
}

body.dark-theme .admin-choice-item.choice-fb {
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.15) 0%, #131b2e 100%) !important;
  border-color: rgba(24, 119, 242, 0.35) !important;
}

body.dark-theme .choice-prop .admin-choice-item-title { color: #93c5fd !important; }
body.dark-theme .choice-research .admin-choice-item-title { color: #67e8f9 !important; }
body.dark-theme .choice-fb .admin-choice-item-title { color: #60a5fa !important; }

body.dark-theme .admin-choice-item-desc {
  color: #94a3b8 !important;
}

body.dark-theme .admin-choice-cancel-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .admin-choice-cancel-btn:hover {
  background: #334155 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   ADMIN PROPERTY FORM MODAL & HOUSE SPECS (LIGHT & DARK THEME ENGINE)
   ========================================================================== */
.compact-admin-modal {
  max-width: 720px;
  width: 96vw;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  background: #ffffff;
  overflow: hidden;
  position: relative;
}

.compact-admin-modal .modal-header {
  padding: 12px 18px;
  border-bottom: 2px solid var(--accent-gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  color: #ffffff;
}

.compact-admin-modal .modal-body {
  padding: 14px 18px;
  max-height: 78vh;
  overflow-y: auto;
  background: #ffffff;
}

.compact-admin-modal .modal-footer {
  padding: 10px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-radius: 0 0 14px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.form-house-specs-box {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
}

.form-house-specs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 6px;
}

.form-house-specs-title {
  font-weight: 800;
  font-size: 0.82rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.form-house-specs-subtitle {
  font-size: 0.70rem;
  font-weight: 700;
  color: #64748b;
}

.form-house-specs-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.form-house-specs-input {
  height: 38px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  box-sizing: border-box;
}

.amenity-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  color: #1e293b;
  user-select: none;
  transition: all 0.15s ease;
}

.amenity-checkbox-label.checked {
  border-color: #10b981;
  background: #ecfdf5;
}

/* Map Picker Components */
.form-map-picker-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
}

.map-picker-title {
  color: #0f172a;
}

.map-layer-toggle-wrap {
  display: inline-flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 6px;
}

.map-layer-btn {
  border: none;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #64748b;
}

.map-layer-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.map-coords-badge {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}

.map-quick-jump-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.map-quick-jump-bar::-webkit-scrollbar {
  display: none;
}

.map-quick-jump-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  color: #334155;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.map-quick-jump-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.form-core-info-box {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  border: 1.5px solid #7dd3fc;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
}

.form-core-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1.5px dashed #7dd3fc;
  padding-bottom: 6px;
  margin-bottom: 2px;
  flex-wrap: nowrap;
  transition: border-color 0.25s ease;
}

.form-core-info-title {
  font-weight: 800;
  font-size: 0.84rem;
  color: #0284c7;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.form-core-info-title i.text-gold,
.form-core-info-title i.fa-star {
  color: #f59e0b !important;
}

.form-core-info-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #0284c7;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid #7dd3fc;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.12);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.25s ease;
}

/* Owner & Agent Components */
.form-owner-info-box {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #fff1f2 0%, #fff5f5 50%, #fef2f2 100%);
  border: 1.5px solid #fecdd3;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.06);
}

.owner-box-header-title {
  font-weight: 800;
  font-size: 0.86rem;
  color: #9f1239;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.owner-privacy-tag {
  background: #ffe4e6;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
}

.assigned-agent-card {
  background: #ffffff;
  border: 1.5px solid #fecdd3;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.04);
}

.assigned-agent-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #9f1239;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.assigned-agent-pill {
  font-size: 0.68rem;
  color: #be123c;
  font-weight: 700;
  background: #fff1f2;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid #fecdd3;
}

.assigned-agent-select {
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  width: 100%;
  color: #0f172a;
  padding: 0 10px;
  box-sizing: border-box;
}

.assigned-agent-preview {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  height: 38px;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-field-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.owner-field-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ==========================================================================
   DARK THEME OVERRIDES FOR PROPERTY FORM MODAL & SPECS
   ========================================================================== */
body.dark-theme .compact-admin-modal {
  background: #0f172a !important;
  border: 1.5px solid #1e293b !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7) !important;
}

body.dark-theme .compact-admin-modal .modal-header {
  background: #0f172a !important;
  border-bottom-color: #1e293b !important;
}

body.dark-theme .compact-admin-modal .modal-header h3 {
  color: #f8fafc !important;
}

body.dark-theme .compact-admin-modal .modal-body {
  background: #0f172a !important;
}

body.dark-theme .compact-admin-modal .modal-footer {
  background: #090d16 !important;
  border-top-color: #1e293b !important;
}

body.dark-theme .compact-admin-modal .form-group label {
  color: #cbd5e1 !important;
}

body.dark-theme .compact-admin-modal .form-group input,
body.dark-theme .compact-admin-modal .form-group select,
body.dark-theme .compact-admin-modal .form-group textarea {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .compact-admin-modal .form-group input::placeholder,
body.dark-theme .compact-admin-modal .form-group textarea::placeholder {
  color: #64748b !important;
}

/* Dark mode for House Specifications Box */
body.dark-theme .form-house-specs-box {
  background: linear-gradient(135deg, #131b2e 0%, #0f172a 100%) !important;
  border-color: #1e293b !important;
}

body.dark-theme .form-house-specs-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme .form-house-specs-title {
  color: #f8fafc !important;
}

body.dark-theme .form-house-specs-subtitle {
  color: #94a3b8 !important;
}

body.dark-theme .form-house-specs-label {
  color: #cbd5e1 !important;
}

body.dark-theme .form-house-specs-input {
  background: #0b1120 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .form-house-specs-input::placeholder {
  color: #64748b !important;
}

/* Dark mode for Amenities pills */
body.dark-theme .amenity-checkbox-label {
  background: #0b1120 !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

body.dark-theme .amenity-checkbox-label.checked {
  background: rgba(6, 95, 70, 0.3) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
}

/* Dark mode for Map Picker Box */
body.dark-theme .form-map-picker-box,
body.dark-mode .form-map-picker-box {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme .map-picker-title,
body.dark-theme .map-picker-title span,
body.dark-mode .map-picker-title,
body.dark-mode .map-picker-title span {
  color: #f8fafc !important;
}

body.dark-theme .form-map-picker-box button[onclick*="getPropFormCurrentGPS"],
body.dark-mode .form-map-picker-box button[onclick*="getPropFormCurrentGPS"] {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .form-map-picker-box button[onclick*="openAdminPropertyParcelDrawer"],
body.dark-mode .form-map-picker-box button[onclick*="openAdminPropertyParcelDrawer"] {
  background: rgba(2, 132, 199, 0.2) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

body.dark-theme #propFormLeafletMap,
body.dark-mode #propFormLeafletMap {
  border-color: #334155 !important;
}

body.dark-theme .map-layer-toggle-wrap {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
}

body.dark-theme .map-layer-btn {
  color: #94a3b8 !important;
}

body.dark-theme .map-layer-btn.active {
  background: #1e293b !important;
  color: #38bdf8 !important;
}

body.dark-theme .map-coords-badge {
  background: rgba(15, 23, 42, 0.9) !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .map-quick-jump-btn {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

body.dark-theme .map-quick-jump-btn:hover {
  background: #1e293b !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

/* Dark mode for Core Information Box & Star Badges */
body.dark-theme .form-core-info-box,
body.dark-mode .form-core-info-box {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.14) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .form-core-info-header,
body.dark-mode .form-core-info-header {
  border-bottom-color: rgba(56, 189, 248, 0.25) !important;
}

body.dark-theme .form-core-info-title,
body.dark-mode .form-core-info-title {
  color: #38bdf8 !important;
}

body.dark-theme .form-core-info-title span,
body.dark-mode .form-core-info-title span {
  color: #f8fafc !important;
}

body.dark-theme .form-core-info-title i.fa-star,
body.dark-mode .form-core-info-title i.fa-star {
  color: #f59e0b !important;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

body.dark-theme .form-core-info-badge,
body.dark-mode .form-core-info-badge,
body.dark-theme .form-core-info-box .form-core-info-badge,
body.dark-mode .form-core-info-box .form-core-info-badge {
  background: rgba(2, 132, 199, 0.22) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Dark mode for Owner & Agent Box */
body.dark-theme .form-owner-info-box {
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.22) 0%, #131b2e 100%) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .owner-box-header-title {
  color: #6ee7b7 !important;
}

body.dark-theme .owner-privacy-tag {
  background: rgba(6, 95, 70, 0.4) !important;
  color: #a7f3d0 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

body.dark-theme .assigned-agent-card {
  background: #0f172a !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .assigned-agent-label {
  color: #6ee7b7 !important;
}

body.dark-theme .assigned-agent-pill {
  background: rgba(6, 95, 70, 0.3) !important;
  color: #a7f3d0 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

body.dark-theme .assigned-agent-select,
body.dark-theme #pAssignedAgent {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .assigned-agent-preview {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme #pAssignedAgentPhonePreview {
  color: #6ee7b7 !important;
}

body.dark-theme #pAssignedAgentTelegramPreview {
  color: #38bdf8 !important;
}

body.dark-theme .owner-field-label {
  color: #cbd5e1 !important;
}

body.dark-theme .btn-add-phone-mini {
  background: rgba(6, 95, 70, 0.35) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

body.dark-theme .multi-phone-input {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   AI REAL ESTATE BANNER & GPS OCR MODAL (THEME ENGINE)
   ========================================================================== */
.modal-overlay#adminFieldResearchModal {
  overflow: hidden !important;
  overscroll-behavior: contain !important;
  touch-action: pan-y !important;
}

.admin-ocr-modal-card {
  max-width: 740px;
  width: 95vw;
  height: 92vh;
  height: 92dvh;
  max-height: 92dvh;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
  border: 1.5px solid rgba(6, 182, 212, 0.4);
  background: #ffffff;
  box-sizing: border-box;
}

.admin-ocr-modal-body {
  padding: 16px;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  background: #ffffff;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .modal-overlay#adminFieldResearchModal {
    padding: 0 !important;
    align-items: flex-end !important;
    justify-content: center !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  .admin-ocr-modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 96dvh !important;
    max-height: 96dvh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .admin-ocr-modal-body {
    padding: 12px 14px 44px 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
}

.admin-ocr-dropzone {
  border: 2px dashed #0891b2;
  background: #f0fdfa;
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 14px;
}

.admin-ocr-dropzone-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px 0;
}

.admin-ocr-dropzone-desc {
  font-size: 0.76rem;
  color: #64748b;
  margin: 0;
}

.admin-ocr-phones-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
}

.admin-ocr-phones-title {
  font-size: 0.8rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.admin-ocr-add-phone-btn {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  color: #059669;
  border: 1px solid #86efac;
  background: #f0fdf4;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.admin-rlead-phone-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  flex-shrink: 0;
}

.admin-rlead-phone-input {
  font-size: 0.95rem;
  font-weight: 900;
  color: #047857;
  height: 38px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  flex: 1;
  padding: 0 10px;
  box-sizing: border-box;
  background: #ffffff;
}

.admin-ocr-field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.admin-ocr-input,
.admin-ocr-select {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  height: 38px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 0.86rem;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
}

.admin-ocr-map-box {
  background: #ffffff;
  border: 1.5px solid #0284c7;
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
}

.admin-ocr-map-title {
  font-size: 0.82rem;
  font-weight: 900;
  color: #0369a1;
}

.admin-ocr-gps-btn {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #16a34a;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.74rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap !important;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.admin-ocr-gps-btn:hover {
  background: #dcfce7;
  border-color: #4ade80;
}

.admin-ocr-expand-btn {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #0284c7;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.74rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap !important;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.admin-ocr-expand-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.admin-ocr-landmark-pill {
  padding: 3px 9px;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.admin-ocr-landmark-pill:hover,
.admin-ocr-landmark-pill.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.admin-ocr-map-box.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  z-index: 99999 !important;
  border-radius: 18px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85) !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
}

.admin-ocr-map-box.is-fullscreen > div:first-child,
.admin-ocr-map-box.is-fullscreen .admin-ocr-landmarks-bar {
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 20 !important;
}

.admin-ocr-map-box.is-fullscreen #adminFieldResearchInteractiveMap {
  flex: 1 1 0px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 10px !important;
  width: 100% !important;
  position: relative !important;
  z-index: 10 !important;
  overflow: hidden !important;
}

.admin-ocr-map-box.is-fullscreen > div:last-child {
  flex-shrink: 0 !important;
  margin-top: 6px !important;
  position: relative !important;
  z-index: 20 !important;
}

.admin-ocr-fullscreen-done-btn {
  display: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.82rem;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  white-space: nowrap;
}

.admin-ocr-map-box.is-fullscreen .admin-ocr-fullscreen-done-btn {
  display: inline-flex !important;
}

.admin-ocr-modal-card.has-fullscreen-map {
  overflow: hidden !important;
}

.admin-ocr-modal-body.has-fullscreen-map {
  overflow: hidden !important;
}


.admin-ocr-coord-input {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0284c7;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 8px;
  width: 100%;
  box-sizing: border-box;
}

.admin-ocr-cancel-btn {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
}

/* --- OCR Dark Theme Overrides --- */
body.dark-theme .admin-ocr-modal-card {
  background: #0b1329 !important;
  border-color: rgba(6, 182, 212, 0.45) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8) !important;
}

body.dark-theme .admin-ocr-modal-body {
  background: #0b1329 !important;
}

body.dark-theme .admin-ocr-dropzone {
  background: #0f172a !important;
  border-color: #06b6d4 !important;
}

body.dark-theme .admin-ocr-dropzone:hover {
  background: #131f37 !important;
}

body.dark-theme .admin-ocr-dropzone-title {
  color: #f8fafc !important;
}

body.dark-theme .admin-ocr-dropzone-desc {
  color: #94a3b8 !important;
}

body.dark-theme .admin-ocr-phones-box {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .admin-ocr-phones-title {
  color: #f8fafc !important;
}

body.dark-theme .admin-ocr-add-phone-btn {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #6ee7b7 !important;
}

body.dark-theme .admin-rlead-phone-badge {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #6ee7b7 !important;
}

body.dark-theme .admin-rlead-phone-input {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #6ee7b7 !important;
}

body.dark-theme .admin-ocr-field-label {
  color: #cbd5e1 !important;
}

body.dark-theme .admin-ocr-input,
body.dark-theme .admin-ocr-select {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme #adminRLeadCode {
  color: #38bdf8 !important;
}

body.dark-theme #adminRLeadPrice {
  color: #fbbf24 !important;
}

body.dark-theme .admin-ocr-map-box {
  background: #0f172a !important;
  border-color: rgba(2, 132, 199, 0.5) !important;
}

body.dark-theme .admin-ocr-map-box.is-fullscreen {
  background: #0b1329 !important;
  border-color: #38bdf8 !important;
}

body.dark-theme .admin-ocr-expand-btn {
  background: rgba(2, 132, 199, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

body.dark-theme .admin-ocr-expand-btn:hover {
  background: rgba(2, 132, 199, 0.35) !important;
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
}

body.dark-theme .admin-ocr-landmark-pill {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

body.dark-theme .admin-ocr-landmark-pill:hover,
body.dark-theme .admin-ocr-landmark-pill.active {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

body.dark-theme .admin-ocr-map-title {
  color: #38bdf8 !important;
}

body.dark-theme .admin-ocr-gps-btn {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #6ee7b7 !important;
}


body.dark-theme .admin-ocr-coord-input {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #38bdf8 !important;
}

body.dark-theme .admin-ocr-cancel-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   FACEBOOK PROPERTIES HUB & AGENTS DIRECTORY (THEME ENGINE)
   ========================================================================== */
.fb-hub-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
}

.fb-hub-subtitle {
  margin: 3px 0 0 0;
  font-size: 0.80rem;
  color: #64748b;
  font-weight: 600;
}

.fb-hub-toolbar {
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.fb-view-switcher {
  display: flex;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
}

.fb-props-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .fb-props-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

.fb-agents-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .fb-agents-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

.fb-agent-card {
  box-sizing: border-box;
  min-width: 0;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.fb-agent-card * {
  box-sizing: border-box;
}

.fb-agent-photo-box {
  position: relative;
  width: 100%;
  height: 125px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 900px) {
  .fb-agent-photo-box {
    height: 195px;
  }
}

.fb-agent-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.3s;
}

.fb-agent-photo-box:hover img {
  transform: scale(1.04);
}

.fb-card-image-box {
  position: relative;
  width: 100%;
  height: 125px;
  background: #0f172a;
  overflow: hidden;
}

@media (min-width: 900px) {
  .fb-card-image-box {
    height: 195px;
  }
}

.fb-card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s;
}

.fb-card-image-box:hover img {
  transform: scale(1.04);
}

.fb-property-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.fb-card-title-text {
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.fb-card-location {
  font-size: 0.72rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.fb-card-agent-badge {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
}

.fb-card-agent-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 4px;
  font-size: 0.7rem;
}

.fb-card-btn-edit {
  padding: 2px 4px;
  font-size: 0.7rem;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
}

.fb-table-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.fb-empty-state {
  text-align: center;
  padding: 40px 16px;
  border-radius: 12px;
  border: 1.5px dashed #cbd5e1;
  background: #ffffff;
}

.fb-agent-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

.fb-agent-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.fb-agent-contact-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

/* --- Dark Theme Overrides for Facebook Hub --- */
body.dark-theme .fb-hub-header-card {
  background: linear-gradient(135deg, #0f172a, #131d31) !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

body.dark-theme .fb-hub-title {
  color: #f8fafc !important;
}

body.dark-theme .fb-hub-subtitle {
  color: #94a3b8 !important;
}

body.dark-theme .fb-hub-toolbar {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4) !important;
}

body.dark-theme #fbPropSearchInput,
body.dark-theme #fbAgentSearchInput {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme #fbPropSearchInput::placeholder,
body.dark-theme #fbAgentSearchInput::placeholder {
  color: #64748b !important;
}

body.dark-theme #fbPropTypeSelect,
body.dark-theme #fbPropListingSelect {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .fb-view-switcher {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme .fb-property-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5) !important;
}

body.dark-theme .fb-card-title-text {
  color: #f8fafc !important;
}

body.dark-theme .fb-card-location {
  color: #94a3b8 !important;
}

body.dark-theme .fb-card-agent-badge {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-card-agent-name {
  color: #f8fafc !important;
}

body.dark-theme .fb-card-footer {
  border-color: #1e293b !important;
}

body.dark-theme .fb-card-btn-edit {
  color: #cbd5e1 !important;
}

body.dark-theme .fb-table-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5) !important;
}

body.dark-theme .fb-table-card tr {
  border-color: #1e293b !important;
}

body.dark-theme .fb-table-card tr:hover {
  background: #131b2e !important;
}

body.dark-theme .fb-table-card thead tr {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

body.dark-theme .fb-table-card td {
  color: #f8fafc !important;
}

body.dark-theme .fb-empty-state {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-empty-state h4 {
  color: #f8fafc !important;
}

body.dark-theme .fb-agent-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5) !important;
}

body.dark-theme .fb-agent-name {
  color: #f8fafc !important;
}

body.dark-theme .fb-agent-contact-bar {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

/* ==========================================================================
   FACEBOOK PROPERTY DETAIL & AGENT LISTINGS MODALS (THEME ENGINE)
   ========================================================================== */
.fb-detail-modal-card {
  max-width: 650px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.fb-detail-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.fb-detail-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
}

.fb-detail-prop-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  line-height: 1.4;
}

.fb-detail-meta-line {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
}

.fb-detail-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.82rem;
  color: #0f172a;
}

.fb-detail-desc-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}

.fb-detail-desc-title {
  font-size: 0.84rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #0f172a;
}

.fb-detail-desc-text {
  font-size: 0.8rem;
  color: #334155;
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.fb-detail-agent-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.fb-detail-agent-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.fb-agent-listings-modal-card {
  max-width: 800px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.fb-agent-listings-item {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: transform 0.2s;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* --- Dark Theme Overrides for Detail & Agent Listings Modals --- */
body.dark-theme .fb-detail-modal-card,
body.dark-theme .fb-agent-listings-modal-card,
body.dark-theme #fbPropDetailModal .modal-card,
body.dark-theme #fbAgentListingsModal .modal-card {
  background: #0f172a !important;
  border: 1.5px solid #1e293b !important;
  box-shadow: 0 25px 70px rgba(0,0,0,0.8) !important;
}

body.dark-theme .fb-detail-modal-header,
body.dark-theme #fbPropDetailModal .modal-card > div:first-child,
body.dark-theme #fbAgentListingsModal .modal-card > div:first-child {
  border-color: #1e293b !important;
}

body.dark-theme .fb-detail-title,
body.dark-theme #fbPropDetailModal .modal-card > div:first-child span,
body.dark-theme #fbAgentListingsModal .modal-card h3 {
  color: #f8fafc !important;
}

body.dark-theme .fb-detail-prop-title {
  color: #f8fafc !important;
}

body.dark-theme .fb-detail-meta-line {
  color: #94a3b8 !important;
}

body.dark-theme .fb-detail-box {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .fb-detail-box strong {
  color: #94a3b8 !important;
}

body.dark-theme .fb-detail-desc-box {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-detail-desc-title {
  color: #f8fafc !important;
}

body.dark-theme .fb-detail-desc-text {
  color: #cbd5e1 !important;
}

body.dark-theme .fb-detail-agent-box {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-detail-agent-title {
  color: #f8fafc !important;
}

body.dark-theme .fb-agent-listings-item {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-agent-listings-item div[style*="font-weight: 800; font-size: 0.78rem;"] {
  color: #f8fafc !important;
}

body.dark-theme #fbAgentListingsModal div[style*="font-weight: 800; font-size: 0.85rem;"] {
  color: #f8fafc !important;
}

/* ==========================================================================
   FACEBOOK PROPERTY FORM MODAL (LIGHT & DARK THEME ENGINE)
   ========================================================================== */
.fb-prop-modal-card {
  max-width: 620px;
  width: 95%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.fb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}

.fb-modal-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
  margin: 0;
}

.fb-form-label {
  font-weight: 700;
  font-size: 0.8rem;
  color: #334155;
  margin-bottom: 4px;
  display: block;
}

.fb-form-input,
.fb-form-select,
.fb-form-textarea {
  width: 100%;
  border-radius: 8px;
  font-size: 0.84rem;
  height: 38px;
  border: 1.5px solid #cbd5e1;
  padding: 6px 10px;
  box-sizing: border-box;
  font-weight: 600;
  background: #ffffff;
  color: #0f172a;
}

.fb-form-textarea {
  height: auto;
  font-size: 0.82rem;
  padding: 8px;
}

/* Facebook Map Picker Box */
.fb-map-picker-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s ease;
}

.fb-map-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.fb-map-picker-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fb-map-picker-label {
  margin: 0 !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-map-picker-title-text {
  font-weight: 800;
  color: #0f172a;
}

.fb-map-picker-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
}

.fb-map-picker-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fb-map-btn-gps {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.fb-map-btn-gps:hover {
  background: #dcfce7;
}

.fb-map-btn-layer {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.fb-map-btn-layer:hover {
  background: #bae6fd;
}

.fb-map-canvas-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #cbd5e1;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: border-color 0.25s ease;
}

.fb-map-hint-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 999;
  pointer-events: none;
}

.fb-map-inputs-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 6px;
  align-items: center;
}

/* Facebook Photo Upload Box */
.fb-photo-box {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-photo-title {
  font-weight: 800;
  font-size: 0.82rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-photo-subtitle {
  font-size: 0.72rem;
  color: #64748b;
}

.fb-photo-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.fb-photo-preview-box {
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
}

.fb-photo-url-input {
  width: 100%;
  border-radius: 6px;
  font-size: 0.78rem;
  height: 32px;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
}

/* Facebook Agent Section Box */
.fb-agent-section-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-agent-section-title {
  font-weight: 800;
  font-size: 0.84rem;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-selected-agent-card {
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid #38bdf8;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 2px 6px rgba(2,132,199,0.08);
}

.fb-selected-agent-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-agent-search-input {
  width: 100%;
  border-radius: 8px;
  font-size: 0.84rem;
  height: 38px;
  border: 1.5px solid #0284c7;
  padding: 4px 32px 4px 10px;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
  font-weight: 700;
}

.fb-agent-custom-list {
  max-height: 220px;
  overflow-y: auto;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fb-agent-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f1f5f9;
}

.fb-agent-item-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-agent-fields-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

.fb-agent-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
  display: block;
}

.fb-agent-field-input,
.fb-agent-field-select {
  width: 100%;
  border-radius: 6px;
  font-size: 0.8rem;
  height: 34px;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
}

/* --- Dark Theme Overrides for Facebook Property Modal --- */
body.dark-theme .fb-prop-modal-card {
  background: #0f172a !important;
  border: 1.5px solid #1e293b !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8) !important;
}

body.dark-theme .fb-modal-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme .fb-modal-title {
  color: #f8fafc !important;
}

body.dark-theme .fb-form-label {
  color: #cbd5e1 !important;
}

body.dark-theme .fb-form-input,
body.dark-theme .fb-form-select,
body.dark-theme .fb-form-textarea {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme #fbFormPrice {
  color: #38bdf8 !important;
}

body.dark-theme .fb-photo-box {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme .fb-photo-title {
  color: #f8fafc !important;
}

body.dark-theme .fb-photo-subtitle {
  color: #94a3b8 !important;
}

body.dark-theme .fb-photo-dropzone {
  background: #0f172a !important;
  border-color: #334155 !important;
}

body.dark-theme .fb-photo-preview-box {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-photo-url-input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .fb-agent-section-box {
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.22) 0%, #131b2e 100%) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .fb-agent-section-title {
  color: #6ee7b7 !important;
}

body.dark-theme #fbAgentSelectStatusBadge {
  background: rgba(2, 132, 199, 0.25) !important;
  color: #7dd3fc !important;
}

body.dark-theme .fb-selected-agent-card {
  background: #0f172a !important;
  border-color: #0284c7 !important;
}

body.dark-theme .fb-selected-agent-name {
  color: #f8fafc !important;
}

body.dark-theme .fb-agent-search-input {
  background: #0f172a !important;
  border-color: #0284c7 !important;
  color: #f8fafc !important;
}

body.dark-theme .fb-agent-custom-list {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-agent-picker-item {
  border-bottom-color: #1e293b !important;
}

body.dark-theme .fb-agent-picker-item:hover {
  background: #131f37 !important;
}

body.dark-theme .fb-agent-item-name {
  color: #f8fafc !important;
}

body.dark-theme .fb-agent-fields-box {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .fb-agent-field-label {
  color: #94a3b8 !important;
}

body.dark-theme .fb-agent-field-input,
body.dark-theme .fb-agent-field-select {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* --- Dark Mode for Facebook Map Picker Box & Leaflet Map Controls --- */
body.dark-theme .fb-map-picker-box,
body.dark-mode .fb-map-picker-box {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme .fb-map-picker-title-text,
body.dark-mode .fb-map-picker-title-text {
  color: #f8fafc !important;
}

body.dark-theme .fb-map-picker-badge,
body.dark-mode .fb-map-picker-badge {
  color: #38bdf8 !important;
  background: rgba(2, 132, 199, 0.2) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

body.dark-theme .fb-map-btn-gps,
body.dark-mode .fb-map-btn-gps {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .fb-map-btn-gps i,
body.dark-mode .fb-map-btn-gps i {
  color: #34d399 !important;
}

body.dark-theme .fb-map-btn-gps:hover,
body.dark-mode .fb-map-btn-gps:hover {
  background: rgba(16, 185, 129, 0.25) !important;
}

body.dark-theme .fb-map-btn-layer,
body.dark-mode .fb-map-btn-layer {
  background: rgba(2, 132, 199, 0.2) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

body.dark-theme .fb-map-btn-layer:hover,
body.dark-mode .fb-map-btn-layer:hover {
  background: rgba(2, 132, 199, 0.3) !important;
}

body.dark-theme .fb-map-canvas-wrap,
body.dark-mode .fb-map-canvas-wrap {
  border-color: #334155 !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

/* Leaflet Zoom Controls & Panes in Dark Mode */
body.dark-theme #fbPropLeafletMap .leaflet-control-zoom a,
body.dark-theme #propFormLeafletMap .leaflet-control-zoom a,
body.dark-theme .fb-map-picker-box .leaflet-control-zoom a,
body.dark-theme .form-map-picker-box .leaflet-control-zoom a,
body.dark-mode #fbPropLeafletMap .leaflet-control-zoom a,
body.dark-mode #propFormLeafletMap .leaflet-control-zoom a,
body.dark-mode .fb-map-picker-box .leaflet-control-zoom a,
body.dark-mode .form-map-picker-box .leaflet-control-zoom a {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-bottom-color: #334155 !important;
}

body.dark-theme #fbPropLeafletMap .leaflet-control-zoom a:hover,
body.dark-theme #propFormLeafletMap .leaflet-control-zoom a:hover,
body.dark-theme .fb-map-picker-box .leaflet-control-zoom a:hover,
body.dark-theme .form-map-picker-box .leaflet-control-zoom a:hover,
body.dark-mode #fbPropLeafletMap .leaflet-control-zoom a:hover,
body.dark-mode #propFormLeafletMap .leaflet-control-zoom a:hover,
body.dark-mode .fb-map-picker-box .leaflet-control-zoom a:hover,
body.dark-mode .form-map-picker-box .leaflet-control-zoom a:hover {
  background-color: #334155 !important;
  color: #38bdf8 !important;
}

body.dark-theme #fbPropLeafletMap .leaflet-bar,
body.dark-theme #propFormLeafletMap .leaflet-bar,
body.dark-theme .fb-map-picker-box .leaflet-bar,
body.dark-theme .form-map-picker-box .leaflet-bar,
body.dark-mode #fbPropLeafletMap .leaflet-bar,
body.dark-mode #propFormLeafletMap .leaflet-bar,
body.dark-mode .fb-map-picker-box .leaflet-bar,
body.dark-mode .form-map-picker-box .leaflet-bar {
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   OWNERS & CONTACTS DIRECTORY (LIGHT & DARK THEME ENGINE)
   ========================================================================== */
.owners-header-title {
  color: #0f172a;
}

.owners-stat-pill {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.owners-stat-total {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.owners-stat-vip {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.owners-stat-props {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.owners-stat-val {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-weight: 900;
}

.owners-toolbar {
  border-radius: 14px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.owners-search-input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 44px !important;
  padding-left: 44px !important;
  padding-right: 42px !important;
  border-radius: 10px;
  border: 1.5px solid #0284c7;
  background: #f0f9ff;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  box-sizing: border-box;
  outline: none;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.10);
}

.owners-select {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.80rem;
  height: 38px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
}

.owners-view-toggle {
  display: flex;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  flex-shrink: 0;
}

.owner-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  min-width: 0;
}

.owner-card.vip {
  border-color: #fbbf24;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.12);
}

.owner-card-name {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-phone-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 5px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.owner-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #047857;
  font-weight: 800;
  font-size: 0.76rem;
  background: #ecfdf5;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #a7f3d0;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.owner-btn-copy {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 0.68rem;
  cursor: pointer;
}

.owner-btn-edit-tag {
  padding: 6px 8px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.owner-loc-chip {
  background: #f1f5f9;
  color: #334155;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.owners-table-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.owners-table-card thead {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
}

.owners-table-card tbody tr {
  border-bottom: 1px solid #f1f5f9;
}

.contacts-pagination-bar {
  margin-top: 18px;
  padding: 12px 14px;
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* --- Dark Theme Overrides for Owners & Contacts --- */
body.dark-theme .owners-header-title {
  color: #f8fafc !important;
}

body.dark-theme .owners-stat-total {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .owners-stat-vip {
  background: rgba(245, 158, 11, 0.18) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2) !important;
}

body.dark-theme .owners-stat-props {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #38bdf8 !important;
  border-color: rgba(6, 182, 212, 0.35) !important;
}

body.dark-theme .owners-stat-val {
  background: #131b2e !important;
  color: #6ee7b7 !important;
  border-color: #334155 !important;
}

body.dark-theme .owners-toolbar {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .owners-search-input {
  background: #131b2e !important;
  border-color: #0284c7 !important;
  color: #f8fafc !important;
  padding-left: 44px !important;
  padding-right: 42px !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

body.dark-theme .owners-search-input::placeholder {
  color: #64748b !important;
}

body.dark-theme .owners-select {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .owners-view-toggle {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme .owner-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .owner-card.vip {
  border-color: #f59e0b !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.18) !important;
}

body.dark-theme .owner-card-name {
  color: #f8fafc !important;
}

body.dark-theme .owner-phone-bar {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .owner-phone-link {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .owner-btn-copy {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

body.dark-theme .owner-btn-edit-tag {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .owner-loc-chip {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

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

body.dark-theme .owners-table-card thead {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

body.dark-theme .owners-table-card tbody tr {
  border-bottom-color: #1e293b !important;
}

body.dark-theme .owners-table-card tbody tr:hover {
  background: #131f37 !important;
}

body.dark-theme .contacts-pagination-bar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .contacts-pagination-bar button.btn {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .contacts-pagination-bar select {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   PORTFOLIO & EDIT META MODAL THEME ENGINE
   ========================================================================== */
#contactPortfolioModal,
.modal-overlay#contactPortfolioModal {
  z-index: 10000060 !important;
}

#adminViewPropertyModal,
.modal-overlay#adminViewPropertyModal {
  z-index: 10000080 !important;
}

#editContactMetaModal,
.modal-overlay#editContactMetaModal {
  z-index: 10000090 !important;
}

.portfolio-modal-card {
  max-width: 960px;
  width: 96%;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}

.portfolio-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(90vh - 130px);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portfolio-kpi-card {
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
}

.portfolio-kpi-card.kpi-total {
  background: #ffffff;
  border-color: #e2e8f0;
}

.portfolio-kpi-card.kpi-val {
  background: #ffffff;
  border-color: #e2e8f0;
}

.portfolio-kpi-card.kpi-official {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.portfolio-kpi-card.kpi-research {
  background: #f3e8ff;
  border-color: #e9d5ff;
}

.portfolio-kpi-card.kpi-fb {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.portfolio-kpi-card.kpi-sub {
  background: #fff7ed;
  border-color: #fed7aa;
}

.portfolio-comms-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.portfolio-comms-title {
  font-size: 0.80rem;
  font-weight: 800;
  color: #334155;
}

.portfolio-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
}

.portfolio-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.portfolio-prop-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  min-width: 0;
  transition: transform 0.2s;
}

.portfolio-prop-phone-strip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 3px 6px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.portfolio-prop-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.9rem;
}

.portfolio-prop-location {
  font-size: 0.65rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-prop-btn-inspect {
  flex: 1;
  font-size: 0.70rem;
  font-weight: 800;
  padding: 4px 5px;
  border-radius: 5px;
  justify-content: center;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.portfolio-prop-btn-delete {
  padding: 4px 8px;
  font-size: 0.70rem;
  font-weight: 800;
  border-radius: 5px;
  justify-content: center;
  background: #fff5f5;
  color: #ef4444;
  border: 1px solid #fecaca;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.portfolio-modal-footer {
  padding: 10px 18px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portfolio-edit-meta-btn {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

/* Edit Contact Meta Modal */
.edit-meta-card {
  max-width: 480px;
  width: 100%;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.edit-meta-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
  display: block;
}

.edit-meta-input,
.edit-meta-textarea {
  width: 100%;
  height: 38px;
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
}

.edit-meta-textarea {
  height: auto;
  padding: 8px 10px;
}

/* --- Dark Theme Overrides for Portfolio & Edit Meta Modals --- */
body.dark-theme .portfolio-modal-card,
body.dark-theme .edit-meta-card {
  background: #0f172a !important;
  border: 1.5px solid #1e293b !important;
  box-shadow: 0 25px 70px rgba(0,0,0,0.8) !important;
}

body.dark-theme .portfolio-modal-body {
  background: #0b1329 !important;
}

body.dark-theme .portfolio-kpi-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .portfolio-kpi-card.kpi-total > div:first-child,
body.dark-theme .portfolio-kpi-card.kpi-val > div:first-child {
  color: #94a3b8 !important;
}

body.dark-theme .portfolio-kpi-card.kpi-official {
  background: rgba(16,185,129,0.15) !important;
  border-color: rgba(16,185,129,0.3) !important;
}

body.dark-theme .portfolio-kpi-card.kpi-research {
  background: rgba(168,85,247,0.15) !important;
  border-color: rgba(168,85,247,0.3) !important;
}

body.dark-theme .portfolio-kpi-card.kpi-fb {
  background: rgba(37,99,235,0.15) !important;
  border-color: rgba(37,99,235,0.3) !important;
}

body.dark-theme .portfolio-kpi-card.kpi-sub {
  background: rgba(234,88,12,0.15) !important;
  border-color: rgba(234,88,12,0.3) !important;
}

body.dark-theme .portfolio-comms-bar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .portfolio-comms-title {
  color: #f8fafc !important;
}

body.dark-theme .portfolio-copy-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .portfolio-section-title {
  color: #f8fafc !important;
}

body.dark-theme .portfolio-prop-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5) !important;
}

body.dark-theme .portfolio-prop-phone-strip {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .portfolio-prop-phone-strip a {
  color: #34d399 !important;
}

body.dark-theme .portfolio-prop-title {
  color: #f8fafc !important;
}

body.dark-theme .portfolio-prop-location {
  color: #94a3b8 !important;
}

body.dark-theme .portfolio-prop-btn-inspect {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .portfolio-prop-btn-delete {
  background: rgba(239,68,68,0.15) !important;
  border-color: rgba(239,68,68,0.3) !important;
  color: #f87171 !important;
}

body.dark-theme .portfolio-modal-footer {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .portfolio-edit-meta-btn {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .edit-meta-label {
  color: #cbd5e1 !important;
}

body.dark-theme .edit-meta-input,
body.dark-theme .edit-meta-textarea {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   APPSHEET & EXCEL / CSV INTEGRATION HUB (THEME ENGINE)
   ========================================================================== */
.appsheet-hero-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  border: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.appsheet-dropzone-card {
  background: #ffffff;
  border: 2px dashed #10b981;
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.appsheet-dropzone-card:hover {
  border-color: #059669;
  transform: translateY(-1px);
}

.appsheet-dropzone-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: #0f172a;
}

.appsheet-dropzone-desc {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0 auto;
  max-width: 540px;
  line-height: 1.5;
}

.appsheet-dropzone-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
}

.appsheet-subnav-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.05);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
}

.appsheet-subnav-btn {
  padding: 9px 18px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: #475569;
  transition: all 0.2s;
}

.appsheet-subnav-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.appsheet-loaded-section {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.appsheet-step-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.appsheet-target-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px 16px;
}

.appsheet-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #334155;
}

.appsheet-map-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.appsheet-map-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.appsheet-map-select {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
}

.appsheet-preview-table-wrap {
  overflow-x: auto;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  max-height: 240px;
  margin-bottom: 16px;
}

.appsheet-grid-container {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.appsheet-grid-batch-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.appsheet-grid-table-wrap {
  overflow-x: auto;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  max-height: 520px;
}

.appsheet-livesync-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Dark Theme Overrides for AppSheet & Excel Hub --- */
body.dark-theme .appsheet-hero-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
}

body.dark-theme .appsheet-hero-card h1 {
  color: #f8fafc !important;
}

body.dark-theme .appsheet-hero-card p {
  color: #94a3b8 !important;
}

body.dark-theme .appsheet-hero-card div[style*="background: #ecfdf5;"] {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
}

body.dark-theme .appsheet-hero-card span[style*="background: #ecfdf5;"] {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #6ee7b7 !important;
}

body.dark-theme .appsheet-hero-card button[onclick*="exportCurrentDataToExcel"] {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

body.dark-theme .appsheet-hero-card button[onclick*="exportCurrentDataToExcel"]:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #6ee7b7 !important;
}

body.dark-theme .appsheet-dropzone-card {
  background: #131b2e !important;
  border-color: #10b981 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
}

body.dark-theme .appsheet-dropzone-title {
  color: #f8fafc !important;
}

body.dark-theme .appsheet-dropzone-desc {
  color: #94a3b8 !important;
}

body.dark-theme .appsheet-dropzone-icon {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
}

body.dark-theme .appsheet-subnav-bar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-subnav-btn {
  color: #94a3b8 !important;
  background: transparent !important;
}

body.dark-theme .appsheet-subnav-btn.active {
  background: #1e293b !important;
  color: #f8fafc !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

body.dark-theme .appsheet-loaded-section {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-step-label {
  color: #cbd5e1 !important;
}

body.dark-theme .appsheet-target-box {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-radio-label {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .appsheet-map-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-map-label {
  color: #cbd5e1 !important;
}

body.dark-theme .appsheet-map-select {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .appsheet-preview-table-wrap {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-preview-table-wrap table thead tr {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .appsheet-preview-table-wrap table tbody tr {
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

body.dark-theme .appsheet-grid-container {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-grid-container input[type="text"] {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .appsheet-grid-batch-bar {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-grid-batch-bar label {
  color: #cbd5e1 !important;
}

body.dark-theme .appsheet-grid-table-wrap {
  border-color: #1e293b !important;
}

body.dark-theme .appsheet-grid-table-wrap table thead tr {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .appsheet-grid-table-wrap table tbody tr {
  border-color: #1e293b !important;
  background: #0f172a !important;
  color: #cbd5e1 !important;
}

body.dark-theme .appsheet-grid-table-wrap table tbody tr td:nth-child(4) {
  color: #f8fafc !important;
}

body.dark-theme .appsheet-livesync-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

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

body.dark-theme .appsheet-livesync-card p {
  color: #94a3b8 !important;
}

body.dark-theme .appsheet-livesync-card input[type="url"],
body.dark-theme .appsheet-livesync-card select {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .appsheet-livesync-card > div:nth-child(2) {
  background: #064e3b !important;
  border-color: #047857 !important;
}

body.dark-theme .appsheet-livesync-card > div:nth-child(2) h4 {
  color: #34d399 !important;
}

body.dark-theme .appsheet-livesync-card > div:nth-child(2) ol {
  color: #d1fae5 !important;
}

/* ==========================================================================
   AI LEADS & CLIENT INQUIRIES CRM (THEME ENGINE)
   ========================================================================== */
.ai-lead-stat-card {
  border-radius: 12px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-lead-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ai-lead-stat-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
}

.ai-lead-stat-val {
  font-size: 1.4rem;
  font-weight: 900;
  margin-top: 4px;
}

.ai-lead-toolbar-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-lead-search-input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  box-sizing: border-box;
  background: #f8fafc;
  color: #0f172a;
}

.ai-lead-filter-btn {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #475569;
  transition: all 0.15s;
}

.ai-lead-empty-card {
  text-align: center;
  padding: 48px 20px;
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px dashed #cbd5e1;
}

.ai-lead-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 12px;
}

.ai-lead-empty-title {
  font-weight: 900;
  font-size: 1.05rem;
  color: #334155;
  margin-bottom: 4px;
}

.ai-lead-empty-desc {
  font-size: 0.8rem;
  color: #64748b;
}

.ai-lead-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  box-sizing: border-box;
}

.ai-lead-name {
  font-weight: 900;
  font-size: 0.94rem;
  color: #0f172a;
  line-height: 1.2;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.ai-lead-prop-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.ai-lead-prop-title {
  font-weight: 800;
  font-size: 0.84rem;
  color: #0f172a;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-lead-footer {
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* AI Leads Header Card & Toolbars */
.ai-leads-header-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  border: 1.5px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.ai-leads-header-title {
  font-size: clamp(0.90rem, 3.6vw, 1.20rem);
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-leads-header-desc {
  color: #64748b;
  font-size: 0.78rem;
  margin: 3px 0 0 0;
  font-weight: 600;
  line-height: 1.35;
}

.ai-leads-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.12);
  flex-shrink: 0;
}

.ai-leads-refresh-btn {
  color: #334155;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  font-weight: 800;
}

.ai-leads-category-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.ai-leads-view-toggle {
  display: inline-flex;
  align-items: center;
  background: #e2e8f0;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.25s ease;
}

.agent-leaderboard-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.agent-leaderboard-card h3 {
  font-size: 0.96rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
}

.agent-leaderboard-card p {
  font-size: 0.74rem;
  color: #64748b;
  margin: 2px 0 0 0;
  font-weight: 600;
}

/* --- Dark Theme Overrides for AI Leads CRM --- */
body.dark-theme .ai-leads-header-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .ai-leads-header-title {
  color: #f8fafc !important;
}

body.dark-theme .ai-leads-header-desc {
  color: #94a3b8 !important;
}

body.dark-theme .ai-leads-header-icon {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
}

body.dark-theme .ai-leads-refresh-btn {
  background: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-theme .ai-leads-category-bar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .ai-leads-view-toggle {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
}

body.dark-theme .ai-lead-stat-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

body.dark-theme .ai-lead-stat-title {
  color: #94a3b8 !important;
}

body.dark-theme .ai-lead-stat-val {
  color: #f8fafc !important;
}

body.dark-theme .ai-lead-toolbar-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3) !important;
}

body.dark-theme .ai-lead-search-input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .ai-lead-filter-btn {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.dark-theme .ai-lead-empty-card {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme .ai-lead-empty-icon {
  background: #0f172a !important;
  color: #64748b !important;
}

body.dark-theme .ai-lead-empty-title {
  color: #f8fafc !important;
}

body.dark-theme .ai-lead-empty-desc {
  color: #94a3b8 !important;
}

body.dark-theme .ai-lead-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

body.dark-theme .ai-lead-name {
  color: #f8fafc !important;
}

body.dark-theme .ai-lead-prop-box {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .ai-lead-prop-title {
  color: #f8fafc !important;
}

body.dark-theme .ai-lead-footer {
  border-top-color: #1e293b !important;
}

body.dark-theme .ai-lead-bubble-ai {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fef3c7 !important;
}

body.dark-theme .ai-lead-bubble-direct {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #d1fae5 !important;
}

body.dark-theme .ai-lead-bubble-agent {
  background: rgba(2, 132, 199, 0.15) !important;
  color: #e0f2fe !important;
}

body.dark-theme .agent-leaderboard-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

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

body.dark-theme .agent-leaderboard-card p {
  color: #94a3b8 !important;
}

body.dark-theme .agent-leaderboard-card .leaderboard-icon-wrap {
  background: rgba(2, 132, 199, 0.15) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
}

body.dark-theme .agent-leaderboard-card .leaderboard-total-badge {
  background: rgba(2, 132, 199, 0.2) !important;
  color: #38bdf8 !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
}

body.dark-theme .agent-leaderboard-item-name {
  color: #f8fafc !important;
}

body.dark-theme .agent-leaderboard-item-sub {
  color: #94a3b8 !important;
}

body.dark-theme .ai-lead-badge-neutral {
  background: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-theme .ai-lead-action-link-telegram {
  background: rgba(2, 132, 199, 0.15) !important;
  color: #38bdf8 !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
}

body.dark-theme .ai-lead-action-link-phone {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

body.dark-theme .ai-lead-action-btn-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

body.dark-theme .ai-leads-table-container {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

body.dark-theme .ai-leads-table-header {
  background: #0f172a !important;
  border-bottom-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .ai-leads-table-header span {
  color: #f8fafc !important;
}

body.dark-theme .ai-leads-table-header .table-info {
  color: #94a3b8 !important;
}

body.dark-theme .ai-leads-table thead tr {
  background: #0b1120 !important;
  border-bottom-color: #1e293b !important;
  color: #94a3b8 !important;
}

body.dark-theme .ai-leads-table tbody tr.row-even {
  background: #131b2e !important;
  border-bottom-color: #1e293b !important;
}

body.dark-theme .ai-leads-table tbody tr.row-odd {
  background: #0f172a !important;
  border-bottom-color: #1e293b !important;
}

body.dark-theme .ai-leads-table tbody tr:hover {
  background: #1e293b !important;
}

body.dark-theme .ai-leads-table td .table-lead-name {
  color: #f8fafc !important;
}

body.dark-theme .ai-leads-table td .table-prop-title {
  color: #f8fafc !important;
}

body.dark-theme .ai-leads-table td .table-muted {
  color: #94a3b8 !important;
}

/* ==========================================================================
   STAFF ACCESS & ROLE MANAGEMENT (STAFF RBAC THEME ENGINE)
   ========================================================================== */
.users-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
}

.users-leaderboard-strip {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: #166534;
}

.user-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1.5px solid var(--border-color, #e2e8f0);
  box-shadow: 0 4px 16px -2px rgba(15,23,42,0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.25s ease;
}

.user-full-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-username-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 1px 6px;
  border-radius: 5px;
  font-family: monospace;
}

.user-props-box {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-contact-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.76rem;
}

.user-action-btn-edit {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  background: #ffffff;
}

.users-action-buttons-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
}

.users-action-buttons-grid .btn {
  width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

.users-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
}

/* Modern Staff Card 2.0 (Luxury Compact Centered Profile) */
.modern-staff-card {
  padding: 14px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
  border: 1.5px solid #e2e8f0 !important;
  position: relative !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.modern-staff-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.09) !important;
}

.modern-staff-card .staff-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.modern-staff-card .staff-avatar-container {
  position: relative;
  width: 58px;
  height: 58px;
  cursor: pointer;
  margin-bottom: 2px;
}

.modern-staff-card .staff-avatar-img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: transform 0.2s ease;
}

.modern-staff-card .staff-avatar-cam {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.modern-staff-card .staff-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modern-staff-card .staff-role-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.modern-staff-card .staff-username {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  font-family: monospace;
}

/* Micro Stats Strip */
.modern-staff-card .staff-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 4px;
}

.modern-staff-card .staff-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modern-staff-card .staff-stat-item.border-x {
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.modern-staff-card .stat-value {
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.1;
}

.modern-staff-card .stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 1px;
}

/* Info Box */
.modern-staff-card .staff-info-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.modern-staff-card .staff-phone-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  padding: 4px 6px;
  color: #15803d;
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modern-staff-card .staff-access-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}

.modern-staff-card .staff-access-pill.superadmin {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.modern-staff-card .staff-access-pill.active {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.modern-staff-card .staff-access-pill:not(.active):not(.superadmin) {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

/* Actions Row */
.modern-staff-card .staff-actions-row {
  display: flex;
  gap: 5px;
  width: 100%;
  margin-top: 2px;
}

.modern-staff-card .staff-btn-edit {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 8px;
  background: #ffffff;
  color: #0284c7;
  border: 1.5px solid #bae6fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.modern-staff-card .staff-btn-props {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 8px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.modern-staff-card .staff-btn-del {
  padding: 6px 9px;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 8px;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fee2e2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Dark theme for modern-staff-card */
body.dark-theme .modern-staff-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

body.dark-theme .modern-staff-card .staff-name {
  color: #f8fafc !important;
}

body.dark-theme .modern-staff-card .staff-username {
  color: #94a3b8 !important;
}

body.dark-theme .modern-staff-card .staff-stats-strip {
  background: #0f172a !important;
  border-color: #334155 !important;
}

body.dark-theme .modern-staff-card .staff-stat-item.border-x {
  border-color: #334155 !important;
}

body.dark-theme .modern-staff-card .staff-stat-item .stat-label {
  color: #94a3b8 !important;
}

/* Contact & Permission Dark Theme Overrides */
body.dark-theme .modern-staff-card .staff-phone-link {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
}

body.dark-theme .modern-staff-card span.staff-phone-link {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #64748b !important;
}

body.dark-theme .modern-staff-card .staff-access-pill.superadmin {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fcd34d !important;
}

body.dark-theme .modern-staff-card .staff-access-pill.active {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #6ee7b7 !important;
}

body.dark-theme .modern-staff-card .staff-access-pill:not(.active):not(.superadmin) {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* Actions Dark Theme Overrides */
body.dark-theme .modern-staff-card .staff-btn-edit {
  background: #0f172a !important;
  border-color: #0369a1 !important;
  color: #38bdf8 !important;
}

body.dark-theme .modern-staff-card .staff-btn-edit:hover {
  background: #0369a1 !important;
  color: #ffffff !important;
}

body.dark-theme .modern-staff-card .staff-btn-del {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
}

body.dark-theme .modern-staff-card .staff-btn-del:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

/* Role Badges Dark Mode */
body.dark-theme .role-badge.superadmin {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: rgba(245, 158, 11, 0.6) !important;
  color: #fcd34d !important;
}

body.dark-theme .role-badge.admin {
  background: rgba(2, 132, 199, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  color: #7dd3fc !important;
}

body.dark-theme .role-badge.agent {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(74, 222, 128, 0.5) !important;
  color: #86efac !important;
}

body.dark-theme .role-badge.editor {
  background: rgba(139, 92, 246, 0.2) !important;
  border-color: rgba(192, 132, 252, 0.5) !important;
  color: #d8b4fe !important;
}

body.dark-theme .modern-staff-card .staff-role-wrap span[style*="background: #e0f2fe;"] {
  background: rgba(2, 132, 199, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

/* --- Dark Theme Overrides for Staff RBAC --- */
body.dark-theme .users-header-title {
  color: #f8fafc !important;
}

body.dark-theme .users-toolbar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme .users-toolbar .btn-outline {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

body.dark-theme .users-leaderboard-strip {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #34d399 !important;
}

body.dark-theme .users-leaderboard-strip strong {
  color: #f8fafc !important;
}

body.dark-theme .users-leaderboard-strip div[style*="background: #fffbeb;"] {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #fbbf24 !important;
}

body.dark-theme .sub-view-toggle {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-theme .user-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

body.dark-theme .user-full-name {
  color: #f8fafc !important;
}

body.dark-theme .user-username-badge {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

body.dark-theme .user-props-box {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #34d399 !important;
}

body.dark-theme .user-props-box span[style*="color: #166534;"] {
  color: #34d399 !important;
}

body.dark-theme .user-props-box span[style*="background: #eff6ff;"] {
  background: rgba(30, 58, 138, 0.3) !important;
  color: #93c5fd !important;
  border-color: #1e3a8a !important;
}

body.dark-theme .user-props-box span[style*="background: #fdf4ff;"] {
  background: rgba(112, 26, 117, 0.3) !important;
  color: #f0abfc !important;
  border-color: #701a75 !important;
}

body.dark-theme .user-props-box span[style*="background: #ecfdf5;"] {
  background: rgba(6, 78, 59, 0.3) !important;
  color: #6ee7b7 !important;
  border-color: #064e3b !important;
}

body.dark-theme .user-card div[style*="background: #fffbeb;"] {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #fbbf24 !important;
}

body.dark-theme .user-card div[style*="background: #f8fafc;"] {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

body.dark-theme .user-card div[style*="background: #ecfdf5;"] {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #34d399 !important;
}

body.dark-theme .user-contact-box {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme .user-contact-box div {
  color: #f8fafc !important;
}

body.dark-theme .user-contact-box a[href^="tel:"] {
  color: #34d399 !important;
}

body.dark-theme .user-contact-box a[href^="mailto:"] {
  color: #38bdf8 !important;
}

body.dark-theme .user-action-btn-edit {
  background: #131b2e !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

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

body.dark-theme .users-table thead tr {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

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

body.dark-theme .users-table tbody tr:hover {
  background: #1e293b !important;
}

body.dark-theme .users-table tbody tr td[style*="color: #0f172a;"] {
  color: #f8fafc !important;
}

body.dark-theme .users-table tbody tr td[style*="color: #475569;"] {
  color: #94a3b8 !important;
}

body.dark-theme .users-table tbody tr td .btn-outline {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme .users-table tbody tr td .btn[style*="background: #f0fdf4;"] {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #6ee7b7 !important;
}

body.dark-theme .sub-view-toggle button.btn.active,
body.dark-theme .sub-view-toggle button#btnUserViewCards[style*="background: #0f172a;"],
body.dark-theme .sub-view-toggle button#btnUserViewTable[style*="background: #0f172a;"] {
  background: #2563eb !important;
  color: #ffffff !important;
}

body.dark-theme #userAvatarModal .modal-card,
body.dark-theme #userModal .modal-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
  box-shadow: 0 25px 70px rgba(0,0,0,0.8) !important;
}

body.dark-theme #userAvatarModal .modal-header,
body.dark-theme #userModal .modal-header {
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme #userAvatarModal .modal-body label[style*="border: 2px dashed"] {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme #userAvatarModal .modal-body label[style*="border: 2px dashed"] span[style*="color: #0f172a;"] {
  color: #f8fafc !important;
}

body.dark-theme #userAvatarModal input[type="url"],
body.dark-theme #userModal input[type="text"],
body.dark-theme #userModal input[type="password"],
body.dark-theme #userModal input[type="tel"],
body.dark-theme #userModal input[type="email"],
body.dark-theme #userModal select {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   NOTIFICATION & TELEGRAM ALERTS MODAL (THEME ENGINE)
   ========================================================================= */
.notif-settings-modal-box {
  max-width: 580px;
  width: 95%;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.notif-settings-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8fafc;
}

.notif-card-push {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.notif-card-telegram {
  background: #ffffff;
  border: 1.5px solid #38bdf8;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(2,132,199,0.06);
}

.notif-card-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.notif-card-desc {
  margin: 0;
  font-size: 0.70rem;
  color: #64748b;
}

.notif-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.notif-tg-guide-box {
  background: #f0f9ff;
  border: 1px dashed #7dd3fc;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.74rem;
  color: #0369a1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-tg-guide-text {
  line-height: 1.4;
  color: #334155;
}

.notif-field-label {
  font-size: 0.74rem;
  font-weight: 800;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.notif-field-hint {
  font-size: 0.68rem;
  color: #64748b;
}

.notif-input {
  height: 38px;
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: monospace;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
}

.notif-tg-pref-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
}

.notif-settings-modal-footer {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

/* --- Dark Theme Overrides for Notification Modal --- */
body.dark-theme #notificationSettingsModal .notif-settings-modal-box {
  background: #0f172a !important;
  border: 1.5px solid #1e293b !important;
  box-shadow: 0 25px 70px rgba(0,0,0,0.85) !important;
}

body.dark-theme #notificationSettingsModal .notif-settings-modal-body {
  background: #0b1120 !important;
}

body.dark-theme #notificationSettingsModal .notif-card-push {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3) !important;
}

body.dark-theme #notificationSettingsModal .notif-card-telegram {
  background: #131b2e !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 16px rgba(2,132,199,0.15) !important;
}

body.dark-theme #notificationSettingsModal .notif-card-title {
  color: #f8fafc !important;
}

body.dark-theme #notificationSettingsModal .notif-card-desc {
  color: #94a3b8 !important;
}

body.dark-theme #notificationSettingsModal .notif-card-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme #notificationSettingsModal .notif-tg-guide-box {
  background: #0c1f38 !important;
  border: 1.5px dashed #0284c7 !important;
  color: #38bdf8 !important;
}

body.dark-theme #notificationSettingsModal .notif-tg-guide-text {
  color: #cbd5e1 !important;
}

body.dark-theme #notificationSettingsModal .notif-tg-guide-text strong {
  color: #f8fafc !important;
}

body.dark-theme #notificationSettingsModal .notif-field-label {
  color: #f8fafc !important;
}

body.dark-theme #notificationSettingsModal .notif-field-hint {
  color: #94a3b8 !important;
}

body.dark-theme #notificationSettingsModal .notif-input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme #notificationSettingsModal .notif-tg-pref-box {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.dark-theme #notificationSettingsModal .notif-tg-pref-box div[style*="text-transform: uppercase;"] {
  color: #94a3b8 !important;
}

body.dark-theme #notificationSettingsModal .notif-settings-modal-footer {
  background: #0f172a !important;
  border-top-color: #1e293b !important;
}

body.dark-theme #notificationSettingsModal .btn-outline {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   ADMIN PROFILE & AGENT PROFILE MODAL (THEME ENGINE)
   ========================================================================== */
.prof-section-card {
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
}

.prof-section-card-identity {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid #10b981;
}

.prof-section-card-exp {
  background: linear-gradient(135deg, #fffcf3 0%, #fef3c7 100%);
  border: 1.5px solid #d97706;
}

.prof-section-card-contact {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #0284c7;
}

.prof-section-card-office {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #64748b;
}

.prof-section-card-history {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
  border: 1.5px solid #7c3aed;
}

.prof-alert-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #38bdf8;
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Dark Theme Overrides for Admin Profile Modal --- */
body.dark-theme #adminProfileModal .modal-card {
  background: #0f172a !important;
  border: 1.5px solid #1e293b !important;
  box-shadow: 0 25px 70px rgba(0,0,0,0.85) !important;
}

body.dark-theme #adminProfileModal .modal-header {
  border-bottom: 1px solid #1e293b !important;
}

body.dark-theme #adminProfileModal .modal-header h3 {
  color: #f8fafc !important;
}

body.dark-theme #adminProfileModal .modal-body {
  background: #0b1120 !important;
}

body.dark-theme #adminProfileModal .prof-section-card-identity {
  background: #131b2e !important;
  border: 1.5px solid #059669 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important;
}

body.dark-theme #adminProfileModal .prof-section-card-identity .owner-header-badge {
  color: #34d399 !important;
}

body.dark-theme #adminProfileModal .prof-section-card-identity .owner-card-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme #adminProfileModal .prof-section-card-exp {
  background: #131b2e !important;
  border: 1.5px solid #d97706 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important;
}

body.dark-theme #adminProfileModal .prof-section-card-exp .owner-header-badge {
  color: #fbbf24 !important;
}

body.dark-theme #adminProfileModal .prof-section-card-exp .owner-card-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme #adminProfileModal .prof-section-card-exp label {
  color: #fbbf24 !important;
}

body.dark-theme #adminProfileModal .prof-section-card-exp div[style*="background: #fff;"] {
  background: #0f172a !important;
  border-color: #334155 !important;
}

body.dark-theme #adminProfileModal .prof-section-card-exp button[style*="background: #fff;"] {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme #adminProfileModal .prof-section-card-contact {
  background: #131b2e !important;
  border: 1.5px solid #0284c7 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important;
}

body.dark-theme #adminProfileModal .prof-section-card-contact .owner-header-badge {
  color: #38bdf8 !important;
}

body.dark-theme #adminProfileModal .prof-section-card-contact .owner-card-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme #adminProfileModal .prof-section-card-office {
  background: #131b2e !important;
  border: 1.5px solid #334155 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important;
}

body.dark-theme #adminProfileModal .prof-section-card-office .owner-header-badge {
  color: #cbd5e1 !important;
}

body.dark-theme #adminProfileModal .prof-section-card-office .owner-card-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme #adminProfileModal .prof-section-card-history {
  background: #131b2e !important;
  border: 1.5px solid #7c3aed !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2) !important;
}

body.dark-theme #adminProfileModal .prof-section-card-history .owner-header-badge {
  color: #c084fc !important;
}

body.dark-theme #adminProfileModal .prof-section-card-history .owner-card-header {
  border-bottom-color: #1e293b !important;
}

body.dark-theme #adminProfileModal .prof-section-card-history div[style*="background: #fff;"] {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

body.dark-theme #adminProfileModal .prof-section-card-history label {
  color: #c084fc !important;
}

body.dark-theme #adminProfileModal .prof-alert-card {
  background: #0c1f38 !important;
  border-color: #0284c7 !important;
}

body.dark-theme #adminProfileModal .prof-alert-card div[style*="color: #0369a1;"] {
  color: #38bdf8 !important;
}

body.dark-theme #adminProfileModal .prof-alert-card div[style*="color: #64748b;"] {
  color: #cbd5e1 !important;
}

body.dark-theme #adminProfileModal label {
  color: #f8fafc !important;
}

body.dark-theme #adminProfileModal input[type="text"],
body.dark-theme #adminProfileModal input[type="number"],
body.dark-theme #adminProfileModal input[type="email"],
body.dark-theme #adminProfileModal select,
body.dark-theme #adminProfileModal textarea {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

body.dark-theme #adminProfileModal .modal-footer {
  background: #0f172a !important;
  border-top-color: #1e293b !important;
}

body.dark-theme #adminProfileModal .btn-outline {
  background: #131b2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* ==========================================================================
   RECYCLE BIN / TRASH CAN (THEME ENGINE)
   ========================================================================== */
.trash-filter-btn {
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 14px;
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trash-filter-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

.trash-empty-card {
  text-align: center;
  padding: 50px 20px;
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px dashed #cbd5e1;
}

.trash-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.trash-empty-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 4px;
}

.trash-empty-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
}

.trash-item-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.trash-item-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 4px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Dark Theme Overrides for Recycle Bin --- */
body.dark-theme .trash-filter-btn {
  background: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-theme .trash-filter-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

body.dark-theme .trash-empty-card {
  background: #131b2e !important;
  border-color: #334155 !important;
}

body.dark-theme .trash-empty-icon {
  background: #0f172a !important;
  color: #64748b !important;
}

body.dark-theme .trash-empty-title {
  color: #f8fafc !important;
}

body.dark-theme .trash-empty-desc {
  color: #94a3b8 !important;
}

body.dark-theme .trash-item-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35) !important;
}

body.dark-theme .trash-item-title {
  color: #f8fafc !important;
}

body.dark-theme .trash-item-card div[style*="border-top: 1px solid"] {
  border-top-color: #1e293b !important;
}

body.dark-theme .trash-item-card div[style*="background: #f8fafc;"] {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #64748b !important;
}

/* Trash Banner & Stat Cards Theme Engine */
.trash-banner-card {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.dark-theme .trash-banner-card {
  background: #131b2e !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}

body.dark-theme .trash-banner-card h2 {
  color: #f8fafc !important;
}

body.dark-theme .trash-banner-card p {
  color: #94a3b8 !important;
}

body.dark-theme .trash-stat-divider {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-theme .trash-stat-total {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
body.dark-theme .trash-stat-total .trash-stat-label {
  color: #fca5a5 !important;
}
body.dark-theme .trash-stat-total .trash-stat-val {
  color: #f87171 !important;
}

body.dark-theme .trash-stat-prop {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}
body.dark-theme .trash-stat-prop .trash-stat-label {
  color: #fcd34d !important;
}
body.dark-theme .trash-stat-prop .trash-stat-val {
  color: #fbbf24 !important;
}

body.dark-theme .trash-stat-research {
  background: rgba(2, 132, 199, 0.15) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
}
body.dark-theme .trash-stat-research .trash-stat-label {
  color: #7dd3fc !important;
}
body.dark-theme .trash-stat-research .trash-stat-val {
  color: #38bdf8 !important;
}

body.dark-theme .trash-stat-sub {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
body.dark-theme .trash-stat-sub .trash-stat-label {
  color: #86efac !important;
}
body.dark-theme .trash-stat-sub .trash-stat-val {
  color: #34d399 !important;
}

body.dark-theme .trash-stat-lead {
  background: rgba(236, 72, 153, 0.15) !important;
  border-color: rgba(236, 72, 153, 0.3) !important;
}
body.dark-theme .trash-stat-lead .trash-stat-label {
  color: #f9a8d4 !important;
}
body.dark-theme .trash-stat-lead .trash-stat-val {
  color: #f472b6 !important;
}

/* ==========================================================================
   ADMIN 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;
}

#coBrokeModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.admin-map-header-bar {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  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-search-row {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  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: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
  font-size: 0.80rem !important;
  font-weight: 600 !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: #0284c7 !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

.admin-map-search-input:focus {
  border-color: #0284c7;
  background: rgba(255, 255, 255, 0.12);
}

.admin-map-chips-row {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  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: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.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;
}

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

.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);
}

/* Floating Layer Switcher on Map */
.admin-map-floating-layer {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: inline-flex;
  gap: 2px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  padding: 3px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.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 Dropdown Attached Directly to "តម្រង" Button */
.admin-map-filter-dropdown-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.admin-map-filter-toggle-btn.dropdown-open {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4) !important;
}

.admin-map-filter-toggle-btn.dropdown-open .admin-map-filter-caret {
  transform: rotate(180deg) !important;
  color: #ffffff !important;
}

.admin-map-filter-dropdown-card {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  width: 520px !important;
  max-width: min(520px, calc(100vw - 20px)) !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.22), 0 4px 16px -2px rgba(15, 23, 42, 0.08) !important;
  z-index: 10050 !important;
  display: none;
  flex-direction: column !important;
  overflow: hidden !important;
  transform-origin: top right !important;
}

.admin-map-filter-dropdown-card.is-open {
  display: flex !important;
  animation: filterDropdownSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.dark-theme .admin-map-filter-dropdown-card {
  background: #0f172a !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

body.dark-theme .admin-map-filter-dropdown-card .admin-filter-drawer-header {
  background: #0f172a !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme .admin-map-filter-dropdown-card .admin-filter-drawer-title {
  color: #f8fafc !important;
}

body.dark-theme .admin-map-filter-dropdown-card .admin-map-drawer-body {
  background: #0b1120 !important;
}

body.dark-theme .admin-map-filter-dropdown-card .admin-filter-field label {
  color: #cbd5e1 !important;
}

body.dark-theme .admin-map-filter-dropdown-card .filter-select {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-theme .admin-map-filter-dropdown-card .filter-select:hover {
  border-color: #38bdf8 !important;
  background: #334155 !important;
}

/* 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;
}

/* 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;
  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;
  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;
  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;
}

/* Custom Property Point Marker (Sleek & Compact Luxury Style) */
.prop-point-wrapper {
  position: relative;
  width: 24px;
  height: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Luxury Teardrop Micro-Point Pin Animations */
@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;
  }
}

.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;
}

.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;
}

.prop-point-price-tag.is-protected {
  border-color: rgba(245, 158, 11, 0.95);
  color: #fef08a;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45), 0 2px 6px rgba(0, 0, 0, 0.45);
}

.prop-point-price-tag.is-my-lead {
  border-color: rgba(16, 185, 129, 0.95);
  color: #6ee7b7;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45), 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   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;
}

/* ==========================================================================
   ANIMATED CLUSTER BUBBLES SYSTEM
   ========================================================================== */
.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 {
  display: none !important;
}

.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: 4px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}
.map-density-pill:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.map-density-pill.pill-very-high {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #fca5a5;
}
.map-density-pill.pill-high {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fde047;
}
.map-density-pill.pill-medium {
  background: rgba(2, 132, 199, 0.22);
  border-color: #0284c7;
  color: #7dd3fc;
}
.map-density-pill.pill-low {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #6ee7b7;
}

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 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
   ========================================================================== */
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;
}

/* ==============================================================================
   ADMIN MAP 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;
}

/* On iOS Devices in Browser Mode */
html.ios-device .admin-map-header-bar {
  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 (Notch & Dynamic Island Avoidance) */
html.ios-standalone .admin-map-header-bar {
  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;
}

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;
}






/* ============================================================
   ADMIN MORE ACTIONS DROPDOWN - Dark/Light Theme Support
   ============================================================ */
#adminMoreActionsDropdown {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e2e8f0;
}
#adminMoreActionsDropdown .dropdown-item {
  color: #e2e8f0 !important;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
#adminMoreActionsDropdown .dropdown-item:hover {
  background: rgba(255,255,255,0.08) !important;
}
#adminMoreActionsDropdown .dropdown-item .di-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}
#adminMoreActionsDropdown .dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 5px 4px;
}

/* Light Theme overrides */
body.light-theme #adminMoreActionsDropdown {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
body.light-theme #adminMoreActionsDropdown .dropdown-item {
  color: #1e293b !important;
}
body.light-theme #adminMoreActionsDropdown .dropdown-item:hover {
  background: rgba(0,0,0,0.05) !important;
}
body.light-theme #adminMoreActionsDropdown .dropdown-divider {
  background: rgba(0,0,0,0.08);
}

/* Fix dropdown text left-align & min-width for long text */
#adminMoreActionsDropdown .dropdown-item span {
  text-align: left !important;
  white-space: nowrap;
  flex: 1;
}
#adminMoreActionsDropdown {
  min-width: 230px !important;
}

/* ==========================================================================
   PREMIUM NAVBAR ICON BUTTONS (Language, Theme, Notification, More Actions)
   Ultra-clear, luxurious jewel-tone aesthetics with perfect contrast in
   both Light & Dark mode.
   ========================================================================== */
#adminFlagLangBtn,
#adminThemeToggleBtn,
#adminHeaderNotifBtn,
#adminMoreActionsBtn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  position: relative !important;
}

#adminFlagLangBtn:hover,
#adminThemeToggleBtn:hover,
#adminHeaderNotifBtn:hover,
#adminMoreActionsBtn:hover {
  transform: translateY(-2px) scale(1.06) !important;
}

#adminFlagLangBtn:active,
#adminThemeToggleBtn:active,
#adminHeaderNotifBtn:active,
#adminMoreActionsBtn:active {
  transform: translateY(0) scale(0.96) !important;
}

/* 🌐 Language Switcher - Royal Ocean Sapphire */
#adminFlagLangBtn {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.2), rgba(2, 132, 199, 0.35)) !important;
  border: 1.5px solid #0284c7 !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}
#adminFlagLangBtn:hover {
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

/* 🌙 Theme Toggle - Imperial Golden Amber */
#adminThemeToggleBtn {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.35)) !important;
  border: 1.5px solid #d97706 !important;
  color: #b45309 !important;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}
#adminThemeToggleBtn:hover {
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
#adminThemeIcon {
  font-size: 0.82rem !important;
  color: #b45309 !important;
  transition: transform 0.3s ease, color 0.3s ease !important;
}

/* 🔔 Notification Bell - Vivid Sunset Coral */
#adminHeaderNotifBtn {
  background: linear-gradient(145deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.35)) !important;
  border: 1.5px solid #ea580c !important;
  color: #c2410c !important;
  box-shadow: 0 3px 10px rgba(234, 88, 12, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}
#adminHeaderNotifBtn:hover {
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
#adminHeaderNotifBtn i {
  font-size: 0.82rem !important;
  color: #c2410c !important;
}

/* ⋮ More Actions - Royal Amethyst */
#adminMoreActionsBtn {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.35)) !important;
  border: 1.5px solid #7c3aed !important;
  color: #6d28d9 !important;
  box-shadow: 0 3px 10px rgba(109, 40, 217, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  font-size: 0.85rem !important;
}
#adminMoreActionsBtn:hover {
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}
#adminMoreActionsBtn i {
  color: #6d28d9 !important;
}

/* -------------------------------------------------------------
   DARK MODE ADAPTATION (Luminous Neon-Jewel Tones for Dark Theme)
   ------------------------------------------------------------- */
body.dark-theme #adminFlagLangBtn {
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.28), rgba(2, 132, 199, 0.45)) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 3px 12px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
body.dark-theme #adminFlagLangBtn:hover {
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

body.dark-theme #adminThemeToggleBtn {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.45)) !important;
  border-color: #fbbf24 !important;
  color: #fbbf24 !important;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
body.dark-theme #adminThemeToggleBtn:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}
body.dark-theme #adminThemeIcon {
  color: #fbbf24 !important;
}

body.dark-theme #adminHeaderNotifBtn {
  background: linear-gradient(145deg, rgba(249, 115, 22, 0.28), rgba(234, 88, 12, 0.45)) !important;
  border-color: #fb923c !important;
  color: #fb923c !important;
  box-shadow: 0 3px 12px rgba(234, 88, 12, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
body.dark-theme #adminHeaderNotifBtn:hover {
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}
body.dark-theme #adminHeaderNotifBtn i {
  color: #fb923c !important;
}

body.dark-theme #adminMoreActionsBtn {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.28), rgba(109, 40, 217, 0.45)) !important;
  border-color: #a78bfa !important;
  color: #c4b5fd !important;
  box-shadow: 0 3px 12px rgba(109, 40, 217, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
body.dark-theme #adminMoreActionsBtn:hover {
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}
body.dark-theme #adminMoreActionsBtn i {
  color: #c4b5fd !important;
}

/* ==========================================================================
   BRAND LOGO & TYPOGRAPHY ENHANCEMENTS
   Large, clear, luxury styling for "ពង្ស អចលនទ្រព្យ ADMIN"
   ========================================================================== */
.navbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
  min-width: max-content !important;
  overflow: visible !important;
}

.navbar-brand img {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  filter: none !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.navbar-brand:hover img {
  transform: scale(1.05) translateY(-1px) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35) !important;
}

.brand-title-styled {
  font-size: 1.0rem !important;
  gap: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  overflow: visible !important;
  text-overflow: clip !important;
  flex-shrink: 0 !important;
}

.brand-title-styled .brand-name-gold {
  color: #f59e0b !important;
  font-size: 1.0rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  display: inline !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

.brand-title-styled .brand-name-adaptive {
  color: #0f172a !important; /* Deep Navy in Light Mode */
  font-size: 1.0rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  display: inline !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-shadow: none !important;
  filter: none !important;
}

body.dark-theme .brand-title-styled .brand-name-adaptive {
  color: #ffffff !important; /* Pure White in Dark Mode */
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
}

.brand-admin-badge {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #b45309 !important;
  border: 1.2px solid #d97706 !important;
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  padding: 1.5px 6px !important;
  border-radius: 99px !important;
  letter-spacing: 0.5px !important;
  line-height: 1.2 !important;
  display: inline-block !important;
}

body.dark-theme .brand-admin-badge {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
  border: 1.2px solid #fbbf24 !important;
}

.brand-sub-styled {
  color: #64748b !important;
  font-size: 0.58rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.4px !important;
}

body.dark-theme .brand-sub-styled {
  color: #94a3b8 !important;
}

@media (max-width: 768px) {
  .navbar-brand img {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    border-radius: 9px !important;
    background: #ffffff !important;
    border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    filter: none !important;
  }
  .brand-title-styled,
  .brand-title-styled .brand-name-gold,
  .brand-title-styled .brand-name-adaptive {
    font-size: 0.92rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .brand-admin-badge {
    font-size: 0.58rem !important;
    padding: 1px 5px !important;
  }
  .brand-sub-styled {
    font-size: 0.52rem !important;
    display: none !important;
  }
  #adminFlagLangBtn,
  #adminThemeToggleBtn,
  #adminHeaderNotifBtn,
  #adminMoreActionsBtn {
    width: 29px !important;
    height: 29px !important;
    min-width: 29px !important;
    max-width: 29px !important;
  }
}

@media (max-width: 380px) {
  .navbar-brand img {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    border-radius: 8px !important;
    border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
  }
  .brand-title-styled,
  .brand-title-styled .brand-name-gold,
  .brand-title-styled .brand-name-adaptive {
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .brand-admin-badge {
    font-size: 0.52rem !important;
    padding: 1px 4px !important;
  }
  #adminFlagLangBtn,
  #adminThemeToggleBtn,
  #adminHeaderNotifBtn,
  #adminMoreActionsBtn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
  }
}

/* ==========================================================================
   DARK THEME: CLIENT PARCELS HUB (គ្រប់គ្រងគំនូសប្លង់ដី)
   ========================================================================== */
body.dark-theme #adminClientParcelsPanel .owner-parcels-group-card,
body.dark-mode #adminClientParcelsPanel .owner-parcels-group-card {
  background: #131b2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme #adminClientParcelsPanel .client-parcel-card,
body.dark-mode #adminClientParcelsPanel .client-parcel-card {
  background: #131b2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-theme #adminClientParcelsPanel input#adminClientParcelsSearchInput,
body.dark-mode #adminClientParcelsPanel input#adminClientParcelsSearchInput {
  background: #0b1120 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme #adminClientParcelsPanel input#adminClientParcelsSearchInput::placeholder,
body.dark-mode #adminClientParcelsPanel input#adminClientParcelsSearchInput::placeholder {
  color: #64748b !important;
}

/* ==========================================================================
   EDIT SUBMISSION MODAL FOOTER & BUTTONS (RESPONSIVE & BALANCED - LIGHT MODE)
   ========================================================================== */
#editSubmissionModal .modal-card {
  max-width: 760px;
  width: 96vw;
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #e2e8f0 !important;
}

#editSubmissionModal .edit-sub-modal-footer {
  background: #ffffff !important;
  border-top: 1.5px solid #e2e8f0 !important;
  padding: 14px 18px !important;
}

#editSubmissionModal .btn-sub-cancel:hover {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

#editSubmissionModal .btn-sub-save:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4) !important;
  transform: translateY(-1px);
}

#editSubmissionModal .btn-sub-approve:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5) !important;
  transform: translateY(-1px);
}


