/* ===========================================================================
   Bản đồ Ranh giới Hành chính Long An - CSS Styling
   Thiết kế giao diện Hiện đại, Glassmorphism, Trực quan, Hỗ trợ AutoScroll
   ========================================================================== */

:root {
  /* Color Palette */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --surface-bg: rgba(255, 255, 255, 0.92);
  --surface-blur: blur(12px);
  --surface-border: rgba(226, 232, 240, 0.8);
  --surface-card: #ffffff;
  --surface-hover: #f8fafc;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.16);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --header-height: 64px;
  --sidebar-width: 400px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background-color: #0b1120;
  line-height: 1.5;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  margin: 0;
  padding: 0;
}

/* Scrollbar Customization - Ưu tiên trải nghiệm cuộn mượt mà */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   Header Navigation (Floating HUD Top Bar - Island UI)
   ========================================================================== */
.app-header {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  height: auto;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  z-index: 1000;
  box-shadow: none;
  pointer-events: none; /* Cho phép tương tác bản đồ xuyên qua khoảng trống ở giữa */
}

/* Đảo nổi thương hiệu (Brand Island) */
.header-brand {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 6px;
  height: 46px;
  min-width: 0;
  width: fit-content;
  max-width: min(500px, calc(100vw - 190px));
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease, gap 0.3s ease;
  overflow: hidden;
  user-select: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.25s ease, max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 440px;
  opacity: 1;
}

.brand-text h1 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.25;
  text-overflow: ellipsis;
  overflow: hidden;
}

.brand-text .subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 400;
  margin: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Nút thu gọn / mở rộng tiêu đề */
.btn-brand-collapse {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
  margin-left: 2px;
}

.btn-brand-collapse i {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-brand-collapse:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Trạng thái thu gọn đảo thương hiệu */
.header-brand.is-collapsed {
  min-width: 0;
  max-width: 82px;
  padding: 5px 6px;
  gap: 6px;
  cursor: pointer;
}

.header-brand.is-collapsed .brand-text {
  max-width: 0;
  width: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.header-brand.is-collapsed .btn-brand-collapse i {
  transform: rotate(180deg);
}

.header-actions {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 250px;
}

.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 36px;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  background-color: rgba(30, 41, 59, 0.75);
  color: #f8fafc;
  outline: none;
  transition: var(--transition-fast);
}

.search-box input::placeholder {
  color: #94a3b8;
}

.search-box input:focus {
  background-color: rgba(30, 41, 59, 0.95);
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 0.85rem;
  pointer-events: none;
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-btn:hover {
  color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  color: #38bdf8;
}

.btn-drawer-toggle {
  height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all var(--transition-fast);
}

.btn-drawer-toggle:hover {
  background: rgba(14, 165, 233, 0.35);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.3);
  transform: translateY(-1px);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  justify-content: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  color: #f8fafc;
  cursor: pointer;
}

.btn-icon-only:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  color: #38bdf8;
}

.mobile-toggle {
  display: none;
}

/* ==========================================================================
   App Layout: Bản đồ tràn viền 100%
   ========================================================================== */
.app-layout {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   Sidebar: Ngăn kéo trượt kính mờ (Floating Drawer Panel)
   ========================================================================== */
.sidebar {
  position: absolute;
  top: 72px;
  left: 16px;
  bottom: 16px;
  width: var(--sidebar-width);
  min-width: 320px;
  max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 950;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.38), 0 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(calc(-100% - 30px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  overflow: hidden;
}

.sidebar.drawer-open,
.sidebar.mobile-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* AutoScroll: Cho phép nội dung dài cuộn thoải mái, không bị đè controls */
  overflow: hidden;
}

.sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  color: #0369a1;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.btn-close-drawer:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Sidebar Sections */
.sidebar-section {
  display: none;
  flex-direction: column;
  flex: 1;
  /* AutoScroll = true: Đảm bảo container nội dung cuộn linh hoạt */
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.sidebar-section.active {
  display: flex;
}

.section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Areas List */
.areas-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Area Card */
.area-card {
  background: var(--surface-card);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.area-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 5px;
  background-color: var(--area-accent, #cbd5e1);
  transition: width var(--transition-fast);
}

.area-card:hover,
.area-card.card-hover-sync {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--area-accent, #0284c7);
}

.area-card:hover::before,
.area-card.card-hover-sync::before {
  width: 7px;
}

.area-card.selected {
  border-color: var(--area-accent, var(--primary-color));
  background-color: #fafbfc;
  box-shadow: 0 0 0 2px var(--area-accent, var(--primary-color)), var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--area-accent, #94a3b8);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--area-accent, #94a3b8);
  flex-shrink: 0;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-muted);
}

.badge-tag.phuong {
  background: #e0f2fe;
  color: #0284c7;
}

.badge-tag.xa {
  background: #f3e8ff;
  color: #7c3aed;
}

.card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.meta-item i {
  font-size: 0.75rem;
  color: var(--text-subtle);
  width: 14px;
  text-align: center;
}

.meta-item strong {
  color: var(--text-main);
  font-weight: 600;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.btn-card-action {
  font-size: 0.775rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid #e2e8f0;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-card-action:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.btn-card-action.primary {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-border);
}

.btn-card-action.primary:hover {
  background: #dbeafe;
}

/* Loading & Empty State */
.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.loading-state i {
  font-size: 1.75rem;
  color: var(--primary-color);
}

.empty-state i {
  font-size: 2rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Detail Panel View (Khi nhấp vào ranh giới)
   ========================================================================== */
.detail-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-back {
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.btn-back:hover {
  background: var(--primary-light);
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Detail Hero Card */
.detail-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.95));
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.detail-hero-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background-color: var(--hero-accent, var(--primary-color));
}

.detail-title-wrapper {
  margin-top: 4px;
}

.detail-type-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  background: #e0f2fe;
  color: #0369a1;
}

.detail-main-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.detail-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Metric Stats Grid */
.detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-label i {
  color: var(--text-subtle);
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.stat-unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

/* Info Section Group */
.info-group {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.info-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.85rem;
  padding-bottom: 8px;
  border-bottom: 1px dashed #f1f5f9;
  gap: 12px;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-key {
  color: var(--text-muted);
  flex-shrink: 0;
}

.info-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* Detail Buttons Row */
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* ==========================================================================
   Map Container & Floating Widgets (100% Fullscreen Layout)
   ========================================================================== */
.map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100%;
  background: #090d16;
}

/* Leaflet Zoom Control Relocation (Phía dưới Floating Header) */
.leaflet-top.leaflet-left {
  top: 72px;
  left: 16px;
}

.leaflet-control-zoom.leaflet-bar {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.leaflet-control-zoom.leaflet-bar a {
  background: rgba(15, 23, 42, 0.85) !important;
  color: #f8fafc !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: var(--transition-fast);
}

.leaflet-control-zoom.leaflet-bar a:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  color: #38bdf8 !important;
}

/* Ẩn Leaflet Attribution Control ở góc dưới bên phải */
.leaflet-bottom.leaflet-right,
.leaflet-control-attribution {
  display: none !important;
}

/* Custom Pane cho Ranh giới Hành chính (Hiển thị nổi đè lên trên các lớp Quy hoạch đất đai) */
.leaflet-adminBoundary-pane {
  z-index: 450 !important;
  pointer-events: none !important;
}

.leaflet-adminBoundary-pane svg path,
.leaflet-adminBoundary-pane path.leaflet-interactive {
  pointer-events: stroke !important;
  stroke-linejoin: round;
  stroke-linecap: round;
  cursor: pointer;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.7));
}

/* Floating Controls (Top Right of Map) */
.map-floating-controls {
  position: absolute;
  top: 72px;
  right: 16px;
  z-index: 850;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

#btnFloatFitAll,
#btnFullscreen,
#btnFitAll,
#btnDetailFitArea,
#btnDetailClearAllLayers,
.header-actions .search-box {
  display: none !important;
}

.floating-btn {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  color: #f8fafc;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.floating-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.floating-btn.active {
  background: rgba(14, 165, 233, 0.22);
  border-color: #0ea5e9;
  color: #38bdf8;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.35);
}

.floating-btn.btn-warning-action:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

#btnTogglePlanning.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
}

.contextual-planning-btn {
  display: none;
  animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.floating-btn.loading {
  opacity: 0.8;
  cursor: wait;
}

/* Dropdown Menu for Basemap */
.control-dropdown {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  padding: 6px;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 950;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.825rem;
  font-weight: 500;
  color: #e2e8f0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
}

.dropdown-item i {
  font-size: 0.85rem;
  color: #94a3b8;
  width: 16px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.dropdown-item.active {
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  font-weight: 600;
}

.dropdown-item.active i {
  color: #38bdf8;
}

/* Legend / Chú giải (Bottom Right of Map) */
.map-legend {
  position: absolute;
  bottom: 5px;
  right: 16px;
  z-index: 800;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  width: 310px;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  transition: var(--transition-fast);
}

.legend-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-icon {
  font-size: 0.7rem;
  color: #94a3b8;
  transition: transform var(--transition-fast);
}

.legend-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}

.legend-body::-webkit-scrollbar {
  width: 5px;
}

.legend-body::-webkit-scrollbar-track {
  background: transparent;
}

.legend-body::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}

.legend-body::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.6);
}

.legend-body.collapsed {
  display: none;
}

/* Điều khiển độ đậm nhạt màu nền 4 ranh giới hành chính */
.legend-opacity-control {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-opacity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legend-opacity-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
}

.opacity-value-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 38px;
  text-align: center;
  letter-spacing: 0.02em;
}

/* Cyber Range Slider */
.cyber-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.2) 0%, rgba(56, 189, 248, 0.8) 100%);
  outline: none;
  margin: 4px 0 6px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cyber-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.cyber-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #0ea5e9;
  box-shadow: 0 0 12px rgba(56, 189, 248, 1);
}

.cyber-range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.cyber-range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #0ea5e9;
}

/* Các nút gán sẵn độ mờ nhanh (Presets) */
.opacity-presets-row {
  display: flex;
  gap: 4px;
  justify-content: space-between;
}

.opacity-preset-btn {
  flex: 1;
  padding: 3px 0;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.opacity-preset-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #f8fafc;
  border-color: rgba(56, 189, 248, 0.4);
}

.opacity-preset-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Biến thể thanh trượt màu vàng cam ấm áp cho các lớp Quy hoạch TP. Tân An */
.planning-opacity-control {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(26, 21, 15, 0.65);
}

.planning-opacity-control .legend-opacity-title svg {
  color: #f59e0b;
}

.planning-opacity-control .opacity-value-badge {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
}

.planning-opacity-control .cyber-range-slider {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.85) 100%);
}

.planning-opacity-control .cyber-range-slider::-webkit-slider-thumb {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.planning-opacity-control .cyber-range-slider::-webkit-slider-thumb:hover {
  background: #ea580c;
  box-shadow: 0 0 12px rgba(245, 158, 11, 1);
}

.planning-opacity-control .cyber-range-slider::-moz-range-thumb {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.planning-opacity-control .cyber-range-slider::-moz-range-thumb:hover {
  background: #ea580c;
}

.planning-opacity-control .opacity-preset-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

.planning-opacity-control .opacity-preset-btn.active {
  background: #d97706;
  color: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.775rem;
  color: #e2e8f0;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.legend-color-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.legend-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 6px 0;
}

.legend-section-title {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fbbf24;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-line-box {
  width: 16px;
  height: 0;
  flex-shrink: 0;
}

.legend-point-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================================================
   Leaflet Custom Popups & Tooltips Styling
   ========================================================================== */
.leaflet-popup-content-wrapper {
  background: var(--surface-bg);
  backdrop-filter: var(--surface-blur);
  -webkit-backdrop-filter: var(--surface-blur);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--surface-border);
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0;
  padding: 14px 16px;
  font-family: inherit;
}

.popup-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.popup-meta {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.popup-btn {
  margin-top: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.popup-btn:hover {
  background: var(--primary-hover);
}

/* Tooltip custom */
.custom-leaflet-tooltip {
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.custom-leaflet-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.85) !important;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .search-box {
    width: 180px;
  }

  .header-brand h1 {
    font-size: 0.85rem;
  }

  .header-brand:not(.is-collapsed) {
    max-width: calc(100vw - 160px);
  }
}

@media (max-width: 600px) {
  .app-header {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .header-brand:not(.is-collapsed) {
    padding: 4px 6px;
    height: 40px;
    max-width: calc(100vw - 68px);
  }

  .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 0.88rem;
  }

  .brand-text .subtitle {
    display: none;
  }

  .brand-text h1 {
    font-size: 0.78rem;
  }

  .btn-brand-collapse {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 0.7rem;
  }

  .btn-drawer-toggle {
    height: 40px;
    padding: 0 12px;
  }

  .btn-drawer-toggle span {
    display: none;
  }

  .sidebar {
    top: 60px;
    left: 10px;
    bottom: 10px;
  }

  .leaflet-top.leaflet-left {
    top: 60px;
    left: 10px;
  }

  .map-floating-controls {
    top: 60px;
    right: 10px;
  }

  .search-box {
    display: none;
  }

  .btn {
    padding: 8px 10px;
  }

  .map-legend {
    display: none;
  }
}

/* ==========================================================================
   Voice / Audio Player Section (Thuyết minh giọng nói)
   ========================================================================== */
.voice-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.voice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #2563eb, #7c3aed);
}

.voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-title-group i {
  color: #2563eb;
  font-size: 1.1rem;
}

.voice-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.voice-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #ede9fe;
  color: #6d28d9;
}

.voice-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.voice-player-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-audio-element {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-md);
  outline: none;
}

.voice-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-voice-speech {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-voice-speech:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.btn-voice-speech.speaking {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.btn-voice-docx {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #2b579a;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-voice-docx:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.voice-notice {
  font-size: 0.725rem;
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.voice-notice i {
  color: #3b82f6;
  margin-top: 1px;
}

/* ==========================================================================
   Planning Documents Section (Tài liệu Quy hoạch PDF)
   ========================================================================== */
.docs-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}

.doc-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.doc-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.doc-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: #fee2e2;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.doc-text-wrapper {
  flex: 1;
  min-width: 0;
}

.doc-badge {
  display: inline-block;
  font-size: 0.675rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.doc-badge.sdd {
  background: #fef3c7;
  color: #b45309;
}

.doc-badge.gt {
  background: #e0e7ff;
  color: #4338ca;
}

.doc-badge.chitiet {
  background: #dcfce7;
  color: #15803d;
}

.doc-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0;
}

.doc-filename {
  font-size: 0.725rem;
  color: var(--text-subtle);
  font-family: monospace;
  margin-top: 2px;
  word-break: break-all;
}

.doc-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.btn-doc-preview {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.775rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-doc-preview:hover {
  background: #dbeafe;
  color: var(--primary-hover);
}

.btn-doc-tab {
  padding: 6px 10px;
  font-size: 0.775rem;
  font-weight: 500;
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.btn-doc-tab:hover {
  background: #f8fafc;
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* ==========================================================================
   PDF Modal Viewer (Khung xem trực tiếp PDF)
   ========================================================================== */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pdf-modal-container {
  position: relative;
  z-index: 2;
  width: 92vw;
  max-width: 1200px;
  height: 88vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pdf-modal-header {
  padding: 12px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pdf-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pdf-modal-icon {
  font-size: 1.6rem;
  color: #ef4444;
  flex-shrink: 0;
}

.pdf-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.pdf-modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-modal-action {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-modal-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
}

.pdf-modal-body {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #525659;
  position: relative;
}

.pdf-modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ========================================================================== */
/* Tour phối cảnh 3D (ảnh kiến trúc nạp theo yêu cầu) */
.tour-hotspot-marker-shell {
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
}

.tour-photo-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 76px;
  height: 72px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  transform-origin: 38px 64px;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.tour-photo-thumb-wrap {
  width: 76px;
  height: 50px;
  border-radius: 8px;
  border: 3px solid #ffffff;
  background: #0f172a;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.tour-photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.tour-photo-tail {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #ffffff;
  margin-top: -1px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
  z-index: 2;
  transition: border-top-color 0.2s ease;
}

.tour-photo-dot {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: #0284c7;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  z-index: 1;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tour-photo-marker:hover {
  transform: translateY(-4px) scale(1.12);
}

.tour-photo-marker:hover .tour-photo-thumb-wrap {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(2, 132, 199, 0.35);
  border-color: #ffffff;
}

.tour-photo-marker:hover .tour-photo-dot {
  background: #0284c7;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.4), 0 2px 8px rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
}

.tour-photo-marker:focus-visible {
  outline: none;
}

.tour-photo-marker:focus-visible .tour-photo-thumb-wrap {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.5);
}

.tour-hotspot-marker {
  position: relative;
  width: 44px;
  height: 44px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  color: #ffffff;
  background: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.6);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.tour-hotspot-marker b {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  padding: 1px 4px;
  color: #0f172a;
  background: #facc15;
  font-size: 0.65rem;
  line-height: 16px;
}

.tour-hotspot-pulse {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(56, 189, 248, 0.9);
  border-radius: inherit;
  animation: tourHotspotPulse 2s ease-out infinite;
  pointer-events: none;
}

@keyframes tourHotspotPulse {
  from { transform: scale(0.72); opacity: 1; }
  to { transform: scale(1.3); opacity: 0; }
}

.tour-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tour-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(8px);
}

.tour-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(1120px, 94vw);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-lightbox-figure {
  margin: 0;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.tour-lightbox-figure img {
  display: block;
  width: 100%;
  height: min(68vh, 720px);
  object-fit: contain;
  background: #020617;
}

.tour-lightbox-caption {
  max-height: 20vh;
  overflow-y: auto;
  padding: 14px 20px;
  color: #e2e8f0;
}

.tour-lightbox-caption p { margin: 0; }
.tour-lightbox-caption h3 { margin: 3px 0 5px; color: #ffffff; font-size: 1.05rem; }
#tourLightboxCounter { color: #7dd3fc; font-size: 0.8rem; font-weight: 700; }
#tourLightboxDescription { color: #cbd5e1; font-size: 0.875rem; }

.tour-lightbox-close,
.tour-lightbox-nav {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.86);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.tour-lightbox-close { top: 10px; right: 10px; }
.tour-lightbox-nav { top: 46%; }
.tour-lightbox-nav.previous { left: -58px; }
.tour-lightbox-nav.next { right: -58px; }

.tour-hotspot-marker:focus-visible,
.tour-lightbox-close:focus-visible,
.tour-lightbox-nav:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .tour-lightbox { padding: 10px; }
  .tour-lightbox-panel { width: 100%; }
  .tour-lightbox-figure img { height: min(62vh, 580px); }
  .tour-lightbox-caption { max-height: 25vh; padding: 12px 16px; }
  .tour-lightbox-nav { top: auto; bottom: 16px; }
  .tour-lightbox-nav.previous { left: 18px; }
  .tour-lightbox-nav.next { right: 18px; }
  .tour-lightbox-close { top: 6px; right: 6px; }
}

#areaDetailMap.leaflet-zoom-low .tour-hotspot-pulse { animation: none; opacity: 0.25; }

@media (prefers-reduced-motion: reduce) {
  .tour-hotspot-pulse { animation: none; opacity: 0.35; }
}

/* ==========================================================================
   Sci-Fi Cyber HUD Callout Markers (Nhãn chỉ đường liên kết công nghệ cao)
   ========================================================================== */
.hud-callout-marker {
  background: transparent !important;
  border: none !important;
  pointer-events: none;
  overflow: visible !important;
}

.hud-callout-container {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: none;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --hud-color: #38bdf8;
  --hud-rgb: 56, 189, 248;
}

/* Radar Ping tại tâm điểm phường xã */
.hud-target-ping {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.hud-ping-wave {
  position: absolute;
  top: -16px;
  left: -16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--hud-rgb), 0.8);
  background: radial-gradient(circle, rgba(var(--hud-rgb), 0.3) 0%, rgba(var(--hud-rgb), 0) 70%);
  animation: hudPingPulse 2.4s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  pointer-events: none;
}

.hud-ping-wave:nth-child(2) {
  animation-delay: 0.8s;
}

.hud-anchor-dot {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid rgb(var(--hud-rgb));
  box-shadow: 0 0 12px rgba(var(--hud-rgb), 0.9), 0 0 20px rgba(var(--hud-rgb), 0.5);
  z-index: 2;
}

@keyframes hudPingPulse {
  0% {
    transform: scale(0.3);
    opacity: 1;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* SVG Leader Line (Đường gập dẫn hướng Sci-Fi) */
.hud-svg-leader {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.hud-leader-glow {
  fill: none;
  stroke: rgba(var(--hud-rgb), 0.4);
  stroke-width: 4px;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: blur(2px);
}

.hud-leader-line {
  fill: none;
  stroke: rgb(var(--hud-rgb));
  stroke-width: 1.8px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 6 3;
  animation: hudDashFlow 16s linear infinite;
  filter: drop-shadow(0 0 4px rgba(var(--hud-rgb), 0.7));
}

@keyframes hudDashFlow {
  to {
    stroke-dashoffset: -100;
  }
}

.hud-leader-terminal {
  fill: rgb(var(--hud-rgb));
  filter: drop-shadow(0 0 6px rgba(var(--hud-rgb), 0.9));
  transition: r 0.2s ease, filter 0.2s ease;
}

/* Hiệu ứng phát sáng tăng cường của SVG Leader Line khi hover hoặc đồng bộ từ bản đồ */
.hud-callout-container.hover-highlight .hud-leader-line,
.hud-callout-container:has(.hud-card:hover) .hud-leader-line {
  stroke-width: 2.6px;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 8px rgba(var(--hud-rgb), 1));
}

.hud-callout-container.hover-highlight .hud-leader-glow,
.hud-callout-container:has(.hud-card:hover) .hud-leader-glow {
  stroke-width: 6px;
  stroke: rgba(var(--hud-rgb), 0.7);
  opacity: 0.85;
}

.hud-callout-container.hover-highlight .hud-leader-terminal,
.hud-callout-container:has(.hud-card:hover) .hud-leader-terminal {
  r: 4.5;
  filter: drop-shadow(0 0 10px rgba(var(--hud-rgb), 1));
}

.hud-callout-container.hover-highlight .hud-anchor-dot,
.hud-callout-container:has(.hud-card:hover) .hud-anchor-dot {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 16px rgb(var(--hud-rgb));
}

/* Cyber Card: Thẻ thông tin công nghệ cao */
.hud-card {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  padding: 8px 14px;
  min-width: 175px;
  background: rgba(11, 19, 43, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(var(--hud-rgb), 0.45);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55),
              0 0 18px rgba(var(--hud-rgb), 0.2),
              inset 0 0 12px rgba(var(--hud-rgb), 0.08);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  user-select: none;
}

/* Góc cắt Cyberpunk phong cách vi mạch */
.hud-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 2px;
  background: rgb(var(--hud-rgb));
  box-shadow: 0 0 8px rgb(var(--hud-rgb));
}

.hud-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 2px;
  background: rgb(var(--hud-rgb));
  box-shadow: 0 0 8px rgb(var(--hud-rgb));
}

.hud-card:hover,
.hud-card.hover-highlight {
  transform: translateY(-3px) scale(1.04);
  border-color: rgba(var(--hud-rgb), 0.95);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7),
              0 0 28px rgba(var(--hud-rgb), 0.55),
              inset 0 0 16px rgba(var(--hud-rgb), 0.18);
  background: rgba(11, 19, 43, 0.96);
}

.hud-card.active {
  border-color: rgb(var(--hud-rgb));
  box-shadow: 0 0 30px rgba(var(--hud-rgb), 0.65),
              inset 0 0 20px rgba(var(--hud-rgb), 0.25);
  background: rgba(11, 19, 43, 0.95);
}

/* Định vị 4 hướng (Quadrants) để không bị đè nhau */
.hud-card.dir-ne {
  left: 115px;
  top: -88px;
}

.hud-card.dir-nw {
  left: -120px;
  transform: translateX(-100%);
  top: -88px;
}

.hud-card.dir-nw:hover,
.hud-card.dir-nw.hover-highlight {
  transform: translateX(-100%) translateY(-3px) scale(1.04);
}

.hud-card.dir-se {
  left: 115px;
  top: 42px;
}

.hud-card.dir-sw {
  left: -115px;
  transform: translateX(-100%);
  top: 42px;
}

.hud-card.dir-sw:hover,
.hud-card.dir-sw.hover-highlight {
  transform: translateX(-100%) translateY(-3px) scale(1.04);
}

/* Nội dung bên trong Cyber Card */
.hud-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hud-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--hud-rgb));
}

.hud-status-blink {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--hud-rgb));
  box-shadow: 0 0 6px rgb(var(--hud-rgb));
  animation: hudStatusBlink 1.5s infinite;
}

@keyframes hudStatusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hud-open-hint {
  font-size: 0.7rem;
  color: #94a3b8;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.hud-card:hover .hud-open-hint,
.hud-card.hover-highlight .hud-open-hint {
  transform: translateX(3px);
  color: #ffffff;
}

.hud-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin: 0;
  text-shadow: 0 0 10px rgba(var(--hud-rgb), 0.4);
}

.hud-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 0.7rem;
  color: #cbd5e1;
}

.hud-metric-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hud-metric-item i {
  font-size: 0.65rem;
  color: rgb(var(--hud-rgb));
}

/* Thẻ HUD Callout dành riêng cho Đồ án Quy hoạch chi tiết (Cyber HUD Planning Card) */
.hud-planning-card {
  min-width: 200px;
  max-width: 250px;
  padding: 10px 14px;
  border-radius: 10px;
}

.hud-planning-card .hud-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.hud-planning-card .hud-desc {
  margin-top: 6px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #94a3b8;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.hud-planning-card:hover .hud-desc,
.hud-planning-card.active .hud-desc {
  color: #e2e8f0;
}

.hud-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-planning-status-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  transition: all 0.2s ease;
}

.hud-planning-status-badge.active {
  background: rgba(var(--hud-rgb), 0.25);
  color: #ffffff;
  border-color: rgb(var(--hud-rgb));
  box-shadow: 0 0 10px rgba(var(--hud-rgb), 0.45);
}

.hud-planning-status-badge.partial {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.hud-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(var(--hud-rgb), 0.35);
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.68rem;
  transition: all 0.2s ease;
}

.hud-zoom-btn:hover {
  background: rgba(var(--hud-rgb), 0.35);
  color: #ffffff;
  border-color: rgb(var(--hud-rgb));
  box-shadow: 0 0 10px rgba(var(--hud-rgb), 0.6);
  transform: scale(1.12);
}

/* Thẻ HUD planning khi đang active (toàn bộ lớp đang mở) */
.hud-planning-card.active {
  border-color: rgb(var(--hud-rgb));
  box-shadow: 0 0 24px rgba(var(--hud-rgb), 0.45), inset 0 0 14px rgba(var(--hud-rgb), 0.2);
  background: rgba(11, 23, 48, 0.96);
}

.hud-planning-card.partial {
  border-color: rgba(var(--hud-rgb), 0.65);
  box-shadow: 0 0 16px rgba(var(--hud-rgb), 0.3);
}

/* Trạng thái ẩn/hiện lớp Callout khi người dùng toggle */
.hud-callouts-hidden .hud-callout-marker {
  display: none !important;
}

/* ==========================================================================
   Planning Master Plan Card & CAD Controls (Đồ án Quy hoạch CAD)
   ========================================================================== */
.planning-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.planning-project-card {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.35) 0%, rgba(255, 255, 255, 0.95) 100%);
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
}

.planning-project-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}

.planning-project-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.planning-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #fef3c7;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}

.planning-title-wrapper {
  flex: 1;
  min-width: 0;
}

.planning-badge {
  display: inline-block;
  font-size: 0.675rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #d97706;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.planning-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0;
}

.planning-subtitle {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.planning-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.planning-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.planning-stat-item i {
  color: #f59e0b;
  width: 14px;
  text-align: center;
}

.planning-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
}

.btn-planning-toggle {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ffffff;
  color: #d97706;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-planning-toggle:hover {
  background: #fef3c7;
  color: #b45309;
}

.btn-planning-toggle.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.btn-planning-toggle.active:hover {
  background: #d97706;
}

.btn-planning-zoom {
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-planning-zoom:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* CAD Elevation Point Tooltip */
.planning-elev-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  color: #ffffff !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-size: 0.725rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  line-height: 1.35 !important;
}

/* Tối ưu hiệu năng: Tắt render tooltip khi mức zoom nhỏ (< 16) để chống lag CPU/GPU */
#areaDetailMap.leaflet-zoom-low .planning-elev-tooltip {
  display: none !important;
}

.planning-elev-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92) !important;
}

.planning-popup .popup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.planning-popup .popup-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.775rem;
}

.planning-popup code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.725rem;
  color: #0f172a;
}

/* ==========================================================================
   Multi-Layer CAD Engineering Accordion & Modern Switches (14 Lớp Hạ tầng)
   ========================================================================== */
.planning-quick-tools {
  display: flex;
  gap: 5px;
  align-items: center;
}

.btn-micro-tool {
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-micro-tool:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-micro-tool.primary {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0284c7;
}

.btn-micro-tool.primary:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.planning-categories-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.category-accordion-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.category-accordion-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.category-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.category-accordion-header:hover {
  background: #f1f5f9;
}

.cat-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.cat-checkbox-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.cat-checkbox-wrapper input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0284c7;
  margin: 0;
}

.cat-icon-box {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.cat-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-header-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.cat-badge {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: #475569;
}

.btn-accordion-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.775rem;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.btn-accordion-toggle:hover {
  color: var(--text-main);
}

.category-accordion-body {
  padding: 6px 8px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.layer-item-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.layer-item-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.layer-item-card.active {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Modern Toggle Switch */
.layer-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.layer-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: var(--transition-fast);
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 13px;
  width: 13px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: var(--transition-fast);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.layer-switch input:checked + .switch-slider {
  background-color: #0284c7;
}

.layer-switch input:checked + .switch-slider:before {
  transform: translateX(15px);
}

.layer-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.layer-top-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.layer-code-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
  flex-shrink: 0;
}

.layer-name {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-spinner {
  color: #0284c7;
  font-size: 0.7rem;
}

.layer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.layer-file-tag {
  font-size: 0.65rem;
  color: #94a3b8;
}

.btn-layer-zoom {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-layer-zoom:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* ==========================================================================
   Full-screen Area Detail Workspace (Modal Bản đồ Chi tiết Toàn Màn Hình)
   Bố cục: Nền Bản đồ con 100% + Panel thông tin nổi bên trái (AutoScroll = true)
   ========================================================================== */
.area-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  background: #090d16;
  animation: fadeIn 0.25s ease-out;
  overflow: hidden;
}

.area-detail-modal.active {
  display: flex;
}

/* Nền bản đồ con toàn màn hình */
.area-detail-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #090d16;
}

/* Nút Đóng Modal Toàn Màn Hình nổi ở góc trên bên phải */
.btn-close-detail-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 25;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 9px 20px;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: var(--transition-fast);
}

.btn-close-detail-modal:hover {
  background: #ef4444;
  border-color: #f87171;
  color: #ffffff;
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 28px rgba(239, 68, 68, 0.45);
}

/* Floating Map Controls trên Bản đồ Con (Góc trên bên phải) */
.detail-map-floating-controls {
  position: absolute;
  top: 72px;
  right: 16px;
  z-index: 20;
  display: flex;
  gap: 10px;
  align-items: center;
}

#btnDetailTogglePlanning {
  display: none !important;
}

#btnDetailTogglePlanning.active {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.5);
}

#btnDetailToggleCallouts.active {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
}

/* =============================================================================
   WIDGET NỔI 3 ĐỒ ÁN QUY HOẠCH PHƯỜNG LONG AN (Cyber Glassmorphism)
   ============================================================================= */
.planning-groups-floating-widget,
#longAnPlanningGroupsWidget {
  display: none !important;
  position: absolute;
  top: 125px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  z-index: 25;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.planning-groups-floating-widget.collapsed {
  width: auto;
  border-radius: var(--radius-md);
}

.planning-groups-floating-widget.collapsed .widget-body {
  display: none !important;
}

.planning-groups-floating-widget.collapsed #longAnWidgetCollapseIcon {
  transform: rotate(180deg);
}

.planning-groups-floating-widget .widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  gap: 10px;
}

.planning-groups-floating-widget .widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.775rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.planning-groups-floating-widget .widget-summary-badge {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  letter-spacing: 0.02em;
}

.planning-groups-floating-widget .widget-btn-collapse {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.planning-groups-floating-widget .widget-btn-collapse:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.planning-groups-floating-widget .widget-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.planning-groups-floating-widget .widget-body::-webkit-scrollbar {
  width: 5px;
}

.planning-groups-floating-widget .widget-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.planning-groups-floating-widget .widget-hint {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
}

.planning-groups-floating-widget .widget-hint i {
  color: #38bdf8;
  flex-shrink: 0;
}

.widget-groups-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.widget-group-card {
  position: relative;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: all 0.22s ease;
}

.widget-group-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.widget-group-card.active {
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.widget-group-card.card-hover-sync {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(var(--hud-rgb, 56, 189, 248), 0.8) !important;
  box-shadow: 0 0 16px rgba(var(--hud-rgb, 56, 189, 248), 0.35), inset 0 0 12px rgba(var(--hud-rgb, 56, 189, 248), 0.15) !important;
  transform: translateX(-4px);
}

.widget-group-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.widget-group-main-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  user-select: none;
}

.widget-group-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  accent-color: var(--group-color, #10b981);
}

.widget-group-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.775rem;
  flex-shrink: 0;
  background: var(--group-bg, rgba(16, 185, 129, 0.15));
  color: var(--group-color, #10b981);
  border: 1px solid var(--group-border, rgba(16, 185, 129, 0.35));
}

.widget-group-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.widget-group-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.25;
}

.widget-group-subname {
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.2;
}

.widget-group-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.widget-group-badge {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  letter-spacing: 0.02em;
  min-width: 48px;
  text-align: center;
}

.widget-group-card.active .widget-group-badge {
  background: var(--group-bg, rgba(16, 185, 129, 0.2));
  border-color: var(--group-border, rgba(16, 185, 129, 0.5));
  color: var(--group-color, #34d399);
}

.widget-group-card.partial .widget-group-badge {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.btn-widget-zoom {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  transition: var(--transition-fast);
}

.btn-widget-zoom:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #38bdf8;
  border-color: #38bdf8;
  transform: scale(1.08);
}

.widget-group-card-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  line-height: 1.35;
  padding-left: 26px;
}

.widget-group-spinner {
  display: none;
  font-size: 0.72rem;
  color: #38bdf8;
  animation: spin 1s linear infinite;
  margin-left: 4px;
}

.widget-footer-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.widget-action-btn {
  flex: 1;
  padding: 7px 6px;
  font-size: 0.725rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.widget-action-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .planning-groups-floating-widget {
    top: 104px;
    right: 10px;
    width: calc(100vw - 20px);
    max-width: 320px;
  }
}

/* Panel thông tin kính mờ nổi bên trái (Left Floating Glassmorphic Panel) - Ẩn theo yêu cầu */
.detail-floating-panel {
  display: none !important;
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 460px;
  max-width: calc(100vw - 32px);
  z-index: 15;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.38), 0 0 1px rgba(0, 0, 0, 0.2);
  flex-direction: column;
  overflow: hidden;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.detail-panel-header {
  padding: 14px 20px;
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.btn-panel-back {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-panel-back:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: var(--primary-color);
  transform: translateX(-2px);
}

.detail-panel-tag {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #e0f2fe;
  color: #0284c7;
}

/* Container cuộn độc lập (Tuân thủ nguyên tắc AutoScroll = true) */
.detail-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

.detail-panel-body > * {
  flex-shrink: 0;
}

.detail-panel-body::-webkit-scrollbar {
  width: 6px;
}

.detail-panel-body::-webkit-scrollbar-track {
  background: #f8fafc;
}

.detail-panel-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.detail-panel-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Chú giải quy hoạch trên bản đồ con (Góc dưới bên phải) - Ẩn theo yêu cầu */
.detail-map-legend {
  display: none !important;
  position: absolute;
  bottom: 20px;
  right: 16px;
  z-index: 20;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  max-width: 300px;
  overflow: hidden;
  transition: var(--transition-fast);
}

/* Responsive cho màn hình nhỏ */
@media (max-width: 768px) {
  .detail-floating-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    height: 56vh;
    border-radius: var(--radius-md);
  }

  .btn-close-detail-modal {
    top: 10px;
    right: 10px;
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .detail-map-floating-controls {
    top: 56px;
    right: 10px;
    gap: 6px;
  }

  .detail-map-legend {
    display: none !important;
  }
}

/* ==========================================================================
   QUY HOẠCH CHUNG TP. TÂN AN (QH05) - MAIN MAP STYLES
   ========================================================================== */

.sidebar-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px 0;
  user-select: none;
}

.sidebar-section-divider::before,
.sidebar-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

.sidebar-section-divider span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
}

.general-planning-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}

.general-planning-card {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.7) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid #c7d2fe;
  border-left: 4px solid #4f46e5;
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
}

.general-planning-card:hover {
  border-color: #818cf8;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.15);
}

.gp-card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.gp-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.gp-card-title-group,
.gp-title-group {
  width: 100%;
  min-width: 0;
}

.gp-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.gp-card-badge,
.gp-tag {
  display: inline-block;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  background: #e0e7ff;
  color: #4338ca;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.gp-card-title,
.gp-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0;
}

.gp-card-subtitle,
.gp-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 3px;
}

.gp-quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(241, 245, 249, 0.65);
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
}

.btn-gp-tool {
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-gp-tool:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-gp-tool.primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.btn-gp-tool.primary:hover {
  background: #4338ca;
  border-color: #4338ca;
}

.main-planning-layers-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.main-planning-layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.main-planning-layer-row:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.main-planning-layer-row.active {
  border-color: #a5b4fc;
  background: #f5f7ff;
}

.main-planning-layer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.main-planning-layer-left input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #4f46e5;
  margin: 0;
  flex-shrink: 0;
}

.main-planning-layer-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.main-planning-layer-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.main-planning-layer-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-planning-layer-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-planning-layer-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
  margin-left: 6px;
}

/* ==========================================================================
   HIỆU ỨNG 3D KHỐI ĐÙN NỔI KHI HOVER QUY HOẠCH (3D ISOMETRIC EXTRUSION HOVER)
   ========================================================================== */

/* Leaflet Custom Pane cho 3D Khối Nổi và Thẻ Nổi */
.leaflet-pane.leaflet-planning3DHover-pane,
.leaflet-pane.leaflet-planning3DHoverPane-pane,
.leaflet-pane.leaflet-detailPlanning3DHover-pane,
.leaflet-pane.leaflet-detailPlanning3DHoverPane-pane {
  pointer-events: none !important;
  z-index: 650;
}

.leaflet-pane.leaflet-planning3DTag-pane,
.leaflet-pane.leaflet-planning3DTagPane-pane,
.leaflet-pane.leaflet-detailPlanning3DTag-pane,
.leaflet-pane.leaflet-detailPlanning3DTagPane-pane {
  pointer-events: none !important;
  z-index: 680 !important;
}

/* 1. Lớp bóng đổ trên mặt đất (Ground Drop Shadow) */
.planning-3d-shadow {
  filter: blur(3px);
  transform-origin: center;
  transition: opacity 0.2s ease-out;
  pointer-events: none;
}

/* 2. Các mặt đứng tường bên (Extruded Side Walls) */
.planning-3d-wall {
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: fill 0.15s ease-out;
  pointer-events: none;
}

/* 3. Nắp đỉnh khối nổi trên cùng (Elevated Top Cap) */
.planning-3d-top-cap {
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* 4. Thẻ thông tin nổi 3D (Floating 3D Badge Tag) */
.planning-3d-div-icon-wrapper {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
  z-index: 9999 !important;
}

.planning-3d-floating-badge {
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: badgePopIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  z-index: 10000;
  white-space: nowrap;
}

@keyframes badgePopIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -85%) scale(0.85);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

/* Thẻ pill chính */
.planning-3d-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--badge-color, #38bdf8);
  border-radius: 20px;
  color: #f8fafc;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(56, 189, 248, 0.3);
}

.planning-3d-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--badge-color, #38bdf8);
  box-shadow: 0 0 8px var(--badge-color, #38bdf8);
  flex-shrink: 0;
}

.planning-3d-badge-icon {
  font-size: 0.8rem;
  color: var(--badge-color, #38bdf8);
  flex-shrink: 0;
}

.planning-3d-badge-title {
  font-size: 0.775rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.planning-3d-badge-tag {
  font-size: 0.675rem;
  font-weight: 600;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #38bdf8;
}

/* Cột chỉ kim ghim xuống nóc khối 3D */
.planning-3d-badge-stem {
  width: 2px;
  height: 12px;
  background: linear-gradient(180deg, var(--badge-color, #38bdf8), rgba(255, 255, 255, 0.8));
  box-shadow: 0 0 6px var(--badge-color, #38bdf8);
}

.planning-3d-badge-pin {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px var(--badge-color, #38bdf8);
  margin-top: -1px;
}


