* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  height: 100dvh;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  width: 100%;
  width: 100dvw;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background-color: #0f172a;
  color: #f8fafc;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

/* =========================================================================
   TẤM CHẮN TAI THỎ / STATUS BAR AN TOÀN TRÊN IOS (IOS TOP NOTCH SHIELD)
========================================================================= */
.safe-top-notch-shield {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: env(safe-area-inset-top, 0px);
  background: #0f172a;
  z-index: 90;
  pointer-events: none;
  display: block;
}

/* Bản đồ toàn màn hình */
#map {
  width: 100%;
  width: 100dvw;
  height: 100%;
  height: 100dvh;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* =========================================================================
   KHUNG ĐIỀU HƯỚNG TRÊN CÙNG (TOP NAVIGATION BAR)
========================================================================= */
.top-nav-bar {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none; /* Cho phép click xuyên qua vùng trống tới bản đồ */
}

.top-nav-bar:focus-within,
body.parcel-suggesting-active .top-nav-bar {
  z-index: 999999 !important;
}

.top-nav-bar > * {
  pointer-events: auto; /* Kích hoạt nhận click cho logo, thanh tìm kiếm và auth */
}

/* =========================================================================
   LOGO THƯƠNG HIỆU TSBĐ.VN (CẠNH DƯỚI GIỮA MÀN HÌNH - BOTTOM CENTER WIDGET)
========================================================================= */
.brand-logo-widget {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100050 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(11, 19, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 5px 14px 5px 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  text-decoration: none;
  overflow: visible;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.brand-logo-widget:hover {
  background: rgba(15, 23, 42, 0.98);
  border-color: #00E65A;
  box-shadow: 0 10px 36px rgba(0, 230, 90, 0.45), 0 0 18px rgba(0, 230, 90, 0.35);
  transform: translateX(-50%) translateY(-2px);
}

.brand-logo-widget:active {
  transform: translateX(-50%) translateY(1px) scale(0.98);
}

/* Hiệu ứng Phản hồi khi Click (Click Animation / Tactile Feedback) */
.brand-logo-widget.logo-clicked {
  animation: logoClickBounceBottom 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: #00E65A;
}

.brand-logo-widget.logo-clicked .brand-logo-icon img {
  animation: logoIconSpinKick 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logoClickBounceBottom {
  0% { transform: translateX(-50%) scale(1); }
  25% { transform: translateX(-50%) scale(0.93) translateY(1px); box-shadow: 0 2px 10px rgba(0, 230, 90, 0.45); }
  55% { transform: translateX(-50%) scale(1.05) translateY(-3px); box-shadow: 0 8px 26px rgba(0, 230, 90, 0.5); }
  100% { transform: translateX(-50%) scale(1) translateY(0); }
}

@keyframes logoIconSpinKick {
  0% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.28) rotate(-8deg); filter: drop-shadow(0 0 18px rgba(0, 230, 90, 0.85)); }
  65% { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Hiệu ứng khi Bản đồ hoặc Dữ liệu đang Nạp (Loading Animation) */
.brand-logo-widget.is-loading {
  border-color: #00E65A;
  box-shadow: 0 0 0 2px rgba(0, 230, 90, 0.45), 0 8px 30px rgba(0, 230, 90, 0.55);
}

.brand-logo-widget.is-loading .brand-logo-icon img {
  animation: logoScalePulse 1.3s ease-in-out infinite alternate;
}

.brand-logo-widget.is-loading .brand-logo-icon::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 230, 90, 0.9);
  box-shadow: 0 0 16px rgba(0, 230, 90, 0.6);
  animation: logoRadarPulseRing 1.5s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
  pointer-events: none;
}

.brand-logo-widget.is-loading .brand-tagline {
  color: #00FF88;
  animation: logoTaglineBreathe 1.2s ease-in-out infinite alternate;
}

@keyframes logoScalePulse {
  0% {
    filter: drop-shadow(0 2px 5px rgba(0, 230, 90, 0.4));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(0, 230, 90, 0.9)) drop-shadow(0 4px 18px rgba(0, 186, 64, 0.65));
    transform: scale(1.1) translateY(-1px);
  }
  100% {
    filter: drop-shadow(0 2px 5px rgba(0, 230, 90, 0.4));
    transform: scale(1);
  }
}

@keyframes logoRadarPulseRing {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  70% {
    opacity: 0.3;
  }
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

@keyframes logoTaglineBreathe {
  0% { opacity: 0.65; }
  100% { opacity: 1; color: #00FF88; text-shadow: 0 0 8px rgba(0, 230, 90, 0.6); }
}

.brand-logo-icon {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.brand-logo-widget:hover .brand-logo-icon {
  transform: scale(1.08);
}

.brand-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(0, 230, 90, 0.55));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.brand-logo-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.brand-name {
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: #F8FAFC;
  display: flex;
  align-items: baseline;
}

.brand-tld {
  color: #00E65A;
  font-weight: 900;
  font-size: 14px;
  margin-left: 1.5px;
  background: linear-gradient(135deg, #00FF88 0%, #00E65A 50%, #00B33C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 4px rgba(0, 230, 90, 0.35));
}

.brand-tagline {
  font-size: 9px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.4px;
  margin-top: 1px;
  text-transform: none;
  transition: color 0.25s ease;
}

/* =========================================================================
   THANH TÌM KIẾM TỌA ĐỘ WGS84 NỔI (FLOATING SEARCH BAR)
========================================================================= */
.coord-search-bar {
  position: relative;
  flex: 0 1 480px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 480px;
  background: rgba(11, 19, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  transition: all 0.25s ease;
}

.coord-search-bar:focus-within {
  background: rgba(15, 23, 42, 0.98);
  border-color: #00BAF2;
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25), 0 10px 36px rgba(0, 0, 0, 0.55);
}

.coord-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00BAF2;
  flex-shrink: 0;
}

.coord-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.coord-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #F8FAFC;
  font-family: inherit;
  padding: 6px 26px 6px 2px;
}

.coord-input::placeholder {
  color: #64748B;
  font-size: 13px;
}

.coord-clear-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(51, 65, 85, 0.8);
  border: none;
  color: #94A3B8;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.coord-clear-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #EF4444;
}

.coord-go-btn {
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
}

.coord-go-btn:hover {
  background: linear-gradient(135deg, #38BDF8, #0284C7);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 186, 242, 0.5);
}

.coord-go-btn:active {
  transform: translateY(0);
}

/* =========================================================================
   TÙY BIẾN DROPDOWN GỢI Ý ĐỊA ĐIỂM GOOGLE PLACES (PAC CONTAINER)
   Kéo độ rộng bằng độ rộng màn hình (kèm lề an toàn & safe area insets)
========================================================================= */
.pac-container {
  left: calc(8px + env(safe-area-inset-left, 0px)) !important;
  right: calc(8px + env(safe-area-inset-right, 0px)) !important;
  width: auto !important;
  max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
  box-sizing: border-box !important;
  background-color: rgba(11, 19, 30, 0.97) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.6), 0 4px 16px -2px rgba(0, 0, 0, 0.4) !important;
  font-family: inherit !important;
  margin-top: 6px !important;
  z-index: 999999 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: calc(100vh - 120px) !important;
  padding: 4px 0 !important;
  pointer-events: auto !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ẨN TRIỆT ĐỂ GOOGLE PLACES DROPDOWN KHI ĐANG HIỂN THỊ GỢI Ý SỐ THỬA - SỐ TỜ */
body.parcel-suggesting-active .pac-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -999999 !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  transform: scale(0) !important;
}

@media (min-width: 769px) {
  .pac-container {
    left: calc(16px + env(safe-area-inset-left, 0px)) !important;
    right: calc(16px + env(safe-area-inset-right, 0px)) !important;
    max-width: calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
  }
}

.pac-container::after {
  padding: 6px 12px !important;
  height: 20px !important;
  background-size: 100px !important;
}

.pac-item {
  padding: 10px 14px !important;
  font-size: 13.5px !important;
  color: #94A3B8 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  line-height: 1.4 !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.pac-item:first-child {
  border-top: none !important;
}

.pac-item:hover,
.pac-item-selected,
.pac-item-selected:hover {
  background-color: rgba(30, 41, 59, 0.85) !important;
  color: #F8FAFC !important;
}

.pac-item .pac-item-query {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #F8FAFC !important;
  padding-right: 4px !important;
  flex-shrink: 0 !important;
}

.pac-item .pac-matched {
  font-weight: 700 !important;
  color: #00BAF2 !important;
}

.pac-icon {
  margin-top: 0 !important;
  margin-right: 2px !important;
  flex-shrink: 0 !important;
  filter: invert(0.8) hue-rotate(180deg) !important;
}

/* =========================================================================
   KHỐI ĐĂNG NHẬP / HỒ SƠ GÓC TRÊN BÊN PHẢI (TOP-RIGHT AUTH WIDGET)
======================================================================== */
.auth-top-widget {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Nút Badge dạng viên thuốc */
.auth-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: rgba(11, 19, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: #F8FAFC;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-pill-btn:hover {
  background: rgba(15, 23, 42, 0.98);
  border-color: #00BAF2;
  box-shadow: 0 10px 36px rgba(0, 186, 242, 0.3), 0 0 12px rgba(0, 186, 242, 0.2);
  transform: translateY(-1px);
}

.auth-pill-btn:active {
  transform: scale(0.97);
}

/* Nút khi chưa đăng nhập */
.auth-btn-login {
  color: #38BDF8;
  background: rgba(11, 19, 30, 0.92);
}
.auth-btn-login:hover {
  background: rgba(0, 186, 242, 0.15);
  border-color: #00BAF2;
  color: #ffffff;
}

.auth-pill-avatar-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 186, 242, 0.15);
  color: #00BAF2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Trạng thái ĐÃ ĐĂNG NHẬP */
.auth-logged-in-wrap {
  position: relative;
}

.auth-btn-profile {
  position: relative;
  padding-left: 20px;
}

.user-online-dot {
  position: absolute;
  left: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.auth-user-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-name-display {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-chevron {
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.auth-logged-in-wrap.open .dropdown-chevron {
  transform: rotate(180deg);
}

/* USER PROFILE DROPDOWN */
.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: rgba(11, 19, 30, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
  animation: fadeInDropdown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logged-in-wrap.open .user-profile-dropdown {
  display: flex;
}

@keyframes fadeInDropdown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}

.dropdown-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.35);
}

.dropdown-user-details {
  overflow: hidden;
}

.dropdown-user-name {
  font-size: 14px;
  font-weight: 700;
  color: #F8FAFC;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-role-tag {
  font-size: 11px;
  font-weight: 600;
  color: #38BDF8;
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.3);
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0;
}

.dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #CBD5E1;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.dropdown-action-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  color: #38BDF8;
}

.dropdown-action-btn.btn-logout-action {
  color: #F87171;
}
.dropdown-action-btn.btn-logout-action:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* =========================================================================
   POPUP MODAL ĐĂNG NHẬP HIỆN ĐẠI (LOGIN MODAL)
========================================================================= */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-modal-overlay.active {
  display: flex;
}

.login-modal-card {
  width: 100%;
  max-width: 380px;
  background: rgba(11, 19, 30, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.login-modal-header {
  padding: 20px 20px 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(0, 186, 242, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-header-icon-wrap.brand-login-icon {
  background: transparent;
  width: 44px;
  height: 44px;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.login-header-icon-wrap.brand-login-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(0, 230, 118, 0.5));
}

.login-header-text h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #F8FAFC;
}

.login-header-text p {
  margin: 3px 0 0 0;
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.4;
}

.close-login-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.close-login-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: #EF4444;
}

.login-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(11, 19, 30, 0.98);
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #CBD5E1;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-inner-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: #64748B;
  pointer-events: none;
}

.login-input-field {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  font-size: 13.5px;
  color: #F8FAFC;
  outline: none;
  background: rgba(30, 41, 59, 0.85);
  transition: all 0.2s ease;
}

.login-input-field:focus {
  background: rgba(15, 23, 42, 0.95);
  border-color: #00BAF2;
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25);
}

.login-error-alert {
  padding: 9px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #F87171;
}

.btn-login-submit {
  padding: 11px;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
  transition: all 0.2s ease;
}

.btn-login-submit:hover {
  background: linear-gradient(135deg, #38BDF8, #0284C7);
  box-shadow: 0 6px 18px rgba(0, 186, 242, 0.5);
}

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


/* =========================================================================
   CỤM ĐIỀU KHIỂN CHÍNH & MENU TỐC HÀNH (GÓC DƯỚI BÊN TRÁI)
========================================================================= */
.main-control-stack {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: calc(20px + env(safe-area-inset-left, 0px));
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none; /* Cho phép chạm/kéo xuyên qua vùng trống tới bản đồ */
}

/* Hàng chứa 2 nút FAB chính: Menu ☰ & GPS 🎯 */
.primary-fab-row {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.primary-fab-row > * {
  pointer-events: auto; /* Nhận tương tác cho 2 nút FAB chính */
}

/* Nút kích hoạt chính (3 gạch ☰) */
.speed-dial-trigger {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(11, 19, 30, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #00BAF2;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.speed-dial-trigger:hover {
  background: rgba(15, 23, 42, 1);
  border-color: #00BAF2;
  box-shadow: 0 10px 36px rgba(0, 186, 242, 0.45), 0 0 16px rgba(0, 186, 242, 0.35);
  transform: scale(1.06);
}

.speed-dial-trigger:active {
  transform: scale(0.95);
}

/* Chuyển đổi icon ☰ sang ✕ mượt mà */
.trigger-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.trigger-icon.icon-hamburger {
  opacity: 1;
  transform: rotate(0deg);
}

.trigger-icon.icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.main-control-stack.open .speed-dial-trigger {
  background: linear-gradient(135deg, #DC2626, #991B1B);
  border-color: #EF4444;
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.main-control-stack.open .trigger-icon.icon-hamburger {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.main-control-stack.open .trigger-icon.icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* NÚT ĐỊNH VỊ GPS FAB (VỊ TRÍ HIỆN TẠI) NẰM TRONG CỤM GÓC TRÁI */
.fab-locate-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(11, 19, 30, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00BAF2;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.fab-locate-btn:hover {
  background: rgba(15, 23, 42, 1);
  color: #38BDF8;
  border-color: #00BAF2;
  transform: scale(1.06);
  box-shadow: 0 10px 36px rgba(0, 186, 242, 0.45), 0 0 16px rgba(0, 186, 242, 0.35);
}

.fab-locate-btn:active {
  transform: scale(0.95);
}

.fab-locate-btn.locating .gps-icon {
  animation: gpsSpin 1.2s linear infinite;
  color: #00BAF2;
}

@keyframes gpsSpin {
  0% { transform: rotate(0deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(0.9); }
  100% { transform: rotate(360deg) scale(1.1); }
}

/* KHUNG CHỨA VÀ ĐỊNH DẠNG NÚT STREET VIEW GỐC CỦA GOOGLE MAPS (PEGMAN) TRONG HÀNG NÚT CHÍNH */
.google-streetview-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  position: relative;
}

/* Nút Pegman Street View nguyên bản do Google tạo ra (.gm-svpc) */
.google-streetview-slot .gm-svpc,
.gm-svpc {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  border-radius: 50% !important;
  background: rgba(11, 19, 30, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: grab !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  overflow: hidden !important;
  z-index: 5 !important;
}

.google-streetview-slot .gm-svpc:hover,
.gm-svpc:hover {
  background: rgba(30, 41, 59, 1) !important;
  border-color: #F97316 !important;
  transform: scale(1.06);
  box-shadow: 0 10px 36px rgba(249, 115, 22, 0.45), 0 0 16px rgba(249, 115, 22, 0.35) !important;
}

.google-streetview-slot .gm-svpc:active,
.gm-svpc:active {
  cursor: grabbing !important;
  transform: scale(0.95);
}

.google-streetview-slot .gm-svpc button,
.google-streetview-slot .gm-svpc .gm-control-active,
.gm-svpc button,
.gm-svpc .gm-control-active {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
}

/* Ẩn triệt để nút điều khiển camera, xoay 3D, nghiêng (tilt), la bàn và các wrapper rỗng của Google Maps */
.gm-camera-control,
.gm-tilt,
.gm-compass,
button[aria-label*="camera" i],
button[aria-label*="điều khiển camera" i],
button[aria-label*="chế độ điều khiển camera" i],
button[title*="camera" i],
button[title*="điều khiển camera" i],
button[title*="chế độ điều khiển camera" i],
button[aria-label*="xoay" i],
button[aria-label*="nghiêng" i],
button[aria-label*="tilt" i],
button[aria-label*="rotate" i],
button[aria-label*="compass" i],
.gm-bundled-control:empty,
.gmnoprint:empty {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* =========================================================================
   KHUNG THẺ NỔI 3 KHỐI GLASSMORPHISM (SPEED DIAL PANEL)
========================================================================= */
.speed-dial-items {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 250px;
  max-width: calc(100vw - 36px);
  max-height: min(500px, calc(100vh - 160px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  background: rgba(11, 19, 30, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform-origin: bottom left;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.speed-dial-items::-webkit-scrollbar {
  width: 4px;
}
.speed-dial-items::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Khi mở menu */
.main-control-stack.open .speed-dial-items {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.main-control-stack:not(.open) .speed-dial-items,
.main-control-stack:not(.open) .speed-dial-items * {
  pointer-events: none !important;
}

/* Tiêu đề tổng của Panel */
.speed-dial-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 6px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.speed-dial-panel-header .panel-header-icon {
  font-size: 13px;
  line-height: 1;
}

.speed-dial-panel-header .panel-header-title {
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.8px;
  color: #00BAF2;
  text-transform: uppercase;
}

/* Từng khối nhóm trong Panel */
.speed-dial-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 5px;
  transition: all 0.2s ease;
}

/* Tự động ẩn nhóm nếu tất cả các nút bên trong bị ẩn (do phân quyền) */
.speed-dial-group:not(:has(.speed-dial-item:not([style*="display: none"]))) {
  display: none !important;
}

/* Tiêu đề của từng nhóm */
.speed-dial-group-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 1px 4px 3px 4px;
}

.speed-dial-group-header .group-header-icon {
  font-size: 12px;
  line-height: 1;
}

.speed-dial-group-header .group-header-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #94A3B8;
  text-transform: uppercase;
}

/* Danh sách nút con bên trong nhóm */
.speed-dial-group-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

/* Từng nút con dạng Compact Row */
.speed-dial-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  color: #94A3B8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  outline: none;
  box-shadow: none !important;
}

.speed-dial-item .item-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.speed-dial-item .item-icon {
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.speed-dial-item .item-label {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Đèn trạng thái LED mặc định (khi TẮT) */
.speed-dial-item .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: none !important;
}

/* Huy hiệu AI / Tiện ích */
.vn2000-ai-pill-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  border-radius: 5px;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

/* Trạng thái TẮT (Inactive / Not Active): TẮT TUYỆT ĐỐI ÁNH SÁNG VIỀN */
.speed-dial-item:not(.active),
.speed-dial-item:not(.active):focus,
.speed-dial-item:not(.active):focus-visible {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #94A3B8;
  outline: none;
  box-shadow: none !important;
}

.speed-dial-item:not(.active) .status-dot {
  background: #475569 !important;
  box-shadow: none !important;
}

/* Khi hover qua nút đang tắt: chỉ sáng nhẹ nền và viền trung tính, TUYỆT ĐỐI KHÔNG phát sáng viền */
.speed-dial-item:not(.active):hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(255, 255, 255, 0.22);
  color: #F1F5F9;
  box-shadow: none !important;
  transform: translateY(-1px);
}

.speed-dial-item:active {
  transform: translateY(0) scale(0.98);
}

/* Hàng chứa nút Quy hoạch và thanh trượt độ xuyên thấu */
.quyhoach-control-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2px;
}

.valuation-control-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.valuation-control-row .item-valuation {
  flex: 1;
}

/* Nút Kính Lúp Tìm Kiếm Dữ Liệu Định Giá Ngân Hàng */
.speed-dial-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 9px;
  background: linear-gradient(135deg, #0072CE 0%, #00BAF2 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.35);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.speed-dial-search-btn:hover {
  background: linear-gradient(135deg, #0284C7 0%, #38BDF8 100%);
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.5);
  transform: scale(1.05);
}

.speed-dial-search-btn:active {
  transform: scale(0.95);
}

.speed-dial-search-btn .search-btn-icon {
  font-size: 13px;
  display: flex;
  align-items: center;
}

.speed-dial-search-btn .search-btn-badge {
  background: #EF4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1.1;
}

/* =========================================================================
   MÀU SẮC CHỦ ĐỀ KHI BẬT (ACTIVE) - PHÁT SÁNG VIỀN NEON RỰC RỠ
   ========================================================================= */

/* 1. Lớp Bản đồ Vệ tinh (Active - Teal / Cyan) */
.speed-dial-item.item-maptype.active {
  background: rgba(20, 184, 166, 0.24);
  border-color: #14B8A6;
  color: #5EEAD4;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.45), inset 0 0 6px rgba(20, 184, 166, 0.15) !important;
}
.speed-dial-item.item-maptype.active .status-dot {
  background: #14B8A6 !important;
  box-shadow: 0 0 8px #14B8A6 !important;
}
.speed-dial-item.item-maptype.active:hover {
  background: rgba(20, 184, 166, 0.32);
  border-color: #2DD4BF;
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.6), inset 0 0 8px rgba(20, 184, 166, 0.2) !important;
}

/* 2. Quy hoạch SDĐ (Active - Electric Sky Blue) */
.speed-dial-item.item-quyhoach.active {
  background: rgba(0, 186, 242, 0.22);
  border-color: #00BAF2;
  color: #38BDF8;
  box-shadow: 0 0 12px rgba(0, 186, 242, 0.45), inset 0 0 6px rgba(0, 186, 242, 0.15) !important;
}
.speed-dial-item.item-quyhoach.active .status-dot {
  background: #00BAF2 !important;
  box-shadow: 0 0 8px #00BAF2 !important;
}
.speed-dial-item.item-quyhoach.active:hover {
  background: rgba(0, 186, 242, 0.3);
  border-color: #38BDF8;
  box-shadow: 0 0 16px rgba(0, 186, 242, 0.6), inset 0 0 8px rgba(0, 186, 242, 0.2) !important;
}

/* 3. Quy hoạch XD (Active - Emerald Teal) */
.speed-dial-item.item-quyhoach-xd.active {
  background: rgba(13, 148, 136, 0.25);
  border-color: #0D9488;
  color: #2DD4BF;
  box-shadow: 0 0 12px rgba(13, 148, 136, 0.45), inset 0 0 6px rgba(13, 148, 136, 0.15) !important;
}
.speed-dial-item.item-quyhoach-xd.active .status-dot {
  background: #0D9488 !important;
  box-shadow: 0 0 8px #0D9488 !important;
}
.speed-dial-item.item-quyhoach-xd.active:hover {
  background: rgba(13, 148, 136, 0.32);
  border-color: #14B8A6;
  box-shadow: 0 0 16px rgba(13, 148, 136, 0.6), inset 0 0 8px rgba(13, 148, 136, 0.2) !important;
}

/* 4. Định giá Ngân hàng (Active - Royal Blue) */
.speed-dial-item.item-valuation.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3B82F6;
  color: #60A5FA;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45), inset 0 0 6px rgba(59, 130, 246, 0.15) !important;
}
.speed-dial-item.item-valuation.active .status-dot {
  background: #3B82F6 !important;
  box-shadow: 0 0 8px #3B82F6 !important;
}
.speed-dial-item.item-valuation.active:hover {
  background: rgba(59, 130, 246, 0.32);
  border-color: #60A5FA;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.6), inset 0 0 8px rgba(59, 130, 246, 0.2) !important;
}

/* 5. Giá tham khảo (Active - Emerald Green) */
.speed-dial-item.item-refprice.active {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10B981;
  color: #34D399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.45), inset 0 0 6px rgba(16, 185, 129, 0.15) !important;
}
.speed-dial-item.item-refprice.active .status-dot {
  background: #10B981 !important;
  box-shadow: 0 0 8px #10B981 !important;
}
.speed-dial-item.item-refprice.active:hover {
  background: rgba(16, 185, 129, 0.32);
  border-color: #34D399;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6), inset 0 0 8px rgba(16, 185, 129, 0.2) !important;
}

/* 6. Tin rao bán (Active - Amber Orange) */
.speed-dial-item.item-market.active {
  background: rgba(249, 115, 22, 0.25);
  border-color: #F97316;
  color: #FB923C;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45), inset 0 0 6px rgba(249, 115, 22, 0.15) !important;
}
.speed-dial-item.item-market.active .status-dot {
  background: #F97316 !important;
  box-shadow: 0 0 8px #F97316 !important;
}
.speed-dial-item.item-market.active:hover {
  background: rgba(249, 115, 22, 0.32);
  border-color: #FB923C;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.6), inset 0 0 8px rgba(249, 115, 22, 0.2) !important;
}

/* 7. Ghim cá nhân (Active - Sky Blue) */
.speed-dial-item.item-custom-pins.active {
  background: rgba(14, 165, 233, 0.25);
  border-color: #0EA5E9;
  color: #38BDF8;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.45), inset 0 0 6px rgba(14, 165, 233, 0.15) !important;
}
.speed-dial-item.item-custom-pins.active .status-dot {
  background: #0EA5E9 !important;
  box-shadow: 0 0 8px #0EA5E9 !important;
}
.speed-dial-item.item-custom-pins.active:hover {
  background: rgba(14, 165, 233, 0.32);
  border-color: #38BDF8;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.6), inset 0 0 8px rgba(14, 165, 233, 0.2) !important;
}

/* 8. Công cụ Thước đo (Active - Neon Cyan) */
.speed-dial-item.item-measure.active {
  background: rgba(6, 182, 212, 0.28);
  border-color: #06B6D4;
  color: #67E8F9;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.45), inset 0 0 6px rgba(6, 182, 212, 0.15) !important;
}
.speed-dial-item.item-measure.active .status-dot {
  background: #06B6D4 !important;
  box-shadow: 0 0 8px #06B6D4 !important;
}
.speed-dial-item.item-measure.active:hover {
  background: rgba(6, 182, 212, 0.35);
  border-color: #22D3EE;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.6), inset 0 0 8px rgba(6, 182, 212, 0.2) !important;
}

/* 9. Công cụ VN-2000 (Action Modal) */
.speed-dial-item.item-vn2000 {
  color: #CBD5E1;
}
.speed-dial-item.item-vn2000:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.4);
  color: #E0E7FF;
  box-shadow: none !important;
}

/* 10. Tra cứu Bảng giá đất Nhà nước (Action Modal) */
.speed-dial-item.item-stateprice {
  color: #CBD5E1;
}
.speed-dial-item.item-stateprice:hover {
  background: rgba(20, 184, 166, 0.2);
  border-color: rgba(45, 212, 191, 0.4);
  color: #CCFBF1;
  box-shadow: none !important;
}

/* =========================================================================
   THANH TRƯỢT ĐỘ TRONG SUỐT LỚP QUY HOẠCH (OPACITY SLIDER)
========================================================================= */
:root {
  --quyhoach-opacity: 0.65;
  --quyhoach-xd-opacity: 0.65;
}

.quyhoach-opacity-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(0, 186, 242, 0.35);
  border-radius: 8px;
  margin-top: 2px;
  width: 100%;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.quyhoach-opacity-container.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Khi menu đóng thì slider cũng ẩn đi */
.main-control-stack:not(.open) .quyhoach-opacity-container {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(12px) !important;
  display: none !important;
}

.quyhoach-opacity-container .opacity-icon {
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  color: #00BAF2;
}

/* Thanh trượt Range thanh mảnh, hiện đại */
.quyhoach-opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  max-width: 120px;
  height: 5px;
  background: rgba(51, 65, 85, 0.9);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
  margin: 0;
  padding: 0;
}

.quyhoach-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #00BAF2;
  box-shadow: 0 0 8px rgba(0, 186, 242, 0.6);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.quyhoach-opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.opacity-val-badge {
  font-size: 10.5px;
  font-weight: 750;
  color: #38BDF8;
  min-width: 28px;
  text-align: right;
}



/* Tile gạch quy hoạch bản đồ (SDĐ & XD) - Tắt hoàn toàn pointer-events & touch-action để không chặn cử chỉ drag bản đồ trên mobile */
.custom-quyhoach-tile,
.custom-quyhoach-xd-tile {
  opacity: var(--quyhoach-opacity, 0.65) !important;
  transition: opacity 0.05s ease;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  touch-action: none !important;
}

.custom-quyhoach-xd-tile {
  opacity: var(--quyhoach-xd-opacity, 0.65) !important;
}

.custom-quyhoach-tile img,
.custom-quyhoach-xd-tile img {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  touch-action: none !important;
}

/* Styling chuyên biệt cho thanh trượt Quy hoạch XD */
#quyHoachXdOpacitySlider::-webkit-slider-thumb {
  background: #0d9488;
  box-shadow: 0 2px 5px rgba(13, 148, 136, 0.45);
}
#quyHoachXdOpacitySlider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #0f766e;
}
#quyHoachXdOpacitySlider::-webkit-slider-thumb:active {
  transform: scale(1.3);
  background: #115e59;
}
#quyHoachXdOpacitySlider::-moz-range-thumb {
  background: #0d9488;
  box-shadow: 0 2px 5px rgba(13, 148, 136, 0.45);
}

#quyHoachXdOpacityValue {
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid rgba(13, 148, 136, 0.25);
}

/* Tile gạch quy hoạch XD */
.custom-quyhoach-xd-tile {
  opacity: var(--quyhoach-xd-opacity, 0.65) !important;
  transition: opacity 0.05s ease;
}


.btn-primary {
  background: linear-gradient(135deg, #00BAF2, #0072CE) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #38BDF8, #0284C7) !important;
  box-shadow: 0 6px 18px rgba(0, 186, 242, 0.5);
}

.btn-locate {
  background: rgba(0, 186, 242, 0.18) !important;
  border-color: rgba(0, 186, 242, 0.35) !important;
  color: #38BDF8 !important;
}

.btn-vn2000 {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  color: #C7D2FE !important;
  font-weight: 600 !important;
}

.btn-vn2000:hover {
  background: rgba(99, 102, 241, 0.32) !important;
  border-color: #818CF8 !important;
}

.btn-market {
  background: rgba(249, 115, 22, 0.18) !important;
  border-color: rgba(249, 115, 22, 0.35) !important;
  color: #FB923C !important;
  margin-top: 4px;
}

.btn-market.active {
  background: rgba(249, 115, 22, 0.3) !important;
  border-color: #F97316 !important;
  color: #FED7AA !important;
}

.status-line {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: #94A3B8;
  padding-top: 4px;
}

/* Khối thông tin bản quyền dưới đáy Menu */
.menu-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  text-align: center;
}

.menu-footer-content {
  font-size: 12px;
  line-height: 1.6;
  color: #94A3B8;
}

.menu-footer-content strong {
  color: #F8FAFC;
}

.menu-footer-content a {
  color: #38BDF8;
  text-decoration: none;
  font-weight: 500;
}

.menu-footer-content a:hover {
  text-decoration: underline;
}

/* =========================================================================
   POPUP MODAL (VN2000 & FORM GIÁ THAM KHẢO)
========================================================================= */
.vn2000-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.vn2000-modal.active {
  display: flex;
}

.vn2000-modal-card {
  background: rgba(11, 19, 30, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.vn2000-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.95);
}

.vn2000-modal-header h4 {
  font-size: 15px;
  color: #F8FAFC;
  margin: 0;
  font-weight: 700;
}

.close-modal-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.close-modal-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: #EF4444;
}

.vn2000-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(11, 19, 30, 0.98);
}

.vn2000-label {
  font-size: 13px;
  font-weight: 600;
  color: #CBD5E1;
}

.vn2000-select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  background: rgba(30, 41, 59, 0.85);
  color: #F8FAFC;
}

.vn2000-textarea {
  width: 100%;
  height: 135px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  line-height: 1.45;
  background: rgba(30, 41, 59, 0.85);
  color: #F8FAFC;
  box-sizing: border-box;
}

.vn2000-textarea:focus, .vn2000-select:focus {
  border-color: #00BAF2;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25);
}

.vn2000-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-convert-vn2000 {
  flex: 1;
  background: linear-gradient(135deg, #00BAF2, #0072CE) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 10px !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
}

.btn-convert-vn2000:hover {
  background: linear-gradient(135deg, #38BDF8, #0284C7) !important;
  box-shadow: 0 6px 18px rgba(0, 186, 242, 0.5);
}

.btn-clear-vn2000 {
  background: rgba(30, 41, 59, 0.85) !important;
  color: #CBD5E1 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  padding: 10px 14px !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.btn-clear-vn2000:hover {
  background: rgba(51, 65, 85, 0.95) !important;
  color: #F8FAFC !important;
}

/* =========================================================================
   AI OCR BÓC TÁCH TỌA ĐỘ VN-2000 TỪ HÌNH ẢNH / CHỤP ẢNH
========================================================================= */
.vn2000-ai-ocr-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(99, 102, 241, 0.5);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  margin-top: 2px;
}

.vn2000-ai-ocr-card.drag-over {
  border-color: #818CF8;
  background: rgba(99, 102, 241, 0.18);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.vn2000-ai-ocr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vn2000-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: #A5B4FC;
}

.vn2000-ai-badge svg {
  color: #818CF8;
}

.vn2000-ai-hint {
  font-size: 11px;
  color: #94A3B8;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vn2000-ocr-actions {
  display: flex;
  gap: 8px;
}

.vn2000-btn-camera,
.vn2000-btn-upload {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.vn2000-btn-camera {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.vn2000-btn-camera:hover {
  background: linear-gradient(135deg, #818CF8, #6366F1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
}

.vn2000-btn-camera:active {
  transform: translateY(1px);
}

.vn2000-btn-upload {
  background: rgba(30, 41, 59, 0.85);
  color: #C7D2FE;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.vn2000-btn-upload:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818CF8;
}

.vn2000-btn-upload:active {
  transform: translateY(1px);
}

.vn2000-ocr-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.vn2000-ocr-preview-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  background: #0f172a;
}

.vn2000-ocr-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vn2000-ocr-scan-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(99, 102, 241, 0.25);
  pointer-events: none;
  overflow: hidden;
}

.vn2000-scan-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #818CF8;
  box-shadow: 0 0 8px #818CF8;
  animation: vn2000ScanLaser 1.4s infinite ease-in-out;
}

@keyframes vn2000ScanLaser {
  0% { top: 0; opacity: 0.8; }
  50% { top: calc(100% - 2px); opacity: 1; }
  100% { top: 0; opacity: 0.8; }
}

.vn2000-ocr-status-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: 6px;
}

.vn2000-ocr-status-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #C7D2FE;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vn2000-ocr-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-top-color: #818CF8;
  border-radius: 50%;
  animation: vn2000Spin 0.75s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes vn2000Spin {
  to { transform: rotate(360deg); }
}

.btn-cancel-ocr {
  background: none;
  border: none;
  font-size: 18px;
  color: #94A3B8;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-cancel-ocr:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.15);
}

/* Khung Cảnh Báo Bảo Mật Thông Tin Cá Nhân VN2000 & Định Giá */
.vn2000-privacy-warning {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
  line-height: 1.45;
  color: #FDE68A;
}

.vn2000-privacy-warning .warning-icon {
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.gemini-privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: #FDE68A;
  margin-top: 6px;
  line-height: 1.4;
}

/* =========================================================================
   POPUP MODAL CẮT VÙNG BẢNG TỌA ĐỘ (INTERACTIVE IMAGE CROPPER)
========================================================================= */
.crop-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10006;
  align-items: center;
  justify-content: center;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.crop-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.crop-modal-card {
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cropModalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cropModalIn {
  from {
    transform: scale(0.94) translateY(12px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
}

.crop-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crop-header-icon {
  font-size: 22px;
  background: rgba(0, 186, 242, 0.15);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00BAF2;
}

.crop-header-left h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #F8FAFC;
}

.crop-header-left p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #94A3B8;
}

.close-crop-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  font-size: 20px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.close-crop-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border-color: #EF4444;
}

/* Banner Cảnh Báo Bảo Mật */
.crop-privacy-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding: 9px 14px;
}

.crop-privacy-banner .shield-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #FBBF24;
}

.privacy-banner-text {
  font-size: 11.5px;
  color: #FDE68A;
  line-height: 1.45;
}

.privacy-banner-text strong {
  color: #FFFFFF;
}

/* Vùng Viewport Crop Stage */
.crop-viewport-wrap {
  position: relative;
  background: #0B131E;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  max-height: 52vh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.crop-stage {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  background: #1E293B;
  touch-action: none;
}

.crop-canvas-backdrop {
  display: block;
  max-width: 100%;
  max-height: 100%;
  user-select: none;
  pointer-events: none;
}

/* Khung Chọn Cắt (Crop Box) */
.crop-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  box-shadow: 0 0 0 9999px rgba(11, 19, 30, 0.78);
  border: 1.5px solid #00BAF2;
  box-sizing: border-box;
  cursor: move;
  touch-action: none;
}

/* Rule of Thirds Grid Lines */
.crop-grid-h1,
.crop-grid-h2,
.crop-grid-v1,
.crop-grid-v2 {
  position: absolute;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.crop-grid-h1 { top: 33.33%; left: 0; right: 0; height: 1px; }
.crop-grid-h2 { top: 66.66%; left: 0; right: 0; height: 1px; }
.crop-grid-v1 { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.crop-grid-v2 { left: 66.66%; top: 0; bottom: 0; width: 1px; }

/* 8 Resize Handles */
.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #00BAF2;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
  z-index: 10;
  touch-action: none;
}

/* Tăng kích thước vùng chạm (hit area) cho điện thoại cảm ứng */
.crop-handle::after {
  content: '';
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
}

.handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.handle-n { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.handle-e { top: calc(50% - 6px); right: -6px; cursor: ew-resize; }
.handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.handle-s { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.handle-w { top: calc(50% - 6px); left: -6px; cursor: ew-resize; }

/* Toolbar */
.crop-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-crop-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #CBD5E1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-crop-tool:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38BDF8;
  color: #F8FAFC;
}

.btn-crop-tool:active {
  transform: translateY(1px);
}

.btn-crop-tool .tool-icon {
  font-size: 13px;
  font-weight: 700;
}

/* Modal Footer */
.crop-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-crop-cancel {
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #CBD5E1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-crop-cancel:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #F8FAFC;
}

.btn-crop-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #00BAF2 0%, #0072CE 100%);
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
  transition: all 0.18s ease;
}

.btn-crop-confirm:hover {
  background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
  box-shadow: 0 6px 18px rgba(0, 186, 242, 0.5);
  transform: translateY(-1px);
}

.btn-crop-confirm:active {
  transform: translateY(1px);
}

/* Khung hiển thị chi tiết thửa đất Guland (InfoWindow) */
.guland-box {
  background: transparent;
  border-radius: 8px;
  margin-top: 8px;
  color: #CBD5E1;
}

.gl-title {
  font-size: 15px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 6px;
}

.gl-address-row {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 13px;
  color: #38BDF8;
  margin-bottom: 4px;
}

.gl-tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-size: 13px;
}

.gl-custom-badge {
  font-weight: 700;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

.gl-badge-sqr {
  background-color: rgba(30, 41, 59, 0.85);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

.gl-sub-title {
  font-weight: 700;
  color: #00BAF2;
  font-size: 13.5px;
  margin: 10px 0 6px 0;
}

.gl-zoning-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 4px;
}

.gl-zoning-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* =========================================================================
   RESPONSIVE CHO THIẾT BỊ DI ĐỘNG & MÀN HÌNH NHỎ
========================================================================= */
@media (max-width: 900px) {
  .brand-tagline {
    display: block;
    font-size: 8.5px;
  }
}

@media (max-width: 600px), (max-height: 650px) {
  .top-nav-bar {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    display: flex;
    align-items: center;
    justify-content: stretch;
    gap: 6px;
  }

  .brand-logo-widget {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    padding: 4px 12px 4px 8px;
    gap: 8px;
    border-radius: 12px;
  }

  .brand-logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 0;
  }

  .brand-name {
    font-size: 14px;
    white-space: nowrap;
  }

  .brand-tld {
    font-size: 12.5px;
  }

  .brand-tagline {
    display: block;
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
  }

  /* Thanh tìm kiếm trên di động rộng rãi toàn bộ chiều ngang */
  .coord-search-bar {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 6px 6px 6px 12px;
    gap: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
  }

  /* Nút Đi đến chỉ hiển thị biểu tượng, ẩn chữ */
  .coord-go-btn span {
    display: none !important;
  }

  .coord-go-btn {
    padding: 7px 10px;
    font-size: 12.5px;
    border-radius: 8px;
    min-width: 36px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Nút Hướng dẫn sử dụng trên di động */
  .top-guide-btn {
    height: 34px !important;
    padding: 7px 10px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
    min-width: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .top-guide-btn .guide-btn-text {
    display: none !important;
  }

  /* Cụm nút Đăng nhập / User chuyển xuống góc phải phía dưới màn hình */
  .auth-top-widget {
    position: fixed !important;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(12px + env(safe-area-inset-right, 0px)) !important;
    top: auto !important;
    left: auto !important;
    margin: 0 !important;
    z-index: 50 !important;
    pointer-events: auto !important;
    flex-shrink: 0;
  }

  .auth-pill-btn {
    padding: 0 14px 0 10px;
    height: 44px;
    font-size: 13px;
    font-weight: 600;
    gap: 7px;
    white-space: nowrap;
    border-radius: 22px;
    background: rgba(11, 19, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #F8FAFC;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .auth-pill-btn:hover {
    background: rgba(15, 23, 42, 0.98);
    border-color: #00BAF2;
    transform: scale(1.04);
    box-shadow: 0 10px 36px rgba(0, 186, 242, 0.35);
  }

  .auth-pill-btn:active {
    transform: scale(0.95);
  }

  .auth-pill-avatar-icon {
    width: 24px;
    height: 24px;
  }

  .user-name-display {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .login-modal-card {
    max-width: 92vw;
  }

  /* Dropdown menu thông tin tài khoản hiển thị dạng pop-up hướng lên trên (drop-up) */
  .user-profile-dropdown {
    top: auto !important;
    bottom: calc(100% + 10px) !important;
    right: 0 !important;
    width: min(250px, 85vw) !important;
    transform-origin: bottom right !important;
    box-shadow: 0 -16px 45px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  }

  .coord-icon svg {
    width: 16px;
    height: 16px;
  }

  .coord-input {
    font-size: 13px;
    padding: 5px 22px 5px 2px;
  }

  .coord-input::placeholder {
    font-size: 12px;
  }

  /* Đẩy cụm nút Bản đồ / Vệ tinh (MapTypeControl) của Google Maps xuống dòng 2 bên trái */
  .gm-style-mtc {
    margin-top: calc(58px + env(safe-area-inset-top, 0px)) !important;
    margin-left: calc(8px + env(safe-area-inset-left, 0px)) !important;
  }

  /* Nút Zoom & StreetView ở góc dưới bên phải được đẩy lên khỏi vùng Home bar an toàn */
  .gm-bundled-control,
  .gm-bundled-control-on-bottom {
    margin-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    margin-right: calc(10px + env(safe-area-inset-right, 0px)) !important;
  }

  .main-control-stack {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    gap: 8px;
  }

  .primary-fab-row {
    gap: 8px;
  }

  .speed-dial-trigger {
    width: 44px;
    height: 44px;
  }

  .fab-locate-btn,
  .google-streetview-slot,
  .google-streetview-slot .gm-svpc,
  .gm-svpc {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .speed-dial-item {
    padding: 7px 12px;
    font-size: 12.5px;
    gap: 6px;
  }

  .speed-dial-item .item-label {
    font-size: 12.5px;
  }

  .quyhoach-opacity-container {
    padding: 5px 8px;
    height: 34px;
    gap: 6px;
  }

  .quyhoach-opacity-slider {
    width: 65px;
  }

  .opacity-val-badge {
    font-size: 10px;
    padding: 1px 4px;
    min-width: 28px;
  }


  .vn2000-modal-card {
    max-width: 95vw;
    margin: 8px;
  }
}

/* =========================================================================
   QUẢN TRỊ VIÊN & QUẢN LÝ PHÂN QUYỀN USER (ADMIN & PERMISSIONS UI)
========================================================================= */

/* Nút Quản lý quyền trong Bảng điều khiển */
.admin-control-group {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.btn-admin-permissions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-admin-permissions:hover {
  background: linear-gradient(135deg, #38BDF8, #0284C7);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 186, 242, 0.5);
}

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

.btn-perm-icon-glow {
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.btn-perm-text {
  flex: 1;
  text-align: left;
}

.admin-shield-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

/* POPUP MODAL PHÂN QUYỀN HIỆN ĐẠI */
.perm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.perm-modal-overlay.active {
  display: flex;
}

.perm-modal-card {
  width: 100%;
  max-width: min(95vw, 1220px);
  height: min(92vh, 850px);
  max-height: min(92vh, 850px);
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: auto;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.perm-modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.perm-header-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 186, 242, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00BAF2;
  flex-shrink: 0;
}

.perm-header-text h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #F8FAFC;
}

.perm-header-text p {
  margin: 3px 0 0 0;
  font-size: 12.5px;
  color: #94A3B8;
}

.close-perm-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.close-perm-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #EF4444;
  color: #EF4444;
}

.perm-modal-body {
  padding: 20px 24px;
  overflow-y: auto !important;
  overflow-x: hidden;
  flex: 1 1 0px !important;
  height: 0 !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(11, 19, 30, 0.98);
}

.perm-modal-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.perm-modal-body::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 4px;
}

.perm-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.perm-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Bảng ma trận phân quyền */
.perm-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  background: rgba(15, 23, 42, 0.9);
}

.perm-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.perm-table-wrap::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 4px;
}

.perm-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.perm-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 186, 242, 0.6);
}

.perm-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13px;
}

.perm-matrix-table thead {
  background: rgba(15, 23, 42, 0.98);
}

.perm-matrix-table th {
  padding: 14px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  vertical-align: middle;
  background: rgba(15, 23, 42, 0.98);
}

.perm-matrix-table th.th-role {
  min-width: 180px;
  width: 180px;
  position: sticky;
  left: 0;
  z-index: 10;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px;
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.35);
}

.perm-matrix-table th.th-perm {
  text-align: center;
  min-width: 105px;
  white-space: nowrap;
}

.perm-col-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: help;
  user-select: none;
}

.perm-col-head .col-icon {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.perm-col-head span:not(.col-icon),
.perm-col-head .col-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #F1F5F9;
  white-space: nowrap;
  letter-spacing: 0.2px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.perm-matrix-table tbody tr {
  transition: background 0.15s ease;
}

.perm-matrix-table td {
  padding: 12px 12px;
  vertical-align: middle;
  color: #F8FAFC;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.perm-matrix-table tbody tr:last-child td {
  border-bottom: none;
}

.perm-matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #0b131e;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 16px;
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.35);
}

.perm-matrix-table tbody tr:hover td {
  background: rgba(30, 41, 59, 0.6);
}

.perm-matrix-table tbody tr:hover td:first-child {
  background: #172234;
}

.perm-matrix-table td.td-perm-cell {
  text-align: center;
  min-width: 105px;
}

.perm-matrix-table td.td-perm-cell:hover {
  background: rgba(0, 186, 242, 0.08);
}

/* Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.role-badge-admin {
  background: rgba(99, 102, 241, 0.2);
  color: #C7D2FE;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.role-badge-manager,
.role-badge-manager-1 {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.role-badge-manager-2 {
  background: rgba(192, 132, 252, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.role-badge-staff {
  background: rgba(0, 186, 242, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(0, 186, 242, 0.35);
}

.role-badge-tester {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.role-badge-surveyor {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.role-badge-guest {
  background: rgba(51, 65, 85, 0.8);
  color: #CBD5E1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.role-badge-custom {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* MODERN SWITCH TOGGLE */
.perm-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  vertical-align: middle;
}

.perm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.perm-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(51, 65, 85, 0.9);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.perm-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.perm-switch input:checked + .perm-slider {
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  box-shadow: 0 0 10px rgba(0, 186, 242, 0.45);
}

.perm-switch input:checked + .perm-slider:before {
  transform: translateX(20px);
}

.perm-switch input:focus + .perm-slider {
  box-shadow: 0 0 1px #00BAF2;
}

.perm-switch.disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

.perm-switch.disabled .perm-slider {
  cursor: not-allowed;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
}

/* Chú thích & Accordion tài khoản */
.perm-info-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perm-notice-box {
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  font-size: 12.5px;
  color: #FDE68A;
  line-height: 1.5;
}

.perm-notice-box code {
  background: rgba(245, 158, 11, 0.2);
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: 700;
  color: #FFFFFF;
}

.perm-users-accordion {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
}

.accordion-header {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #F8FAFC;
  user-select: none;
  transition: background 0.15s ease;
}

.accordion-header:hover {
  background: rgba(30, 41, 59, 0.9);
}

.accordion-chevron {
  font-size: 10px;
  color: #94A3B8;
  transition: transform 0.2s ease;
}

.accordion-header.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 19, 30, 0.98);
  max-height: 200px;
  overflow-y: auto;
}

.perm-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.perm-users-table th {
  text-align: left;
  padding: 6px 10px;
  color: #94A3B8;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.perm-users-table td {
  padding: 8px 10px;
  color: #F8FAFC;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Footer Modal Phân Quyền */
.perm-modal-footer {
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.btn-perm-secondary {
  padding: 9px 18px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #CBD5E1;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-perm-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #38BDF8;
  color: #F8FAFC;
}

.btn-perm-primary {
  padding: 9px 22px;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
  transition: all 0.2s ease;
}

.btn-perm-primary:hover {
  background: linear-gradient(135deg, #38BDF8, #0284C7);
  box-shadow: 0 6px 18px rgba(0, 186, 242, 0.5);
  transform: translateY(-1px);
}

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

/* TOAST NOTIFICATION CONTAINER */
.toast-container {
  position: fixed;
  top: calc(24px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300000 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(11, 19, 30, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.toast-item.toast-success {
  background: rgba(6, 78, 59, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #A7F3D0;
}

.toast-item.toast-error {
  background: rgba(127, 29, 29, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #FECACA;
}

.toast-item.toast-warning {
  background: rgba(120, 53, 15, 0.95);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #FDE68A;
}

.toast-item.toast-info {
  background: rgba(12, 74, 110, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #BAE6FD;
}

.toast-item.toast-leave {
  opacity: 0;
  transform: translateY(-15px) scale(0.95);
}

@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================================
   THÔNG BÁO KHUYẾN KHÍCH LÀM GIÀU DỮ LIỆU GIÁ THAM KHẢO (SMART PROMPT)
   ========================================================================= */
.ref-encourage-banner {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  max-width: 410px;
  width: calc(100vw - 48px);
  background: rgba(11, 19, 30, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-left: 5px solid #10b981;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: refBannerSlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ref-encourage-banner.ref-encourage-leave {
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
}

.ref-encourage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ref-encourage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.ref-encourage-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #94A3B8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.ref-encourage-close-btn:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.15);
}

.ref-encourage-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ref-encourage-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #F8FAFC;
}

.ref-encourage-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #CBD5E1;
}

.ref-encourage-text strong {
  color: #34D399;
}

.ref-encourage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn-encourage-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-encourage-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-encourage-primary:active {
  transform: translateY(0);
}

.btn-encourage-secondary {
  padding: 7px 12px;
  background: rgba(30, 41, 59, 0.85);
  color: #CBD5E1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-encourage-secondary:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #F8FAFC;
  border-color: #94A3B8;
}

@keyframes refBannerSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .ref-encourage-banner {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    padding: 14px;
  }
}

@media (max-width: 440px) {
  .brand-logo-widget {
    padding: 4px 10px 4px 7px;
    gap: 7px;
    border-radius: 11px;
  }
  .brand-tagline {
    display: block;
    font-size: 8px;
    font-weight: 700;
    white-space: nowrap;
  }
  .brand-logo-icon {
    width: 26px;
    height: 26px;
  }
  .brand-name {
    font-size: 13.5px;
    white-space: nowrap;
  }
  .brand-tld {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .top-nav-bar {
    left: calc(6px + env(safe-area-inset-left, 0px));
    right: calc(6px + env(safe-area-inset-right, 0px));
  }
  .pac-container {
    left: calc(6px + env(safe-area-inset-left, 0px)) !important;
    right: calc(6px + env(safe-area-inset-right, 0px)) !important;
    max-width: calc(100vw - 12px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
  }
  .coord-search-bar {
    padding: 5px 6px 5px 8px;
    gap: 4px;
  }
  .coord-icon svg {
    width: 15px;
    height: 15px;
  }
  .coord-go-btn span {
    display: none !important;
  }
  .coord-go-btn {
    padding: 6px 8px;
  }
}

/* =========================================================================
   TRẠNG THÁI CHẾ ĐỘ XEM PHỐ (STREET VIEW ACTIVE)
   Tự động ẩn mượt mà thanh tìm kiếm, cụm nút nổi và widget để giải phóng tầm nhìn 360°
========================================================================= */
body.streetview-active .top-nav-bar,
body.streetview-active .coord-search-bar,
body.streetview-active .pac-container,
body.streetview-active .auth-top-widget {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-20px) scale(0.96) !important;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
}

body.streetview-active .main-control-stack {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) scale(0.96) !important;
  visibility: hidden;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
}

body.streetview-active .ref-encourage-banner {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(20px) scale(0.96) !important;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
}

/* =========================================================================
   NÚT THOÁT CHẾ ĐỘ XEM PHỐ (STREET VIEW) AN TOÀN TRÊN MỌI THIẾT BỊ / IPHONE NOTCH
========================================================================= */
.exit-streetview-btn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  z-index: 9999;
  background: rgba(11, 19, 30, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  padding: 8px 16px 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.exit-streetview-btn:hover {
  background: rgba(15, 23, 42, 1);
  border-color: #00BAF2;
  transform: scale(1.05);
  box-shadow: 0 10px 36px rgba(0, 186, 242, 0.35);
}

.exit-streetview-btn:active {
  transform: scale(0.95);
}

body.streetview-active .exit-streetview-btn {
  display: inline-flex !important;
}

/* Đẩy toàn bộ controls phía trên của Google Street View (nút quay lại, thanh địa chỉ) xuống dưới vùng tai thỏ */
body.streetview-active .gm-style > div:first-child,
body.streetview-active .gm-style > div[style*="top"],
body.streetview-active button[aria-label*="bản đồ" i],
body.streetview-active button[aria-label*="Back" i],
body.streetview-active button[aria-label*="Trở lại" i],
body.streetview-active button[title*="bản đồ" i],
body.streetview-active button[title*="Back" i],
body.streetview-active button[title*="Trở lại" i],
body.streetview-active .gm-sv-label {
  margin-top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
  margin-left: calc(env(safe-area-inset-left, 0px) + 10px) !important;
}

/* =========================================================================
   CẤU HÌNH TẤT CẢ CÁC CỬA SỔ POPUP / MODAL KHÔNG BỊ VÙNG TAI THỎ (IOS NOTCH SAFE)
========================================================================= */
.login-modal-overlay,
.vn2000-modal,
.perm-modal-overlay,
.api-stats-modal-overlay,
.gemini-modal-overlay,
.state-price-modal-overlay,
.land-docs-modal-overlay,
.val-search-modal-overlay,
.ref-price-modal-overlay,
.market-modal-overlay,
.modal-overlay {
  padding-top: max(16px, calc(env(safe-area-inset-top, 0px) + 14px)) !important;
  padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 14px)) !important;
  padding-left: max(12px, calc(env(safe-area-inset-left, 0px) + 8px)) !important;
  padding-right: max(12px, calc(env(safe-area-inset-right, 0px) + 8px)) !important;
  box-sizing: border-box !important;
}

.login-modal-card,
.vn2000-modal-card,
.perm-modal-card,
.api-stats-modal-card,
.gemini-modal-card,
.state-price-modal-card,
.land-docs-modal-card,
.val-search-modal-card,
.ref-price-modal-card,
.market-modal-card,
.modal-card {
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 28px) !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  background: rgba(11, 19, 30, 0.98) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.login-modal-body,
.vn2000-modal-body,
.perm-modal-body,
.api-stats-modal-body,
.gemini-modal-body,
.state-price-modal-body,
.land-docs-modal-body,
.val-search-modal-body,
.ref-price-modal-body,
.modal-body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  background: rgba(11, 19, 30, 0.98) !important;
}


/* =========================================================================
   POPUP MODAL THỐNG KÊ API CHI TIẾT (API STATS DASHBOARD)
========================================================================= */
.api-stats-modal-card {
  max-width: 1040px;
  width: min(96vw, 1040px);
  height: min(92vh, 880px);
  max-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(11, 19, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.api-stats-modal-body {
  padding: 22px 26px 28px 26px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1 1 0px !important;
  height: 0 !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 18px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(11, 19, 30, 0.98);
}

.api-stats-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.api-stats-month-select {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #F8FAFC;
  background: rgba(30, 41, 59, 0.85);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.api-stats-month-select:focus {
  border-color: #00BAF2;
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25);
}

.btn-refresh-stats {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #CBD5E1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-stats:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #F8FAFC;
  border-color: #38BDF8;
}

.btn-refresh-stats.spinning svg {
  animation: spinRefresh 0.6s linear infinite;
}

@keyframes spinRefresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 4 Thẻ KPI */
.api-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.api-kpi-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.api-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.kpi-blue { background: rgba(0, 186, 242, 0.18); color: #38BDF8; }
.kpi-green { background: rgba(16, 185, 129, 0.18); color: #34D399; }
.kpi-purple { background: rgba(124, 58, 237, 0.18); color: #A78BFA; }
.kpi-amber { background: rgba(245, 158, 11, 0.18); color: #FBBF24; }

.kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.2;
  margin: 3px 0 2px 0;
}

.kpi-val-text {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #38BDF8;
}

.kpi-val-cycle {
  font-size: 13.5px;
  font-weight: 700;
  color: #FBBF24;
}

.kpi-subtext {
  font-size: 11px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thanh Tab Điều Hướng Thông Minh Trong Modal API Stats */
.api-stats-tab-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.api-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.api-tab-btn:hover {
  color: #F8FAFC;
  background: rgba(30, 41, 59, 0.6);
}

.api-tab-btn.active {
  background: rgba(30, 41, 59, 0.95);
  color: #00BAF2;
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.2);
}

.tab-btn-icon {
  font-size: 15px;
}

.tab-btn-text {
  font-weight: 700;
}

.tab-btn-count {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(51, 65, 85, 0.8);
  color: #CBD5E1;
  transition: all 0.2s ease;
}

.api-tab-btn.active .tab-btn-count {
  background: rgba(0, 186, 242, 0.2);
  color: #38BDF8;
  border: 1px solid rgba(0, 186, 242, 0.35);
}

.api-tab-pane {
  display: block;
  animation: fadeInPane 0.2s ease;
}

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

/* =========================================================================
   PHÂN NHÓM THẺ DỊCH VỤ API (GOOGLE APIS & DỊCH VỤ KHÁC)
========================================================================= */
.api-groups-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.api-group-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

.api-group-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
}

.api-group-card.api-group-google {
  border-left: 4px solid #00BAF2;
}

.api-group-card.api-group-gis {
  border-left: 4px solid #14B8A6;
}

.api-group-card.api-group-system {
  border-left: 4px solid #818CF8;
}

.api-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(20, 32, 50, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 12px;
  flex-wrap: wrap;
}

.api-group-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.api-group-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.group-icon-google {
  background: rgba(0, 186, 242, 0.15);
  color: #00BAF2;
}

.group-icon-gis {
  background: rgba(20, 184, 166, 0.15);
  color: #2DD4BF;
}

.group-icon-system {
  background: rgba(99, 102, 241, 0.15);
  color: #818CF8;
}

.api-group-title-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.api-group-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-group-title-text {
  font-size: 14px;
  font-weight: 700;
  color: #F8FAFC;
  letter-spacing: -0.2px;
}

.api-group-subtitle {
  font-size: 11.5px;
  color: #94A3B8;
  margin-top: 2px;
}

.api-group-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-google {
  background: rgba(0, 186, 242, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(0, 186, 242, 0.35);
}

.badge-gis {
  background: rgba(20, 184, 166, 0.18);
  color: #5EEAD4;
  border: 1px solid rgba(20, 184, 166, 0.35);
}

.badge-system {
  background: rgba(99, 102, 241, 0.18);
  color: #C7D2FE;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.api-group-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.api-group-metric-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.85);
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.api-group-metric-item .metric-label {
  color: #94A3B8;
  font-weight: 500;
}

.api-group-metric-item .metric-val {
  font-weight: 800;
  font-size: 13px;
  color: #F8FAFC;
}

.text-google {
  color: #38BDF8;
}

.text-gis {
  color: #2DD4BF;
}

.text-system {
  color: #A5B4FC;
}

.group-header-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.group-table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  margin-bottom: 0;
}

.group-table-wrap .api-stats-table {
  border-collapse: collapse;
}

.group-table-wrap .api-stats-table th {
  background: rgba(20, 32, 50, 0.9);
}

/* Tiêu đề mục trong modal */
.api-stats-section-title {
  display: flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 8px;
}

/* Bảng thống kê */
.api-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.api-stats-table th {
  background: rgba(20, 32, 50, 0.9);
  color: #CBD5E1;
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.api-stats-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
  color: #F8FAFC;
}

.api-stats-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.6);
}

.api-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.api-title-main {
  font-weight: 600;
  color: #F8FAFC;
  font-size: 13px;
}

.api-desc-sub {
  font-size: 11.5px;
  color: #94A3B8;
  margin-top: 1px;
}

.api-pricing-hint {
  font-size: 11px;
  color: #38BDF8;
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
  margin-top: 3px;
  font-weight: 500;
  cursor: help;
}

.badge-today-calls {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(51, 65, 85, 0.8);
  color: #CBD5E1;
}

.badge-today-calls.active {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.api-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-progress-bar {
  flex: 1;
  height: 7px;
  background: rgba(51, 65, 85, 0.8);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}

.api-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00BAF2, #0072CE);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.api-progress-fill.fill-safe {
  background: linear-gradient(90deg, #10B981, #059669);
}

.api-progress-fill.fill-warning {
  background: linear-gradient(90deg, #F59E0B, #D97706);
}

.api-progress-fill.fill-blocked {
  background: linear-gradient(90deg, #EF4444, #DC2626);
}

.api-progress-bar.user-bar .user-fill {
  background: linear-gradient(90deg, #059669, #10B981);
}

.api-pct-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #CBD5E1;
  min-width: 36px;
  text-align: right;
}

/* Quota cell wrap */
.quota-cell-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.quota-ratio {
  font-size: 13.5px;
  color: #F8FAFC;
}

.quota-sep {
  color: #64748B;
  margin: 0 2px;
}

.quota-limit-val {
  color: #94A3B8;
  font-weight: 500;
  font-size: 12.5px;
}

.quota-sub-remain {
  font-size: 11px;
  color: #34D399;
  font-weight: 500;
  margin-top: 1px;
}

/* Quota Pill Status Badges */
.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-safe {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.pill-blocked {
  background: rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  font-weight: 700;
  animation: pulsePillBlocked 2s infinite;
}

@keyframes pulsePillBlocked {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.pill-unlimited {
  background: rgba(51, 65, 85, 0.8);
  color: #CBD5E1;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.row-blocked {
  background: rgba(239, 68, 68, 0.15) !important;
}

.row-blocked td {
  border-bottom-color: rgba(239, 68, 68, 0.3) !important;
}

.lock-icon-tag {
  font-size: 12px;
  margin-left: 4px;
  display: inline-block;
  vertical-align: middle;
}

/* User Table Styling & Badges */
.title-with-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-hint-badge {
  font-size: 11.5px;
  background: rgba(0, 186, 242, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(0, 186, 242, 0.35);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.user-table-wrap {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  min-height: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 6px;
}

.api-user-table th {
  background: rgba(20, 32, 50, 0.9);
  color: #CBD5E1;
  font-size: 12.5px;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.api-user-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
  color: #F8FAFC;
}

.api-user-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.6);
}

/* User cell */
.api-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-rank-badge {
  font-size: 16px;
  min-width: 26px;
  text-align: center;
}

.api-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 186, 242, 0.35);
  flex-shrink: 0;
}

.api-stats-footer-note {
  font-size: 12px;
  color: #94A3B8;
  flex: 1;
  text-align: left;
}

/* Responsive cho màn hình nhỏ */
@media (max-width: 768px) {
  .api-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .api-kpi-grid {
    grid-template-columns: 1fr;
  }
  .api-stats-header-controls {
    flex-wrap: wrap;
  }
}

/* =========================================================================
   GEMINI AI REAL ESTATE COMPARATIVE VALUATION MODAL & UI STYLES
   ========================================================================= */

/* Nút bấm trong InfoWindow */
.btn-gemini-val-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(124, 58, 237, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-gemini-val-action:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.5);
  filter: brightness(1.08);
}

.btn-gemini-val-action:active {
  transform: translateY(0);
}

.btn-gemini-val-action .sparkle-icon {
  animation: spinSlow 6s linear infinite;
  display: inline-block;
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg); }
}

/* Modal Overlay */
.gemini-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gemini-modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* Modal Card */
.gemini-modal-card {
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 100%;
  max-width: 1280px;
  max-height: 92vh;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: geminiModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes geminiModalPop {
  0% { transform: scale(0.94) translateY(16px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Modal Header */
.gemini-modal-header {
  background: linear-gradient(135deg, #0b131e 0%, #0f172a 60%, #1e293b 100%);
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.gemini-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gemini-header-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.gemini-sparkle-svg {
  filter: drop-shadow(0 0 6px rgba(0, 186, 242, 0.8));
}

.gemini-header-title-group h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #f8fafc;
}

.gemini-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gemini-badge-ai {
  background: rgba(0, 186, 242, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.gemini-badge-search {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(110, 231, 183, 0.35);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gemini-header-sub {
  margin: 3px 0 0 0;
  font-size: 12.5px;
  color: #94a3b8;
}

.gemini-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gemini-btn-header-start {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.gemini-btn-header-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
  filter: brightness(1.08);
}

.gemini-btn-icon-setting {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.gemini-btn-icon-setting:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.gemini-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.gemini-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Mobile Tab Bar & Back Bar mặc định ẩn trên Desktop */
.cma-mobile-tabs-bar {
  display: none !important;
}

.cma-mobile-back-bar {
  display: none !important;
}

/* Modal Body */
.gemini-modal-body {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 20px;
  padding: 20px 24px;
  height: calc(92vh - 82px);
  overflow: hidden;
  background: #0b131e;
  color: #f8fafc;
}

/* Cột Trái (Inputs) */
.gemini-col-inputs {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.gemini-inputs-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Sticky Action Footer ở cột nhập liệu */
.gemini-input-sticky-footer {
  position: sticky;
  bottom: 0;
  background: rgba(11, 19, 30, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 0 2px 0;
  border-top: 1.5px solid rgba(255, 255, 255, 0.1);
  z-index: 50;
  margin-top: auto;
  box-shadow: 0 -8px 16px -4px rgba(11, 19, 30, 0.95);
}

/* Custom Scrollbars */
.gemini-inputs-scroll-area::-webkit-scrollbar,
.gemini-col-results::-webkit-scrollbar {
  width: 8px;
}

.gemini-inputs-scroll-area::-webkit-scrollbar-track,
.gemini-col-results::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 6px;
}

.gemini-inputs-scroll-area::-webkit-scrollbar-thumb,
.gemini-col-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  border: 2px solid rgba(15, 23, 42, 0.6);
}

.gemini-inputs-scroll-area::-webkit-scrollbar-thumb:hover,
.gemini-col-results::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 186, 242, 0.45);
}

.gemini-card-section {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.gemini-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.gemini-section-title .sec-icon {
  font-size: 15px;
}

.gemini-field-group {
  margin-bottom: 10px;
}

.gemini-field-group:last-child {
  margin-bottom: 0;
}

.gemini-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.gemini-label .req {
  color: #f87171;
  margin-left: 2px;
}

.gemini-input-wrap {
  position: relative;
}

.gemini-input, .gemini-select, .gemini-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  color: #f8fafc;
  background-color: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.gemini-input:focus, .gemini-select:focus, .gemini-textarea:focus {
  border-color: #00BAF2;
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25);
  background-color: rgba(30, 41, 59, 0.95);
}

.gemini-input.highlight-auto-fill {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
  transition: all 0.5s ease;
}

.btn-geocode-inline {
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-geocode-inline:hover {
  background: rgba(0, 186, 242, 0.25);
  color: #ffffff;
  border-color: #00BAF2;
}

.gemini-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gemini-coord-pill, .gemini-tag-pill {
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gemini-textarea {
  resize: vertical;
  min-height: 54px;
}

/* Dropzone Upload */
.gemini-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gemini-dropzone:hover, .gemini-dropzone.dragover {
  border-color: #00BAF2;
  background: rgba(0, 186, 242, 0.08);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone-text strong {
  display: block;
  font-size: 13px;
  color: #f8fafc;
}

.dropzone-text span {
  font-size: 11.5px;
  color: #94a3b8;
}

/* File list */
.gemini-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.gemini-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 12px;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.file-thumb-preview {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.file-icon-pdf {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
}

.file-meta-name {
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.file-meta-size {
  font-size: 11px;
  color: #94a3b8;
}

.btn-remove-file {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-remove-file:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Cụm Radio Chọn Nguồn Dữ Liệu So Sánh */
.gemini-source-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.source-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.source-radio-card:hover {
  border-color: rgba(0, 186, 242, 0.4);
  background: rgba(30, 41, 59, 0.8);
  transform: translateY(-1px);
}

.source-radio-card.active, .source-radio-card:has(input:checked) {
  border-color: #00BAF2;
  background: rgba(0, 114, 206, 0.2);
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.2);
}

.source-radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: #00BAF2;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.radio-card-body {
  flex: 1;
}

.radio-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.r-icon {
  font-size: 14px;
}

.r-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.r-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.badge-web {
  background: rgba(147, 51, 234, 0.2);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.badge-internal {
  background: rgba(0, 186, 242, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-ref {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(110, 231, 183, 0.35);
}

.r-desc {
  font-size: 11.5px;
  color: #94a3b8;
  margin: 3px 0 0 0;
  line-height: 1.4;
}

/* Bộ Chọn Khoảng Thời Gian Đăng Tin (Google Search Grounding) */
.gemini-timeframe-picker-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  animation: fadeInPane 0.22s ease;
}

.timeframe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.timeframe-val-badge {
  font-size: 11px;
  font-weight: 700;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(45, 212, 191, 0.35);
}

/* Bộ Chọn Bán Kính (Kho Nội bộ & Tham khảo) */
.gemini-radius-picker-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  animation: fadeInPane 0.22s ease;
}

.radius-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.radius-val-badge {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.comp-source-type-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.comp-distance-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.comp-pub-date-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.checkbox-text small {
  display: block;
  font-size: 11.5px;
  color: #4ade80;
  margin-top: 2px;
  line-height: 1.35;
}

/* Primary Button */
.gemini-btn-primary {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #00BAF2 0%, #0072CE 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 186, 242, 0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  margin-top: 4px;
}

.gemini-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 186, 242, 0.6);
  filter: brightness(1.08);
}

.gemini-btn-primary:active {
  transform: translateY(0);
}

.gemini-btn-primary .btn-sparkle-icon {
  font-size: 18px;
  animation: pulse 2s infinite;
}

/* Cột Phải (Results) */
.gemini-col-results {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(15, 23, 42, 0.6);
  -webkit-overflow-scrolling: touch;
}

.gemini-state-wrap {
  width: 100%;
  min-height: min-content;
  height: auto;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

/* Initial Guide State */
.gemini-initial-hero {
  margin: auto;
  text-align: center;
  max-width: 540px;
  padding: 30px 10px;
}

.gemini-hero-radar {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-circle {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 186, 242, 0.35);
  animation: radarRipple 3s ease-out infinite;
}

.rc-1 { width: 45px; height: 45px; animation-delay: 0s; }
.rc-2 { width: 70px; height: 70px; animation-delay: 1s; }
.rc-3 { width: 90px; height: 90px; animation-delay: 2s; }

@keyframes radarRipple {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

.radar-center-icon {
  font-size: 32px;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 186, 242, 0.5));
}

.gemini-initial-hero h4 {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 8px 0;
}

.gemini-initial-hero p {
  font-size: 13.5px;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0 0 24px 0;
}

.gemini-feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: left;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
}

.feature-item .f-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.feature-item .f-text b {
  display: block;
  font-size: 13px;
  color: #f8fafc;
}

.feature-item .f-text span {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Loading State */
.gemini-loading-card {
  margin: auto;
  text-align: center;
  max-width: 520px;
  padding: 30px 10px;
}

.gemini-ai-orb {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-core {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00BAF2, #0072CE, #818cf8);
  box-shadow: 0 0 25px rgba(0, 186, 242, 0.8);
  animation: orbPulse 2s ease-in-out infinite alternate;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px dashed rgba(0, 186, 242, 0.5);
}

.ring-1 {
  width: 55px;
  height: 55px;
  animation: spinSlow 5s linear infinite;
}

.ring-2 {
  width: 78px;
  height: 78px;
  border-style: dotted;
  border-color: rgba(56, 189, 248, 0.4);
  animation: spinSlow 8s linear infinite reverse;
}

@keyframes orbPulse {
  0% { transform: scale(0.9); filter: brightness(0.9); }
  100% { transform: scale(1.15); filter: brightness(1.2); }
}

.loading-title {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 6px 0;
}

.loading-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 24px 0;
}

/* Stepper */
.gemini-stepper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.3s ease;
  opacity: 0.55;
}

.step-item.active {
  background: rgba(0, 114, 206, 0.2);
  border-color: #00BAF2;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.2);
}

.step-item.completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  opacity: 0.9;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-item.active .step-dot {
  background: #00BAF2;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 186, 242, 0.6);
}

.step-item.completed .step-dot {
  background: #10b981;
  color: #ffffff;
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.step-desc {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 1px;
}

/* Result KPI Banner */
.gemini-kpi-banner {
  background: linear-gradient(135deg, #0b131e 0%, #0f172a 60%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 18px 20px;
  color: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.kpi-main-card {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #38bdf8;
}

.kpi-total-price {
  font-size: 28px;
  font-weight: 800;
  color: #00BAF2;
  margin: 4px 0;
  letter-spacing: -0.5px;
}

.kpi-unit-price-sub {
  font-size: 13.5px;
  color: #e2e8f0;
}

.kpi-unit-price-sub strong {
  color: #facc15;
}

.kpi-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.kpi-mini-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
}

.mini-label {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.mini-val {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
}

.mini-val.badge-liquidity {
  color: #4ade80;
}

/* Report Cards */
.gemini-report-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

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

.card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header-left .hdr-icon {
  font-size: 16px;
}

.card-header-left h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.card-tag-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.35);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Web Comps List */
.web-comps-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.web-comp-card {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid #00BAF2;
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.web-comp-card:hover {
  transform: translateX(2px);
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  border-left-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.comp-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.comp-price-badge {
  font-size: 13px;
  font-weight: 800;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.comp-details {
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.comp-details span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #94a3b8;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 5px;
}

.comp-link-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 75%;
}

.btn-copy-comp-link {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #cbd5e1;
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-copy-comp-link:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
  border-color: #00BAF2;
}

.comp-portal-chip {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s;
}

.comp-portal-chip:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  border-color: #00BAF2;
  transform: translateY(-1px);
}

.comp-portal-chip.chip-chotot {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.15);
}

.comp-portal-chip.chip-chotot:hover {
  background: rgba(251, 146, 60, 0.25);
}

.comp-portal-chip.chip-google {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.15);
}

.comp-portal-chip.chip-google:hover {
  background: rgba(56, 189, 248, 0.25);
}

.comp-source-link {
  color: #38bdf8;
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.35);
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  transition: all 0.2s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comp-source-link:hover {
  background: rgba(0, 186, 242, 0.25);
  border-color: #00BAF2;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.35);
  text-decoration: none;
}

.comp-domain-badge {
  font-size: 10px;
  background: rgba(30, 41, 59, 0.8);
  color: #38bdf8;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(0, 186, 242, 0.3);
  font-weight: 700;
}

.comp-domain-badge.grounding-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.35);
}

.comp-no-link-badge {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comp-adjust-tag {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Breakdown Table */
.report-table-wrap {
  overflow-x: auto;
}

.gemini-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.gemini-breakdown-table th {
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.14);
  text-align: left;
}

.gemini-breakdown-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.gemini-breakdown-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.gemini-breakdown-table tr.row-total td {
  font-weight: 700;
  background: rgba(30, 41, 59, 0.9);
  border-top: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

/* Markdown Formatted Body */
.gemini-markdown-body {
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: #e2e8f0;
}

.gemini-markdown-body h1, .gemini-markdown-body h2, .gemini-markdown-body h3, .gemini-markdown-body h4 {
  color: #f8fafc;
  margin: 14px 0 6px 0;
  font-weight: 700;
}

.gemini-markdown-body h3 { font-size: 14px; }
.gemini-markdown-body h4 { font-size: 13px; }

.gemini-markdown-body ul, .gemini-markdown-body ol {
  padding-left: 20px;
  margin: 6px 0 10px 0;
}

.gemini-markdown-body li {
  margin-bottom: 4px;
}

.gemini-markdown-body blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.6);
  border-left: 3.5px solid #00BAF2;
  color: #cbd5e1;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

.gemini-markdown-body strong {
  color: #f8fafc;
}

/* Grounding Sources */
.gemini-grounding-sources {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.sources-title {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.sources-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-pill-link {
  font-size: 11.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-pill-link:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
}

/* Result Action Buttons */
.gemini-result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.btn-res-action {
  padding: 8px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-res-action:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #00BAF2;
  color: #f8fafc;
}

.btn-res-action.btn-res-primary {
  margin-left: auto;
  background: linear-gradient(135deg, #00BAF2 0%, #0072CE 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 186, 242, 0.35);
}

.btn-res-action.btn-res-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(0, 186, 242, 0.5);
}

.btn-res-action.btn-res-highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.35) 100%);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  font-weight: 700;
}

.btn-res-action.btn-res-highlight:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(5, 150, 105, 0.55) 100%);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* =========================================================================
   CMA REDESIGN - BẢNG MA TRẬN ĐIỀU CHỈNH & THANH CƠ CẤU GIÁ TRỊ (TC TĐGVN 08)
   ========================================================================= */

/* Box Chi tiết Công trình Xây dựng */
.gemini-building-details-box {
  animation: fadeIn 0.25s ease-out;
}

/* Thanh phân bổ cơ cấu giá trị */
.cma-val-comp-container {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.cma-comp-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comp-bar-title {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
}

.cma-confidence-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.cma-confidence-pill.high {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.cma-confidence-pill.medium {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.4);
}

.cma-confidence-pill.low {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.cma-multi-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.cma-bar-seg {
  height: 100%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cma-bar-seg.seg-res { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.cma-bar-seg.seg-agri { background: linear-gradient(90deg, #059669, #34d399); }
.cma-bar-seg.seg-building { background: linear-gradient(90deg, #d97706, #fb923c); }

.cma-bar-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #94a3b8;
}

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

.leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.leg-dot.dot-res { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.6); }
.leg-dot.dot-agri { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.6); }
.leg-dot.dot-bld { background: #fb923c; box-shadow: 0 0 6px rgba(251, 146, 60, 0.6); }

.leg-item b { color: #f8fafc; }

/* Ma Trận Đối Chiếu So Sánh Chuẩn TC TĐGVN */
.cma-matrix-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

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

/* Thanh điều hướng nhanh cột trên Mobile */
.cma-mobile-col-nav {
  display: none;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cma-scroll-hint-label {
  font-size: 11px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cma-col-chips {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
}

.cma-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cma-chip:hover, .cma-chip.active {
  background: rgba(0, 186, 242, 0.25);
  border-color: #00BAF2;
  color: #ffffff;
}

.cma-table-scroll-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 186, 242, 0.4) rgba(15, 23, 42, 0.6);
}

.cma-table-scroll-wrap::-webkit-scrollbar {
  height: 6px;
}

.cma-table-scroll-wrap::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 3px;
}

.cma-table-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 186, 242, 0.4);
  border-radius: 3px;
}

.cma-matrix-table {
  font-size: 12px;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 680px;
}

.cma-matrix-table th, .cma-matrix-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.cma-matrix-table th:last-child, .cma-matrix-table td:last-child {
  border-right: none;
}

.cma-matrix-table th {
  background: rgba(30, 41, 59, 0.95);
  font-weight: 700;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cma-matrix-table th:first-child,
.cma-matrix-table th.col-criteria-hdr {
  text-align: left;
  min-width: 170px;
}

.cma-matrix-table td.col-target, .cma-matrix-table th.col-target {
  background: rgba(0, 186, 242, 0.08);
  border-left: 1px solid rgba(0, 186, 242, 0.3);
  border-right: 1px solid rgba(0, 186, 242, 0.3);
  min-width: 150px;
}

.cma-matrix-table th[id^="thComp"] {
  min-width: 140px;
}

.target-sub-pill {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
  margin-top: 2px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.cma-row-header {
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.4);
}

.cma-adj-input, .cma-weight-input {
  width: 68px;
  padding: 4px 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}

.cma-adj-input:focus, .cma-weight-input:focus {
  border-color: #00BAF2;
  box-shadow: 0 0 0 2px rgba(0, 186, 242, 0.3);
  background: rgba(15, 23, 42, 1);
}

.cma-adj-input.positive { color: #4ade80; }
.cma-adj-input.negative { color: #f87171; }
.cma-adj-input.zero { color: #94a3b8; }

.cma-val-highlight {
  font-weight: 700;
  color: #38bdf8;
}

.cma-row-total-adj {
  background: rgba(30, 41, 59, 0.7);
  font-weight: 700;
}

.cma-row-indicated-price {
  background: rgba(0, 186, 242, 0.15) !important;
  font-weight: 800;
}

.cma-row-indicated-price td {
  color: #ffffff;
  border-top: 1.5px solid rgba(0, 186, 242, 0.4);
  border-bottom: 1.5px solid rgba(0, 186, 242, 0.4);
  font-size: 13px;
}

.cma-final-unit-badge {
  font-size: 15px;
  font-weight: 800;
  color: #facc15;
}

.btn-matrix-small {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-matrix-small:hover {
  background: rgba(0, 186, 242, 0.2);
  border-color: #00BAF2;
  color: #ffffff;
}

.cma-matrix-note {
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.45;
}

/* Modal API Key hiển thị đè lên trên Modal Định giá */
#geminiKeyConfigModal {
  z-index: 100005 !important;
}

#geminiKeyConfigModal .login-modal-card {
  z-index: 100006 !important;
  position: relative;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .gemini-modal-body {
    grid-template-columns: 420px 1fr;
    gap: 16px;
    padding: 16px;
  }
}

@media (max-width: 860px) {
  .gemini-modal-overlay {
    padding: 6px;
    overflow-x: hidden;
  }
  .gemini-modal-card {
    max-height: 98vh;
    height: 98vh;
    border-radius: 14px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Thanh Tab chuyển đổi trên Mobile */
  .cma-mobile-tabs-bar {
    display: flex !important;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
    padding: 6px 8px;
    gap: 8px;
    flex-shrink: 0;
    z-index: 10;
  }
  .cma-mobile-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 9px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .cma-mobile-tab-btn.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
    font-weight: 700;
  }
  .cma-tab-status-dot {
    width: 8px;
    height: 8px;
    background: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 8px #38bdf8;
    animation: cmaPulseDot 1.2s infinite;
  }
  @keyframes cmaPulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
  }

  .gemini-modal-body {
    display: flex !important;
    flex-direction: column !important;
    height: calc(98vh - 120px) !important;
    overflow: hidden !important;
    padding: 8px 6px !important;
    gap: 0 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Cột Nhập liệu trên Mobile */
  .gemini-col-inputs {
    display: flex;
    flex-direction: column;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    flex: 1 1 auto;
    min-height: 0;
  }
  .gemini-inputs-scroll-area {
    flex: 1 1 auto;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
    gap: 12px;
    min-height: 0;
  }
  .gemini-input-sticky-footer {
    position: relative !important;
    bottom: auto !important;
    background: rgba(11, 19, 30, 0.98);
    padding: 10px 0 4px 0;
    z-index: 10;
    margin-top: auto;
    border-top: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
  }

  /* Cột Kết quả trên Mobile */
  .gemini-col-results {
    display: none;
    flex-direction: column;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    border-left: none;
    border-top: none;
    padding: 4px 4px 16px 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex: 1 1 auto;
    min-height: 0;
  }

  /* Thanh nút quay lại trên Mobile */
  .cma-mobile-back-bar {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 12px;
    padding: 2px 0;
    flex-shrink: 0;
  }
  .cma-btn-back-inputs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #38bdf8;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
  }
  .cma-btn-back-inputs:active {
    transform: scale(0.97);
    background: rgba(56, 189, 248, 0.15);
  }
  .cma-back-arrow {
    font-size: 15px;
    line-height: 1;
  }
  .gemini-report-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }
  .kpi-sub-grid {
    grid-template-columns: 1fr;
  }

  /* Kích hoạt thanh điều hướng nhanh & cố định cột 1 ma trận */
  .cma-mobile-col-nav {
    display: flex !important;
  }
  .cma-matrix-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cma-header-actions-wrap {
    width: 100%;
    justify-content: flex-start;
  }
  .cma-matrix-table {
    min-width: 580px;
  }
  .cma-matrix-table th:first-child,
  .cma-matrix-table td:first-child,
  .cma-matrix-table th.col-criteria-hdr {
    position: sticky !important;
    left: 0 !important;
    z-index: 8 !important;
    background: #0f172a !important;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.6);
    min-width: 120px !important;
    max-width: 130px !important;
    width: 125px !important;
    font-size: 11px !important;
    padding: 6px 6px !important;
    word-break: break-word;
    white-space: normal;
  }
  .cma-matrix-table th:first-child,
  .cma-matrix-table th.col-criteria-hdr {
    z-index: 18 !important;
    background: #1e293b !important;
  }
  .cma-matrix-table tr.cma-row-total-adj td:first-child {
    background: #1e293b !important;
  }
  .cma-matrix-table tr.cma-row-indicated-price td:first-child {
    background: #0f2b3e !important;
  }
  .cma-matrix-table th.col-target,
  .cma-matrix-table td.col-target {
    min-width: 115px !important;
    max-width: 125px !important;
    width: 120px !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
  }
  .cma-matrix-table th[id^="thComp"],
  .cma-matrix-table td:not(:first-child):not(.col-target) {
    min-width: 118px !important;
    font-size: 11px !important;
    padding: 6px 4px !important;
  }
  .cma-adj-input, .cma-weight-input {
    width: 48px !important;
    height: 32px !important;
    font-size: 16px !important; /* Chống iOS Safari Auto-Zoom */
    transform: scale(0.82) !important;
    transform-origin: center center;
    border-radius: 6px !important;
    padding: 2px 0 !important;
    touch-action: manipulation !important;
  }
}

@media (max-width: 600px) {
  .gemini-modal-overlay {
    padding: 0;
  }
  .gemini-modal-card {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .gemini-modal-header {
    padding: 10px 12px;
  }
  .gemini-header-left {
    gap: 8px;
  }
  .gemini-header-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
  .gemini-header-title-group h3 {
    font-size: 14px;
  }
  .gemini-badge-ai, .gemini-badge-search {
    font-size: 9.5px;
    padding: 1px 5px;
  }
  .gemini-header-sub {
    font-size: 10.5px;
    line-height: 1.25;
    margin-top: 2px;
  }
  .gemini-modal-body {
    height: calc(100vh - 66px);
    padding: 8px 4px;
    gap: 8px;
  }
  .gemini-grid-2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .gemini-card-section {
    padding: 10px 12px;
    border-radius: 10px;
  }
  .gemini-section-title {
    font-size: 12.5px;
    margin-bottom: 8px;
  }
  .gemini-coord-pill, .gemini-tag-pill {
    white-space: normal;
    word-break: break-all;
    font-size: 11px;
    padding: 6px 8px;
  }
  .gemini-btn-primary {
    height: 44px;
    font-size: 14px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  /* Trường hợp in Phiếu thẩm định A4 chuyên nghiệp */
  body.printing-cma-sheet #cmaPrintValuationReportSheet,
  body.printing-cma-sheet #cmaPrintValuationReportSheet * {
    visibility: visible;
  }

  body.printing-cma-sheet #cmaPrintValuationReportSheet {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px 30px;
    background: #ffffff !important;
    color: #1e293b !important;
    font-family: "Times New Roman", Times, serif;
    font-size: 11pt;
    line-height: 1.4;
  }

  /* Trường hợp in thường từ modal */
  body:not(.printing-cma-sheet) #geminiValuationModal,
  body:not(.printing-cma-sheet) #geminiValuationModal * {
    visibility: visible;
  }
  body:not(.printing-cma-sheet) #geminiValuationModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    background: #ffffff;
    padding: 0;
    color: #1e293b;
  }
  .gemini-col-inputs, .gemini-modal-header, .gemini-result-actions {
    display: none !important;
  }
  .gemini-modal-body {
    grid-template-columns: 1fr;
    padding: 0;
    height: auto;
    overflow: visible;
  }
  .gemini-col-results {
    border: none;
    box-shadow: none;
    padding: 0;
    background: #ffffff !important;
    color: #1e293b !important;
  }
}

/* Kiểu dáng Phiếu Tính Giá Thẩm Định BĐS A4 (Mẫu Văn Bản Chuẩn Thẩm Định) */
.cma-print-only-sheet {
  background: #ffffff;
  color: #0f172a;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  line-height: 1.45;
}

.cma-print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 10px;
}

.cma-print-agency {
  text-align: left;
  font-size: 10pt;
}

.cma-print-agency b {
  font-size: 11pt;
  text-transform: uppercase;
  color: #0369a1;
}

.cma-print-motto {
  text-align: center;
  font-size: 10.5pt;
}

.cma-print-motto b {
  font-size: 11pt;
  text-transform: uppercase;
}

.cma-print-motto .star-line {
  margin-top: 2px;
  letter-spacing: 2px;
  font-weight: 700;
}

.cma-print-title-box {
  text-align: center;
  margin: 14px 0 16px 0;
}

.cma-print-title {
  font-size: 16pt;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a;
  margin: 0;
}

.cma-print-subtitle {
  font-size: 10pt;
  font-style: italic;
  color: #475569;
  margin: 4px 0 0 0;
}

.cma-print-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 10.5pt;
  margin-bottom: 14px;
}

.cma-print-sec-title {
  font-size: 11.5pt;
  font-weight: 700;
  text-transform: uppercase;
  color: #0369a1;
  margin: 14px 0 6px 0;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 2px;
}

.cma-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 9.5pt;
}

.cma-print-table th, .cma-print-table td {
  border: 1px solid #334155;
  padding: 4px 6px;
  text-align: left;
}

.cma-print-table th {
  background: #e2e8f0;
  font-weight: 700;
  text-align: center;
}

.cma-print-table .cma-pt-target {
  background: #f0f9ff;
  font-weight: 600;
}

.cma-print-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  page-break-inside: avoid;
}

.cma-print-sig-col {
  text-align: center;
  width: 45%;
}

.cma-print-sig-col .sig-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5pt;
}

.cma-print-sig-col .sig-sub {
  font-size: 9pt;
  font-style: italic;
  color: #64748b;
  margin-bottom: 60px;
}

.cma-print-sig-col .sig-name {
  font-weight: 700;
  font-size: 11pt;
}

/* =========================================================================
   STATE LAND PRICE LOOKUP (GEMINI RAG) UI STYLES
   ========================================================================= */

/* Nút Tra cứu Bảng giá đất Nhà nước trong InfoWindow */
.btn-state-price-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #0284c7 100%);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(13, 148, 136, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-state-price-action:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.5);
  filter: brightness(1.08);
}

.btn-state-price-action:active {
  transform: translateY(0);
}

.btn-state-price-action .gov-icon {
  font-size: 14px;
}

/* Nút Thêm Giá tham khảo trong InfoWindow */
.btn-add-ref-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 2px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #d97706 0%, #ea580c 50%, #e11d48 100%);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(234, 88, 12, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-add-ref-action:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.5);
  filter: brightness(1.08);
}

.btn-add-ref-action:active {
  transform: translateY(0);
}

.btn-add-ref-action .ref-add-icon {
  font-size: 13px;
}

/* Container nhóm nút trong InfoWindow */
.parcel-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

/* Overlay */
.state-price-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.state-price-modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* Modal Card */
.state-price-modal-card {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: stateModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stateModalPop {
  0% {
    transform: scale(0.94) translateY(14px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Header */
.state-price-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0b131e 0%, #0f172a 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.state-price-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.state-price-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.35), rgba(2, 132, 199, 0.35));
  border: 1px solid rgba(45, 212, 191, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.state-price-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.state-price-title-row h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.state-price-badge-ai {
  font-size: 11px;
  font-weight: 700;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.35);
  padding: 2px 7px;
  border-radius: 999px;
}

.state-price-header-sub {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

.state-price-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.state-price-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Body */
.state-price-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(90vh - 140px);
  background: #0b131e;
  color: #f8fafc;
}

/* Search & Location Toolbar (Khối 1: Thiết Lập Tra Cứu) */
.state-search-toolbar {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.95) 100%);
  padding: 16px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  margin-bottom: 16px;
}

/* Section Headers Phân Biệt Rõ 2 Khối Lựa Chọn & Kết Quả */
.state-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.query-section-header {
  border-bottom-color: rgba(56, 189, 248, 0.2);
}

.results-section-header {
  border-bottom-color: rgba(45, 212, 191, 0.25);
}

.ssh-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ssh-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.query-section-header .ssh-icon {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
}

.results-section-header .ssh-icon {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(45, 212, 191, 0.35);
}

.ssh-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ssh-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: #f8fafc;
}

.query-section-header .ssh-title {
  color: #38bdf8;
}

.results-section-header .ssh-title {
  color: #2dd4bf;
}

.ssh-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

.ssh-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.query-badge {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.results-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #34d399;
}

/* Lưới bộ lọc 2 cột đồng nhất trong Bộ Lọc & Vị Trí Cần Tra Cứu */
.state-filter-grid-2col {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px 16px !important;
  margin-bottom: 14px !important;
  position: relative;
  width: 100% !important;
  box-sizing: border-box;
}

.state-filter-grid-2col > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Ẩn triệt để thanh chọn nhanh đoạn tuyến đường */
#stateSegmentsSelectorWrap,
.state-segments-bar,
.segments-bar-label,
.segments-pills-list,
.segment-pill {
  display: none !important;
}

/* Cascading Dropdowns Row (Legacy fallback) */
.state-filter-cascade-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  margin-bottom: 12px;
}

.state-filter-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  position: relative !important;
  min-width: 0 !important;
  width: 100% !important;
}

.filter-field-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.state-select-control {
  width: 100%;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.state-select-control:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
}

.state-select-control option {
  background: #0f172a;
  color: #f8fafc;
}

/* Custom Searchable Combobox */
.combobox-field {
  position: relative;
  z-index: 10;
}

.combobox-field:focus-within,
.combobox-field.active,
.combobox-field:has(.state-combobox-menu.show),
.state-filter-field:has(.state-combobox-menu.show) {
  z-index: 1200;
}

.state-combobox-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.state-combobox-input {
  width: 100%;
  padding: 8px 52px 8px 11px;
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.state-combobox-input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.state-combobox-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 10.5px;
  cursor: pointer;
  padding: 6px 7px;
  border-radius: 5px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-combobox-toggle:hover {
  color: #2dd4bf;
  background: rgba(255, 255, 255, 0.08);
}

.state-combobox-clear {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
}

.state-combobox-clear:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

/* Dropdown Menu List */
.state-combobox-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(45, 212, 191, 0.35);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 1300;
  padding: 6px;
}

/* Menu Tuyến đường mở rộng full chiều ngang của khối bộ lọc (từ Cột 1 vươn qua Cột 2) */
#stateStreetComboboxWrap .state-combobox-menu {
  left: 0;
  right: auto;
  width: calc(200% + 16px);
  min-width: 100%;
}

/* Menu Phường / Xã mở rộng full chiều ngang của khối bộ lọc (từ Cột 2 vươn qua Cột 1) */
#stateWardComboboxWrap .state-combobox-menu {
  right: 0;
  left: auto;
  width: calc(200% + 16px);
  min-width: 100%;
}

.state-combobox-menu.show {
  display: block !important;
}

/* Custom Scrollbar for Dropdown */
.state-combobox-menu::-webkit-scrollbar {
  width: 6px;
}

.state-combobox-menu::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 10px;
}

.state-combobox-menu::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 10px;
}

.state-combobox-menu::-webkit-scrollbar-thumb:hover {
  background: #0d9488;
}

/* Group Headers */
.combobox-group-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 10px;
  margin: 2px 0 3px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
}

.group-kv-1 {
  background: rgba(13, 148, 136, 0.25);
  color: #2dd4bf;
  border-left: 3px solid #2dd4bf;
}

.group-kv-2 {
  background: rgba(2, 132, 199, 0.25);
  color: #38bdf8;
  border-left: 3px solid #38bdf8;
}

.group-kv-3 {
  background: rgba(217, 119, 6, 0.25);
  color: #fbbf24;
  border-left: 3px solid #fbbf24;
}

.group-kv-4 {
  background: rgba(147, 51, 234, 0.25);
  color: #c084fc;
  border-left: 3px solid #c084fc;
}

/* Combobox Item */
.combobox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  min-height: 38px;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.combobox-item:hover,
.combobox-item.is-selected {
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
}

.combobox-item.active-item {
  background: rgba(13, 148, 136, 0.35);
  color: #2dd4bf;
  font-weight: 700;
}

.combobox-item-left {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combobox-item-name {
  color: #f8fafc;
  font-weight: 600;
}

.combobox-item-sub {
  font-size: 11px;
  color: #94a3b8;
}

.combobox-item-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.combobox-badge-count {
  font-size: 10.5px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.combobox-badge-zone {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.zone-pill-1 { background: rgba(13, 148, 136, 0.25); color: #2dd4bf; border: 1px solid rgba(45, 212, 191, 0.3); }
.zone-pill-2 { background: rgba(2, 132, 199, 0.25); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.zone-pill-3 { background: rgba(217, 119, 6, 0.25); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.zone-pill-4 { background: rgba(147, 51, 234, 0.25); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.3); }

.combobox-no-results {
  padding: 16px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 12.5px;
}

/* Highlight text */
.match-highlight {
  color: #2dd4bf;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Autocomplete Tuyến đường Dropdown Menu */
.state-street-menu {
  max-height: 310px;
}

.street-item-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.street-item-row:last-child {
  border-bottom: none;
}

.street-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.street-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.street-item-seg {
  font-size: 11.5px;
  color: #94a3b8;
}

.street-toggle {
  right: 6px;
}

.zone-badge-field {
  justify-content: flex-end;
}

.state-zone-badge-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.25) 0%, rgba(2, 132, 199, 0.25) 100%);
  border: 1.5px solid #0d9488;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #2dd4bf;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.2);
}

.state-street-input-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  width: 100%;
  margin-bottom: 0;
}

/* Bộ chọn đoạn đường */
.state-segment-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0;
}

.segment-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.segment-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.3);
}

/* Fallback Grid 2 cột: Nhóm loại đất & Loại đất chi tiết */
.state-land-type-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .state-land-type-grid-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.state-category-select-wrap,
.state-specific-type-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0;
}

.state-input-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.state-input-field-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.state-street-input {
  width: 100%;
  padding: 9px 52px 9px 12px;
  border-radius: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
  outline: none;
  background: rgba(30, 41, 59, 0.85);
  transition: all 0.2s ease;
}

.state-street-input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
  background: rgba(30, 41, 59, 0.95);
}

.state-street-clear-btn {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
}

.state-street-clear-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

/* Mobile Media Queries cho Combobox */
@media (max-width: 768px) {
  .state-combobox-input,
  .state-street-input {
    font-size: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .combobox-item {
    padding: 12px 14px;
    min-height: 44px; /* Chuẩn touch target di động */
  }

  .state-combobox-menu {
    max-height: 250px;
  }
}

.btn-state-search-exec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
  flex-shrink: 0;
}

.btn-state-search-exec:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.btn-state-search-exec:active {
  transform: translateY(0);
}

/* Nhóm Đất Select Wrap & Search Button Row */
.state-category-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.state-search-btn-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.btn-state-search-exec.full-search-btn {
  width: 100%;
  height: 44px;
  font-size: 14.5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 3 Nhóm Đất Nav Tabs (Dự phòng tương thích) */
.state-category-nav-wrap {
  margin-bottom: 12px;
}

.state-category-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(11, 19, 30, 0.6);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cat-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cat-nav-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.cat-nav-btn.active {
  background: #0f766e;
  color: #ffffff;
  border-color: #2dd4bf;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.4);
}

/* Special Options Box (Checkbox Grid) */
.state-special-options-box {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
}

.special-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.sbh-icon {
  font-size: 14px;
}

.sbh-title {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
}

.special-checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
}

.special-chk-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  line-height: 1.35;
}

.special-chk-item input[type="checkbox"] {
  accent-color: #0d9488;
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.special-chk-item:hover {
  color: #ffffff;
}

.special-chk-item.disabled,
.special-chk-item:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
  color: #64748b !important;
}

.special-chk-item input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Initial Ready State */
.state-price-initial-wrap {
  text-align: center;
  padding: 36px 20px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 12px;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  margin-bottom: 14px;
}

.state-initial-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.state-initial-title {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 8px;
}

.state-initial-desc {
  font-size: 13px;
  color: #94a3b8;
  max-width: 520px;
  margin: 0 auto 16px;
  line-height: 1.55;
}

.state-initial-tips {
  max-width: 540px;
  margin: 0 auto 20px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  text-align: left;
}

.tip-item {
  font-size: 12px;
  color: #fde68a;
  line-height: 1.5;
}

.btn-initial-start {
  padding: 10px 22px;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.25);
  transition: all 0.2s ease;
}

.btn-initial-start:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Loading */
.state-price-loading-wrap {
  text-align: center;
  padding: 36px 16px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.state-price-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 3.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: #0d9488;
  border-right-color: #0284c7;
  border-radius: 50%;
  animation: stateSpin 0.9s linear infinite;
}

@keyframes stateSpin {
  to { transform: rotate(360deg); }
}

.state-price-loading-wrap h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.state-price-loading-wrap p {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

/* Result Wrap (Khối 2: Kết Quả Đơn Giá Bảng Giá Đất) */
.state-price-result-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.state-results-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  margin-top: 14px;
  color: #0f172a;
}

.state-results-panel .results-section-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.state-results-panel .results-section-header .ssh-icon {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #059669;
}

.state-results-panel .results-section-header .ssh-title {
  color: #0f172a;
}

.state-results-panel .results-section-header .ssh-sub {
  color: #64748b;
}

.state-results-panel .results-badge {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* Banner Đoạn đường & Loại đất đang xem */
.state-current-selection-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
}

.scsb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.scsb-lbl {
  color: #64748b;
  font-weight: 500;
}

.scsb-val {
  font-weight: 700;
}

.text-emerald {
  color: #059669;
}

.text-cyan {
  color: #0284c7;
}

/* Decision Banner */
.state-decision-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(13, 148, 136, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 12px;
}

.banner-icon {
  font-size: 24px;
}

.banner-content {
  flex: 1;
}

.banner-content strong {
  display: block;
  font-size: 13.5px;
  color: #2dd4bf;
  font-weight: 700;
}

.banner-sub {
  font-size: 12px;
  color: #7dd3fc;
  margin-top: 2px;
}

.banner-status-tag {
  font-size: 11px;
  font-weight: 700;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.18);
  border: 1px solid rgba(45, 212, 191, 0.4);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Segment Bar & Pills */
.state-segments-bar {
  background: rgba(15, 23, 42, 0.85);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 10px;
  margin-bottom: 2px;
}

.segments-bar-label {
  font-size: 12px;
  font-weight: 700;
  color: #2dd4bf;
  margin-bottom: 8px;
}

.segments-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segment-pill {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-pill:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #2dd4bf;
  color: #ffffff;
}

.segment-pill.active {
  background: #0f766e;
  color: #ffffff;
  border-color: #2dd4bf;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.4);
}

/* 3 Phi Nông Nghiệp Cards Grid */
.state-pnn-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.state-pnn-cards-grid.has-single-card {
  grid-template-columns: 1fr;
  max-width: 580px;
  margin: 0 auto;
}

.pnn-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.pnn-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

.pnn-card.res-card {
  border-color: #6ee7b7;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.pnn-card.comm-card {
  border-color: #7dd3fc;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}

.pnn-card.ind-card {
  border-color: #c4b5fd;
  background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}

.pnn-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.pnn-badge {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.res-badge { color: #059669; }
.comm-badge { color: #0284c7; }
.ind-badge { color: #7c3aed; }

.pnn-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.pnn-price-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pnn-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
}

.pnn-price-row.vt1-row {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.pnn-vt-info {
  display: flex;
  flex-direction: column;
}

.pnn-vt-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
}

.pnn-vt-desc {
  font-size: 10px;
  color: #64748b;
}

.pnn-vt-val {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.vt1-row .pnn-vt-val {
  color: #059669;
  font-size: 14.5px;
  font-weight: 900;
}

/* Đất Nông Nghiệp Table */
.state-agri-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #86efac;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.agri-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.agri-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: #15803d;
}

.agri-zone-tag {
  font-size: 11px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 2px 8px;
  border-radius: 6px;
}

.price-unit-tag {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 6px;
}

.agri-table-responsive {
  overflow-x: auto;
}

.state-agri-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.state-agri-table th,
.state-agri-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.state-agri-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 2px solid #cbd5e1;
}

.state-agri-table th small {
  font-weight: 500;
  color: #64748b;
}

.state-agri-table td {
  color: #1e293b;
}

.state-agri-table tbody tr:hover {
  background: #f8fafc;
}

.state-agri-table tbody tr.agri-special-row {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
}

.state-agri-table tbody tr.agri-special-row:hover {
  background: #fef08a !important;
}

.agri-price-vt {
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  white-space: nowrap;
}

.agri-price-vt.vt1 {
  color: #059669;
  font-weight: 800;
}

/* Đất NN Khác Card */
.state-other-land-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #fde047;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.other-card-header {
  font-size: 13.5px;
  font-weight: 800;
  color: #854d0e;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #fef08a;
}

.other-rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.other-rule-item strong {
  display: block;
  font-size: 12.5px;
  color: #713f12;
  margin-bottom: 4px;
}

.other-rule-item p {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

/* Collapsible Drawers Section (Nút bấm mở rộng Căn cứ pháp lý & Chú thích) */
.state-drawers-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.state-legal-drawer {
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  transition: all 0.2s ease;
  overflow: hidden;
}

.state-legal-drawer[open] {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.1);
}

.state-drawer-toggle-btn {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  user-select: none;
  background: #f8fafc;
  transition: all 0.15s ease;
}

.state-drawer-toggle-btn::-webkit-details-marker {
  display: none;
}

.state-drawer-toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.state-legal-drawer[open] .state-drawer-toggle-btn {
  background: #f0f9ff;
  border-bottom: 1px solid #e0f2fe;
  color: #0369a1;
}

.sdt-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sdt-left svg {
  color: #0284c7;
  flex-shrink: 0;
}

.sdt-title {
  font-size: 13px;
  font-weight: 700;
}

.sdt-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sdt-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #475569;
}

.state-legal-drawer[open] .sdt-tag {
  background: #e0f2fe;
  color: #0369a1;
}

.sdt-chevron {
  color: #64748b;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.state-legal-drawer[open] .sdt-chevron {
  transform: rotate(180deg);
  color: #0284c7;
}

.state-drawer-body {
  padding: 14px 16px;
  background: #ffffff;
}

/* Detail Cards Grid */
.state-detail-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.state-detail-card {
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.state-decision-detail-card {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
}

.sde-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.sde-title-row strong {
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  line-height: 1.35;
}

.sde-sub-text {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.4;
}

.sde-zone-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.sde-zone-label {
  font-size: 11.5px;
  color: #475569;
  font-weight: 600;
}

.state-zone-badge-pill {
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 2px 8px;
  border-radius: 6px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.card-content-body {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.55;
  flex: 1;
}

/* State Legal Notes Box */
.state-legal-note-box {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
}

.state-legal-note-box.pnn-notes {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.state-legal-note-box.agri-notes {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.legal-note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.lnh-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0369a1;
}

.state-legal-note-box.agri-notes .lnh-title {
  color: #15803d;
}

.legal-note-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
}

.legal-note-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 10px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.lni-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lni-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
}

.lni-desc {
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .legal-note-grid {
    grid-template-columns: 1fr;
  }
}

.state-legal-disclaimer {
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
}

/* Footer */
.state-price-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  background: rgba(11, 19, 30, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-state-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.btn-state-copy:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-state-close {
  padding: 9px 18px;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-state-close:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: #00BAF2;
}

@media (max-width: 900px) {
  .state-filter-cascade-row {
    grid-template-columns: 1fr;
  }
  .state-category-nav {
    grid-template-columns: 1fr;
  }
  .special-checkboxes-grid {
    grid-template-columns: 1fr;
  }
  .state-pnn-cards-grid {
    grid-template-columns: 1fr;
  }
  .state-detail-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .state-vt-grid,
  .state-detail-cards-grid {
    grid-template-columns: 1fr;
  }
  .state-price-location-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .state-loc-divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .state-filter-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #stateStreetComboboxWrap .state-combobox-menu,
  #stateWardComboboxWrap .state-combobox-menu {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* =========================================================================
   ADMIN LAND PRICE DOCUMENTS MANAGEMENT (GOOGLE CLOUD RAG) STYLES
   ========================================================================= */

.land-docs-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.land-docs-modal-overlay.active {
  display: flex !important;
}

.land-docs-modal-card {
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: stateModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.land-docs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0b131e 0%, #0f172a 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.land-docs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.land-docs-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.35), rgba(0, 186, 242, 0.35));
  border: 1px solid rgba(45, 212, 191, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.land-docs-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.land-docs-title-row h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #f8fafc;
}

.land-docs-badge-rag {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.land-docs-badge-prov {
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.land-docs-header-sub {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.land-docs-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.land-docs-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.land-docs-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(92vh - 130px);
  background: #0b131e;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.land-docs-upload-card,
.land-docs-list-card {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ld-card-head,
.ld-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.ld-lh-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ld-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

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

.ld-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.ld-input,
.ld-select,
.ld-filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12.5px;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.85);
  outline: none;
  transition: all 0.2s ease;
}

.ld-input:focus,
.ld-select:focus,
.ld-filter-select:focus {
  border-color: #00BAF2;
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25);
  background: rgba(30, 41, 59, 0.95);
}

.ld-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
  background: rgba(30, 41, 59, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 12px;
}

.ld-dropzone:hover,
.ld-dropzone.dragover {
  border-color: #00BAF2;
  background: rgba(0, 186, 242, 0.08);
}

.ld-file-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.ld-dropzone-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.ld-dropzone-text {
  font-size: 13px;
  color: #f8fafc;
  margin-bottom: 2px;
}

.ld-dropzone-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

.ld-selected-file {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.ld-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ld-upload-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.btn-ld-upload-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-ld-upload-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ld-reset {
  padding: 9px 14px;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
}

.btn-ld-reset:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
}

.btn-ld-refresh {
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.8);
  color: #2dd4bf;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  cursor: pointer;
}

.btn-ld-refresh:hover {
  background: rgba(51, 65, 85, 0.9);
}

.ld-table-wrap {
  overflow-x: auto;
}

.ld-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ld-table th {
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.ld-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  vertical-align: middle;
}

.ld-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.ld-province-pill {
  display: inline-block;
  font-weight: 700;
  font-size: 11.5px;
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
}

.ld-doc-title {
  font-weight: 700;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.35;
}

.ld-doc-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.ld-doc-notes {
  font-size: 11px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  border-left: 2px solid #f59e0b;
  padding: 2px 6px;
  margin-top: 4px;
  border-radius: 2px;
}

.ld-file-name {
  font-size: 11.5px;
  color: #cbd5e1;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ld-file-size {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.ld-date {
  font-size: 11.5px;
  color: #94a3b8;
}

.ld-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}

.ld-status-badge.ld-status-active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.ld-status-badge.ld-status-pending {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.ld-google-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.ld-google-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-ld-open-google {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(0, 186, 242, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(0, 186, 242, 0.35);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 186, 242, 0.1);
}

.btn-ld-open-google:hover {
  background: rgba(0, 186, 242, 0.25);
  color: #ffffff;
  border-color: #00BAF2;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 186, 242, 0.25);
}

.btn-ld-copy-uri {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ld-copy-uri:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: #00BAF2;
  transform: translateY(-1px);
}

.ld-google-file-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.8);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-ld-delete {
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ld-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.land-docs-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(11, 19, 30, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ld-footer-info {
  font-size: 11.5px;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .ld-form-grid {
    grid-template-columns: 1fr;
  }
  .land-docs-modal-footer {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   ADMIN MANAGEMENT TABS & USER CRUD MODAL
   ========================================================================== */

.admin-modal-tabs {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  padding: 6px 8px;
  border-radius: 12px;
  margin: 14px 24px 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.admin-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.admin-tab-btn.active {
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.35);
}

.admin-tab-content {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.admin-tab-content.active {
  display: block;
}

/* User Management Toolbar */
.user-manage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.user-manage-stats {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.8);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-add-user-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #00BAF2 0%, #0072CE 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 186, 242, 0.3);
  transition: all 0.2s ease;
}

.btn-add-user-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 186, 242, 0.45);
}

.btn-add-user-primary:active {
  transform: translateY(0);
}

/* User Roles & Scope Badges */
.user-badge-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.user-badge-admin {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.user-badge-manager-1 {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.user-badge-manager-2 {
  background: rgba(192, 132, 252, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.4);
}

.user-badge-editor {
  background: rgba(0, 186, 242, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(0, 186, 242, 0.4);
}

.user-badge-viewer {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.4);
}

.user-badge-tester {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.user-badge-surveyor {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pwd-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 10px;
  font-size: 15px;
  opacity: 0.65;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pwd-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.user-badge-scope {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.user-badge-scope-all {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* User Table Action Buttons */
.user-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-user-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-user-edit {
  background: rgba(0, 186, 242, 0.15);
  color: #38bdf8;
  border-color: rgba(0, 186, 242, 0.35);
}

.btn-user-edit:hover {
  background: rgba(0, 186, 242, 0.25);
  color: #ffffff;
  border-color: #00BAF2;
  transform: translateY(-1px);
}

.btn-user-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-user-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.btn-user-action:disabled,
.btn-user-action.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(30, 41, 59, 0.5);
  color: #64748b;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Admin User Form Sub-modal */
.user-form-card {
  max-width: 480px;
  width: 92%;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #0b131e 0%, #0f172a 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-form-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f8fafc;
}

.user-form-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 75vh;
  overflow-y: auto;
  background: #0b131e;
  color: #f8fafc;
}

.user-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(11, 19, 30, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* User Management Toolbar & Search */
.user-manage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.user-manage-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
}

.user-search-icon {
  position: absolute;
  left: 10px;
  font-size: 13px;
  color: #94a3b8;
  pointer-events: none;
}

.user-search-input {
  width: 100%;
  padding: 8px 32px 8px 30px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 13px;
  transition: all 0.2s ease;
  outline: none;
}

.user-search-input:focus {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.btn-clear-user-search {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.btn-clear-user-search:hover {
  color: #f8fafc;
}

.user-search-feedback {
  font-size: 12px;
  color: #38bdf8;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 6px;
  display: inline-block;
}

/* User Table Row Clickable */
.perm-users-table tbody tr.user-row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.perm-users-table tbody tr.user-row-clickable:hover {
  background: rgba(56, 189, 248, 0.08) !important;
}

.btn-user-detail {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.35);
}

.btn-user-detail:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #ffffff;
  border-color: #a855f7;
  transform: translateY(-1px);
}

/* User Detail Modal */
.user-detail-card {
  max-width: 720px;
  width: 95%;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.95));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-detail-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-detail-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00BAF2, #0072CE);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 186, 242, 0.35);
  flex-shrink: 0;
}

.user-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-detail-title-row h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
}

.user-detail-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: #94a3b8;
}

.user-detail-body {
  padding: 20px 22px;
  max-height: 72vh;
  overflow-y: auto;
}

.user-detail-section-title {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.user-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  background: rgba(15, 23, 42, 0.6);
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.profile-info-item.full-width {
  grid-column: span 2;
}

.profile-info-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-info-val {
  font-size: 13px;
  color: #f1f5f9;
  font-weight: 500;
  word-break: break-word;
}

/* User API Stats Row */
.user-api-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.user-stat-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.stat-card-num {
  font-size: 18px;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1.2;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

/* User API Logs Table */
.user-api-logs-wrap {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.5);
}

.user-api-logs-header {
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.user-api-logs-table-scroll {
  max-height: 220px;
  overflow-y: auto;
}

.user-api-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.user-api-logs-table th {
  text-align: left;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #94a3b8;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-api-logs-table td {
  padding: 6px 10px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-api-logs-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Modal Footer & Buttons */
.user-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(15, 23, 42, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 10px;
}

.user-detail-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-perm-danger {
  padding: 9px 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-perm-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
  border-color: #ef4444;
}

.btn-perm-warning {
  padding: 9px 16px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  color: #fbbf24;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Reset Password Modal */
.reset-pwd-card {
  max-width: 440px;
  width: 92%;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-group-custom {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group-custom label {
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
}

.form-group-custom .form-input,
.form-group-custom .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 13.5px;
  color: #f8fafc;
  background-color: rgba(30, 41, 59, 0.85);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group-custom .form-input:focus,
.form-group-custom .form-select:focus {
  border-color: #00BAF2;
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25);
  background-color: rgba(30, 41, 59, 0.95);
}

.form-group-custom .form-input:disabled {
  background-color: rgba(15, 23, 42, 0.6);
  color: #64748b;
  cursor: not-allowed;
}

.form-group-custom .help-text,
.form-hint-custom {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.form-label-custom {
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-input-custom,
.form-select-custom {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 13.5px;
  color: #f8fafc;
  background-color: rgba(30, 41, 59, 0.85);
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-input-custom:focus,
.form-select-custom:focus {
  border-color: #00BAF2;
  box-shadow: 0 0 0 3px rgba(0, 186, 242, 0.25);
  background-color: rgba(30, 41, 59, 0.95);
}

.form-input-custom:disabled {
  background-color: rgba(15, 23, 42, 0.6);
  color: #64748b;
  cursor: not-allowed;
}

.form-row-custom {
  display: flex;
  gap: 12px;
}

.user-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-manage-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.user-manage-subtitle {
  font-size: 12px;
  color: #94a3b8;
}

/* ==========================================================================
   ADMIN API KEYS & AI MODELS MANAGEMENT MODAL
   ========================================================================== */

.admin-apikeys-card {
  max-width: 620px;
  width: 94%;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-key-section-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.admin-key-section-card:hover {
  border-color: rgba(0, 186, 242, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.admin-key-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 8px;
}

.admin-key-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-key-icon {
  font-size: 20px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-key-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.admin-key-subtitle {
  font-size: 11.5px;
  color: #94a3b8;
  display: block;
  margin-top: 1px;
}

.admin-key-section-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-key-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.admin-key-input-wrap .form-input-custom {
  padding-right: 38px;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 12.5px !important;
}

.btn-toggle-key-eye {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #94a3b8;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-toggle-key-eye:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.btn-sync-models {
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-sync-models:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #312e81;
}

/* =========================================================================
   POPUP MODAL TRA CỨU & LỌC DỮ LIỆU ĐỊNH GIÁ NGÂN HÀNG (GLASSMORPHISM)
========================================================================= */
.val-search-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.val-search-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.val-search-modal-card {
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  height: 88vh;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: valModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes valModalPop {
  0% {
    transform: scale(0.95) translateY(12px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Header */
.val-search-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(135deg, #0b131e 0%, #0f172a 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.val-modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.val-modal-icon-wrap {
  width: 42px;
  height: 42px;
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.val-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.val-modal-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.val-header-badge {
  background: rgba(0, 186, 242, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 12px;
}

/* Modal Body */
.val-search-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #0b131e;
  color: #f8fafc;
  box-sizing: border-box;
  width: 100%;
}

/* 1. Smart Search Box */
.val-smart-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.val-search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.val-search-input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 42px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  font-size: 13.5px;
  color: #f8fafc;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.val-search-input:focus {
  border-color: #00BAF2;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 3.5px rgba(0, 186, 242, 0.25);
}

.val-clear-search-btn {
  position: absolute;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s ease;
}

.val-clear-search-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* 2. Filter Section & Grid */
.val-filter-section {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.val-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.val-filter-grid-ranges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  width: 100%;
  box-sizing: border-box;
}

.val-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.val-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.val-filter-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12px;
  color: #f8fafc;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.val-filter-select:focus {
  border-color: #00BAF2;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 2px rgba(0, 186, 242, 0.2);
}

.val-range-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.val-range-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12px;
  color: #f8fafc;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.val-range-input:focus {
  border-color: #00BAF2;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 2px rgba(0, 186, 242, 0.2);
}

.range-sep {
  color: #94a3b8;
  font-weight: 600;
  font-size: 12px;
}

/* 3. Results Summary Row */
.val-results-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.val-summary-text {
  font-size: 13px;
  color: #cbd5e1;
}

.val-summary-text strong {
  color: #00BAF2;
  font-size: 15px;
  font-weight: 700;
}

.val-btn-inline-reset {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.val-btn-inline-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

/* 4. Results List & Cards */
.val-results-container {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

.val-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.val-result-card {
  padding: 12px 14px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.val-result-card:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #00BAF2;
  box-shadow: 0 4px 12px rgba(0, 186, 242, 0.2);
  transform: translateY(-1.5px);
}

.val-result-card.active-selected {
  border-color: #00BAF2;
  background: rgba(0, 114, 206, 0.25);
  box-shadow: 0 0 0 2px rgba(0, 186, 242, 0.4);
}

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

.val-card-gcn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 186, 242, 0.15);
  border: 1px solid rgba(0, 186, 242, 0.35);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.val-card-date {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.val-card-owner {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}

.val-card-address {
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}

.val-card-metrics-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.val-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.val-metric-area {
  background: rgba(15, 23, 42, 0.8);
  color: #cbd5e1;
}

.val-metric-unitprice {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.val-metric-totalval {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-weight: 700;
}

.val-metric-valuator {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  margin-left: auto;
  font-size: 11px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.val-card-gcn-badge svg,
.val-card-date svg,
.val-metric-pill svg {
  flex-shrink: 0;
}

/* Empty State */
.val-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  text-align: center;
  color: #94a3b8;
  gap: 8px;
}

.val-empty-icon {
  font-size: 36px;
  opacity: 0.8;
}

.val-empty-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.val-empty-sub {
  font-size: 12px;
  color: #94a3b8;
}

/* Footer */
.val-search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(11, 19, 30, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.val-footer-left,
.val-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.val-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #00BAF2 0%, #0072CE 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 186, 242, 0.3);
  transition: all 0.2s ease;
}

.val-btn-primary:hover {
  background: linear-gradient(135deg, #0072CE 0%, #005bb5 100%);
  box-shadow: 0 6px 16px rgba(0, 186, 242, 0.45);
  transform: translateY(-1px);
}

.val-btn-primary:active {
  transform: translateY(0);
}

.val-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.val-btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #00BAF2;
  color: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .val-search-modal-card {
    height: 95vh;
    max-height: 95vh;
    border-radius: 16px;
  }

  .val-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .val-filter-grid-ranges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .val-search-modal-header,
  .val-search-modal-body,
  .val-search-modal-footer {
    padding: 12px 14px;
  }

  .val-modal-title {
    font-size: 15px;
  }

  .val-footer-left {
    display: none; /* Ẩn nút xuất excel trên màn hình nhỏ để ưu tiên nút bấm chính */
  }

  .val-footer-right {
    width: 100%;
    justify-content: flex-end;
  }

  .val-metric-valuator {
    margin-left: 0;
    max-width: 100%;
  }
}

/* =========================================================================
   GOOGLE MAPS INFOWINDOW & TOOLTIP DARK GLASSMORPHISM OVERRIDES
   ========================================================================= */
.gm-style .gm-style-iw-c {
  background: rgba(11, 19, 30, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 14px !important;
  color: #f8fafc !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
  padding: 12px 14px !important;
}

.gm-style .gm-style-iw-tc::after {
  background: rgba(11, 19, 30, 0.96) !important;
}

.gm-style-iw-d {
  overflow: auto !important;
  color: #f8fafc !important;
}

.gm-style-iw-d b,
.gm-style-iw-d strong {
  color: #f8fafc;
}

.gm-style-iw-d span {
  color: inherit;
}

.gm-ui-hover-effect {
  filter: invert(1) !important;
  opacity: 0.75 !important;
}

.gm-ui-hover-effect:hover {
  opacity: 1 !important;
}

/* =========================================================================
   CÔNG CỤ ĐO KHOẢNG CÁCH & DIỆN TÍCH (FLOATING MEASUREMENT HUD)
   ========================================================================= */
.measure-distance-hud {
  position: fixed;
  top: 72px;
  right: 18px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.2);
  padding: 14px 16px;
  z-index: 1100;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  animation: measureHudSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

@keyframes measureHudSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.measure-hud-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.measure-hud-icon {
  font-size: 16px;
}

.btn-measure-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.measure-hud-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.measure-stat-card {
  padding: 10px 12px;
  border-radius: 12px;
  transition: all 0.25s ease;
}

.measure-stat-card.card-distance {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(14, 165, 233, 0.06));
  border: 1px solid rgba(6, 182, 212, 0.28);
}

.measure-stat-card.card-area {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.06));
  border: 1px solid rgba(16, 185, 129, 0.32);
  animation: measureHudFadeIn 0.25s ease;
}

@keyframes measureHudFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.measure-stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.measure-stat-card .stat-icon {
  font-size: 13px;
}

.measure-stat-card .stat-value {
  font-size: 21px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.measure-stat-card.card-distance .stat-value {
  color: #22d3ee;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

.measure-stat-card.card-area .stat-value {
  color: #34d399;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

.measure-stat-card .stat-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}

.measure-hud-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 7px 10px;
  margin-top: 10px;
  font-size: 12px;
  color: #cbd5e1;
}

.hint-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  flex-shrink: 0;
  animation: measurePulse 1.6s infinite ease-in-out;
}

@keyframes measurePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.45);
    opacity: 1;
    box-shadow: 0 0 14px #38bdf8;
  }
}

.measure-hud-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-measure-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-measure-action:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
}

.btn-measure-undo {
  background: rgba(51, 65, 85, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

.btn-measure-undo:hover:not(:disabled) {
  background: rgba(71, 85, 105, 0.9);
  border-color: rgba(148, 163, 184, 0.45);
  color: #ffffff;
}

.btn-measure-reset {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-measure-reset:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ffffff;
}

.btn-measure-finish {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.35);
}

.btn-measure-finish:hover {
  background: linear-gradient(135deg, #0891b2, #0369a1);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

/* RESPONSIVE TRÊN THIẾT BỊ DI ĐỘNG */
@media (max-width: 640px) {
  .measure-distance-hud {
    top: 66px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
    padding: 12px 14px;
  }

  .measure-stat-card .stat-value {
    font-size: 19px;
  }
}

/* =========================================================================
   GULAND MARKET POST RICH INFOWINDOW & DETAIL CARD
   ========================================================================= */
.market-post-card {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #f8fafc;
  max-width: 320px;
  min-width: 270px;
  max-height: 480px;
  overflow-y: auto;
  padding: 2px 2px 4px 2px;
}

.market-post-title-link {
  color: #38bdf8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

.market-post-title-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.market-post-thumb-wrap {
  width: 100%;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background-color: #1e293b;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.market-post-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.market-post-thumb-wrap:hover .market-post-thumb-img {
  transform: scale(1.04);
}

.market-post-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
}

.market-post-spec-item {
  display: flex;
  flex-direction: column;
}

.market-post-spec-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.market-post-spec-val {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.market-post-spec-val.highlight {
  color: #f43f5e;
  font-size: 13.5px;
}

.market-post-seller-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.market-post-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #38bdf8;
  background: #334155;
  flex-shrink: 0;
}

.market-post-seller-info {
  flex: 1;
  min-width: 0;
}

.market-post-seller-name {
  font-weight: 700;
  font-size: 12.5px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-post-seller-time {
  font-size: 11px;
  color: #94a3b8;
}

.market-post-contact-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.btn-market-contact {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  color: #ffffff !important;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-market-call {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-market-call:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

.btn-market-zalo {
  background: linear-gradient(135deg, #0284c7, #0068ff);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.btn-market-zalo:hover {
  background: linear-gradient(135deg, #0369a1, #0052cc);
  transform: translateY(-1px);
}

.market-post-desc-box {
  background: rgba(15, 23, 42, 0.5);
  border-left: 2.5px solid #38bdf8;
  padding: 6px 8px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #cbd5e1;
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 8px;
  max-height: 70px;
  overflow-y: auto;
}

.market-post-features-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.market-post-feat-tag {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 6px;
  font-weight: 500;
}

.market-post-header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.market-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.market-badge.guland {
  background: rgba(2, 132, 199, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.market-badge.meeyland {
  background: rgba(234, 88, 12, 0.18);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.4);
}

.market-post-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.btn-market-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 12px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 7px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.btn-market-action-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
}

.btn-market-action-primary.btn-meeyland {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  border: 1px solid rgba(251, 146, 60, 0.45);
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.35);
}

.btn-market-action-primary.btn-meeyland:hover {
  background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.45);
}

.btn-market-action-sec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 6px 10px;
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0 !important;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.btn-market-action-sec:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
}

.market-post-loading-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #38bdf8;
  font-size: 12px;
  font-style: italic;
  margin-bottom: 8px;
}

/* =========================================================================
   DROPDOWN GỢI Ý ĐỊA BÀN PHƯỜNG/XÃ (KHI NHẬP SỐ THỬA / SỐ TỜ)
   ========================================================================= */
.parcel-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: rgba(11, 19, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 10000000 !important;
  display: flex;
  flex-direction: column;
  padding: 4px;
  animation: suggFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes suggFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.parcel-sugg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.parcel-sugg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #f1f5f9;
  border: 1px solid transparent;
}

.parcel-sugg-item:hover,
.parcel-sugg-item.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.parcel-sugg-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.parcel-sugg-ward {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.parcel-sugg-district {
  font-size: 11.5px;
  color: #94a3b8;
}

.parcel-sugg-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.parcel-sugg-empty {
  padding: 12px;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
  font-style: italic;
}

/* ==========================================================================
   STREET PRICE FILTER MODAL (LỌC TUYẾN ĐƯỜNG THEO ĐƠN GIÁ ĐẤT)
   ========================================================================== */

/* Nút trigger từ Modal Tra cứu giá đất */
.btn-state-filter-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(13, 148, 136, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-state-filter-open:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(13, 148, 136, 0.4));
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  transform: translateY(-1px);
}

.btn-state-filter-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(20, 184, 166, 0.22));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-state-filter-inline:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(20, 184, 166, 0.35));
  color: #ffffff;
  border-color: #38bdf8;
}

/* Modal Overlay & Container */
.spf-modal-overlay {
  z-index: 100050 !important;
}

.spf-modal-card {
  max-width: 1020px !important;
  width: 95% !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #0f172a !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(14, 165, 233, 0.15) !important;
}

.spf-icon-wrap {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(13, 148, 136, 0.35)) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
}

.spf-modal-body {
  padding: 16px 20px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
}

/* Panel Controls */
.spf-controls-panel {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

/* Location & Land Type Row */
.spf-location-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.3fr;
  gap: 12px;
}

.spf-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spf-field-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: #94a3b8;
}

.spf-select-control {
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #0b131e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
}

.spf-select-control:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* 3-Segment Land Type Tabs */
.spf-land-type-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spf-section-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: #94a3b8;
}

.spf-land-type-tabs {
  display: flex;
  background: #0b131e;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 4px;
}

.spf-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spf-type-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.spf-type-btn.active {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

/* Price Filter Section */
.spf-price-filter-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spf-price-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #cbd5e1;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
  flex-wrap: wrap;
}

.spf-meta-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  line-height: 1.5;
  color: #cbd5e1;
  flex: 1;
}

.spf-meta-info strong {
  color: #38bdf8;
  font-weight: 700;
}

.spf-btn-reset-price {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.spf-btn-reset-price:hover {
  color: #f8fafc;
  border-color: #38bdf8;
}

/* Stepper Inputs */
.spf-inputs-stepper-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spf-stepper-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spf-stepper-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.spf-stepper-controls {
  display: flex;
  align-items: center;
  background: #0b131e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
}

.spf-step-btn {
  width: 52px;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
}

.spf-step-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #ffffff;
}

.spf-step-btn:active {
  background: rgba(56, 189, 248, 0.35);
}

.spf-stepper-input {
  flex: 1;
  height: 42px;
  border: none;
  background: transparent;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  outline: none;
  min-width: 0;
}

.spf-stepper-sep {
  color: #64748b;
  font-size: 16px;
  padding-top: 18px;
  font-weight: bold;
}

/* Chips Container */
.spf-chips-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spf-chips-tier-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.spf-chips-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  -webkit-overflow-scrolling: touch;
}

.spf-chips-scroll::-webkit-scrollbar {
  height: 4px;
}

.spf-chips-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.spf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: 18px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
}

.spf-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #38bdf8;
  color: #f8fafc;
}

.spf-chip.active {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.spf-tier2-chips .spf-chip {
  padding: 5px 12px;
  min-height: 32px;
  font-size: 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.8);
}

/* Actions Bar */
.spf-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.spf-search-keyword-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
}

.spf-search-keyword-wrap .kw-icon {
  position: absolute;
  left: 12px;
  color: #64748b;
  font-size: 14px;
}

.spf-keyword-input {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 34px;
  background: #0b131e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}

.spf-keyword-input:focus {
  border-color: #38bdf8;
}

.spf-kw-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.spf-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spf-sort-lbl {
  font-size: 12.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.spf-sort-select {
  height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  background: #0b131e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.spf-btn-execute {
  height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #0d9488);
  border: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.spf-btn-execute:hover {
  background: linear-gradient(135deg, #0369a1, #0f766e);
  transform: translateY(-1px);
}

.spf-exec-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11.5px;
}

.spf-exec-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Results Wrapper (Sáng màu tách bạch so với phần bộ lọc) */
.spf-results-wrapper {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px 20px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.spf-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
  font-size: 13px;
  color: #334155;
}

.spf-summary-text strong {
  color: #0284c7;
  font-weight: 800;
}

.spf-page-info {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.spf-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #64748b;
  gap: 12px;
}

.spf-empty-icon {
  font-size: 40px;
  opacity: 0.7;
}

.spf-state-box h4 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
}

.spf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(2, 132, 199, 0.2);
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Desktop Table */
.spf-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.spf-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #0f172a;
}

.spf-data-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}

.spf-data-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}

.spf-data-table tr:hover td {
  background: #f8fafc;
}

.spf-street-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spf-street-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 13.5px;
}

.spf-street-segment {
  font-size: 11.5px;
  color: #64748b;
}

.spf-col-vt1 {
  color: #059669 !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
}

.btn-goto-street {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-goto-street:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Mobile Cards */
.spf-cards-mobile {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.spf-card-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

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

.spf-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.spf-card-ward {
  font-size: 11.5px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  white-space: nowrap;
}

.spf-card-segment {
  font-size: 12px;
  color: #64748b;
}

.spf-card-prices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.spf-card-price-single {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 10px 14px;
  border-radius: 8px;
}

.spf-card-price-single .spf-cpc-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: #065f46;
}

.spf-card-price-single .spf-cpc-val.vt1-val {
  font-size: 16px;
  font-weight: 800;
  color: #059669;
}

.spf-card-price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spf-cpc-lbl {
  font-size: 11px;
  color: #64748b;
}

.spf-cpc-val {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.spf-cpc-val.vt1-val {
  color: #059669;
}

.spf-card-btn-goto {
  width: 100%;
  height: 44px;
  font-size: 13.5px;
}

/* Pagination */
.spf-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.spf-page-btn {
  padding: 6px 14px;
  height: 36px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.spf-page-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.spf-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.spf-page-numbers {
  display: flex;
  gap: 4px;
}

.spf-page-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.spf-page-num.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* Responsive Media Queries (Mobile Viewport) */
@media (max-width: 768px) {
  .spf-modal-card {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: 94vh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
  }

  .spf-location-row {
    grid-template-columns: 1fr;
  }

  .spf-land-type-tabs {
    flex-direction: column;
  }

  .spf-type-btn {
    height: 42px;
  }

  .spf-inputs-stepper-row {
    flex-direction: column;
    align-items: stretch;
  }

  .spf-stepper-sep {
    display: none;
  }

  .spf-step-btn {
    width: 60px;
    height: 46px;
  }

  .spf-stepper-input {
    height: 46px;
    font-size: 15px;
  }

  .spf-table-responsive {
    display: none;
  }

  .spf-cards-mobile {
    display: flex;
  }

  .spf-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .spf-btn-execute {
    height: 46px;
    justify-content: center;
  }
}

/* ========================================================================= */
/* TÍNH NĂNG: TIỆN ÍCH XUNG QUANH (NEARBY AMENITIES)                         */
/* ========================================================================= */

/* Nút hành động trong Popup Thửa đất */
.btn-nearby-amenities-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
  margin-top: 5px;
}

.btn-nearby-amenities-action:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.45);
}

.btn-nearby-amenities-action .amenities-icon {
  font-size: 14px;
}

/* Modal Tiện ích xung quanh */
.amenities-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.amenities-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.amenities-modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.amenities-modal-header {
  padding: 16px 20px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.amenities-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.amenities-header-icon {
  font-size: 24px;
  background: rgba(2, 132, 199, 0.15);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.amenities-title-main {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.amenities-title-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.btn-amenities-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-amenities-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.amenities-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.amenities-section {
  margin-bottom: 18px;
}

.amenities-section-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* Bán kính selector */
.amenities-radius-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-radius-choice {
  padding: 10px 4px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.btn-radius-choice:hover {
  background: #334155;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-radius-choice.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* Danh mục checkbox grid */
.btn-toggle-all-amenities {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-toggle-all-amenities:hover {
  text-decoration: underline;
}

.amenities-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.amenity-cat-checkbox {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.amenity-cat-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cat-custom-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s;
}

.amenity-cat-checkbox input:checked + .cat-custom-box {
  background: rgba(2, 132, 199, 0.18);
  border-color: #0284c7;
  color: #38bdf8;
  font-weight: 600;
}

.cat-custom-box:hover {
  background: #334155;
}

.cat-icon {
  font-size: 16px;
}

/* Tóm tắt kết quả */
.amenities-results-summary {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 14px;
}

.summary-stat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.summary-stat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-view-amenities-map {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.btn-view-amenities-map:hover {
  background: #0ea5e9;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(2, 132, 199, 0.4);
}

.btn-view-amenities-map:active {
  transform: translateY(0);
}

.btn-clear-amenities-map {
  background: none;
  border: none;
  color: #f87171;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.btn-clear-amenities-map:hover {
  text-decoration: underline;
}

.amenities-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.amenity-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.amenity-stat-pill b {
  color: #38bdf8;
}

.amenities-items-list {
  max-height: 180px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.amenity-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.amenity-item-row:hover {
  background: rgba(2, 132, 199, 0.15);
  border-color: rgba(2, 132, 199, 0.3);
}

.amenity-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.amenity-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.amenity-item-dist {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Footer Modal */
.amenities-modal-footer {
  padding: 12px 20px;
  background: #1e293b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-execute-amenities {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  transition: all 0.2s;
}

.btn-execute-amenities:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.btn-execute-amenities:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* InfoWindow Tiện ích xung quanh (Tương phản cao, chữ sắc nét trên nền Dark Glassmorphism) */
.amenity-infowindow-box {
  font-family: inherit;
  min-width: 230px;
  max-width: 300px;
  padding: 4px 2px;
  color: #f8fafc;
}

.amenity-infowindow-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.amenity-infowindow-icon {
  font-size: 22px;
  line-height: 1;
  padding: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  flex-shrink: 0;
}

.amenity-infowindow-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff !important;
  line-height: 1.35;
  letter-spacing: -0.1px;
}

.amenity-infowindow-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  padding: 1.5px 7px;
  border-radius: 5px;
  margin-top: 4px;
}

.amenity-infowindow-addr {
  font-size: 12px;
  color: #cbd5e1 !important;
  margin-bottom: 8px;
  line-height: 1.4;
  padding-left: 2px;
}

.amenity-infowindow-dist-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  background: rgba(30, 41, 59, 0.8) !important;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 6px;
}

.amenity-infowindow-dist-label {
  color: #94a3b8 !important;
  font-weight: 500;
}

.amenity-infowindow-dist-val {
  font-weight: 800;
  color: #38bdf8 !important;
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

/* =========================================================================
   HỆ THỐNG GHIM CÁ NHÂN & QUẢN LÝ ĐIỂM GHIM (CUSTOM MAP PINS & PIN MANAGER)
   Thống nhất theme Glassmorphism, font Inter/system-ui, tối ưu mobile & iPhone 16 Pro Max
   ========================================================================= */

.custom-pins-control-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
}

.custom-pins-control-row .item-custom-pins {
  flex: 1;
}

/* Modal Form Thêm / Sửa Ghim */
.custom-pin-modal-card {
  max-width: 520px;
  width: 95%;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.custom-pin-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-pin-header-badge {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.custom-pin-modal-body {
  max-height: 82vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.custom-pin-coord-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: #94a3b8;
}

.custom-pin-coord-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.custom-pin-coord-val {
  color: #38bdf8;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 12.5px;
}

.btn-copy-pin-coord {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-copy-pin-coord:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-pin-navigate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 9px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-pin-navigate:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
}

.form-group-pin {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-link-action {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  transition: all 0.15s ease;
}

.btn-link-action:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.inline-add-cat-box {
  background: rgba(30, 41, 59, 0.7);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
}

.inline-cat-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-inline-save {
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-inline-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}

/* Grid Icon Picker */
.pin-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.pin-icon-btn {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.pin-icon-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.pin-icon-btn.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: scale(1.08);
}

/* Palette Color Picker */
.pin-color-picker-palette {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pin-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--btn-color);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.pin-color-btn:hover {
  transform: scale(1.15);
  border-color: #ffffff;
}

.pin-color-btn.active {
  transform: scale(1.22);
  border-color: #ffffff;
  box-shadow: 0 0 10px var(--btn-color);
}

.pin-color-btn.active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Tags Input */
.custom-pin-tags-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 6px 10px;
  min-height: 42px;
}

.custom-pin-tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pin-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.pin-tag-chip .remove-chip-btn {
  cursor: pointer;
  opacity: 0.7;
  font-size: 13px;
  line-height: 1;
}

.pin-tag-chip .remove-chip-btn:hover {
  opacity: 1;
  color: #f43f5e;
}

.pin-tag-field {
  flex: 1;
  min-width: 120px;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 13px;
  padding: 4px 2px;
}

.pin-suggested-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11.5px;
}

.suggest-tag-label {
  color: #94a3b8;
}

.suggest-tag-pill {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggest-tag-pill:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.pin-notes-area {
  min-height: 80px;
  resize: vertical;
}

/* Image Upload Zone */
.pin-photo-compression-badge {
  font-size: 11px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.pin-image-upload-dropzone {
  background: rgba(30, 41, 59, 0.4);
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.pin-image-upload-dropzone.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.upload-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  font-size: 26px;
}

.dropzone-text {
  font-size: 12.5px;
  color: #94a3b8;
}

.dropzone-buttons-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-upload-photos, .btn-camera-capture {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-upload-photos {
  background: rgba(30, 41, 59, 0.8);
  color: #f8fafc;
}

.btn-upload-photos:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: #38bdf8;
}

.btn-camera-capture {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

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

/* Gallery preview thumbnail */
.custom-pin-images-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pin-img-thumb-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0f172a;
}

.pin-img-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pin-img-thumb-card .btn-remove-thumb {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pin-img-thumb-card .btn-remove-thumb:hover {
  background: #ef4444;
  transform: scale(1.1);
}

.pin-img-thumb-card .thumb-size-tag {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 9.5px;
  background: rgba(0, 0, 0, 0.65);
  color: #94a3b8;
  padding: 1px 4px;
  border-radius: 4px;
}

/* Form Actions */
.custom-pin-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-save-pin-primary {
  flex: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
}

.btn-save-pin-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.55);
  transform: translateY(-1px);
}

.btn-cancel-pin-sec {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-cancel-pin-sec:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* =========================================================================
   MODAL QUẢN LÝ GHIM CÁ NHÂN (PIN MANAGER MODAL)
   ========================================================================= */
.custom-pin-manager-card {
  max-width: 820px;
  width: 95%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.custom-pin-mgr-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.custom-pin-mgr-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.custom-pin-search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.custom-pin-search-box .mgr-search-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.custom-pin-search-input {
  width: 100%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 9px 34px 9px 36px;
  color: #f8fafc;
  font-size: 13.5px;
  outline: none;
  transition: all 0.18s ease;
}

.custom-pin-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.btn-clear-search-pin {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
}

.custom-pin-mgr-quick-actions {
  display: flex;
  gap: 8px;
}

.btn-mgr-action-primary, .btn-mgr-action-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-mgr-action-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.btn-mgr-action-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.5);
}

.btn-mgr-action-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-mgr-action-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
}

/* Category Tabs Bar */
.custom-pin-category-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.dynamic-pin-category-pills {
  display: flex;
  gap: 8px;
}

.pin-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pin-cat-pill:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #ffffff;
}

.pin-cat-pill.active {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.pin-cat-pill-count {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 6px;
  border-radius: 10px;
}

.pin-cat-pill.active .pin-cat-pill-count {
  background: #0284c7;
  color: #ffffff;
}

.btn-cat-pill-manage {
  margin-left: auto;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-cat-pill-manage:hover {
  color: #38bdf8;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

/* Tag filter bar */
.pin-mgr-tag-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
}

.tag-filter-title {
  color: #38bdf8;
  font-weight: 600;
}

.btn-clear-tag-filter {
  background: none;
  border: none;
  color: #f43f5e;
  font-size: 16px;
  cursor: pointer;
  margin-left: auto;
}

/* Cards Container */
.custom-pin-cards-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.custom-pin-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.18s ease;
  position: relative;
}

.custom-pin-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.custom-pin-card.pin-hidden {
  opacity: 0.6;
  border-style: dashed;
}

.pin-card-icon-col {
  flex-shrink: 0;
}

.pin-card-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.pin-card-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pin-card-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pin-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #f8fafc;
  word-break: break-word;
}

.pin-card-cat-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.pin-card-tags-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.pin-card-tag {
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.pin-card-address {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.35;
}

.pin-card-notes {
  font-size: 12.5px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 4px;
  line-height: 1.4;
  white-space: pre-line;
}

.pin-card-images-strip {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pin-card-img-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.pin-card-img-thumb:hover {
  transform: scale(1.08);
  border-color: #38bdf8;
}

.pin-card-actions-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-pin-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pin-action:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
  transform: scale(1.06);
}

.btn-pin-action.btn-pin-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

.btn-pin-action.is-hidden {
  opacity: 0.5;
}

/* Checkbox / Ô tick ẩn hiện danh mục */
.cat-pill-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(15, 23, 42, 0.65);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  margin-right: 2px;
}

.cat-pill-tick:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.25);
  transform: scale(1.12);
}

.cat-pill-tick.is-checked {
  background: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.45);
}

.cat-pill-tick .tick-mark {
  display: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.cat-pill-tick.is-checked .tick-mark {
  display: block;
}

/* Tick box trên từng thẻ ghim */
.btn-pin-tick {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.btn-pin-tick .pin-tick-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.5);
  transition: all 0.18s ease;
}

.btn-pin-tick:hover .pin-tick-box {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.25);
}

.btn-pin-tick.is-checked .pin-tick-box {
  background: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.btn-pin-tick .pin-tick-box .tick-mark {
  display: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.btn-pin-tick.is-checked .pin-tick-box .tick-mark {
  display: block;
}

/* Nút tick trong InfoWindow */
.btn-pin-info-tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Empty state */
.custom-pin-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-state-icon {
  font-size: 42px;
}

/* =========================================================================
   INFOWINDOW GHIM CÁ NHÂN TRÊN BẢN ĐỒ (CUSTOM PIN INFOWINDOW)
   ========================================================================= */
.custom-pin-infowindow {
  min-width: 280px;
  max-width: 360px;
  padding: 4px 2px;
  font-family: inherit;
  color: #f8fafc;
}

.pin-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pin-info-cat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.pin-info-date {
  font-size: 11px;
  color: #94a3b8;
}

.pin-info-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 4px;
}

.pin-info-address {
  font-size: 12.5px;
  color: #cbd5e1;
  margin-bottom: 6px;
  line-height: 1.35;
}

.pin-info-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pin-info-tag-chip {
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.pin-info-notes {
  font-size: 13px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  line-height: 1.45;
  color: #e2e8f0;
  white-space: pre-line;
  max-height: 120px;
  overflow-y: auto;
}

.pin-info-images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.pin-info-gallery-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  position: relative;
}

.pin-info-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pin-info-actions-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 8px;
}

.btn-pin-info-action {
  flex: 1;
  min-width: 70px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-pin-info-edit {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.btn-pin-info-edit:hover {
  background: rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

.btn-pin-info-nav {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  text-decoration: none;
}

.btn-pin-info-nav:hover {
  background: rgba(16, 185, 129, 0.35);
  color: #ffffff;
}

.btn-pin-info-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-pin-info-delete:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* =========================================================================
   LIGHTBOX XEM PHÓNG TO ẢNH (PIN PHOTO LIGHTBOX)
   ========================================================================= */
.pin-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-lightbox-content {
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.pin-lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

.pin-lightbox-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #cbd5e1;
  font-size: 13px;
}

.pin-lightbox-counter {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  color: #ffffff;
}

.pin-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  z-index: 10;
}

.pin-lightbox-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: scale(1.1);
}

.pin-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  z-index: 10;
}

.pin-lightbox-prev {
  left: 20px;
}

.pin-lightbox-next {
  right: 20px;
}

.pin-lightbox-nav:hover {
  background: rgba(56, 189, 248, 0.35);
  border-color: #38bdf8;
  transform: translateY(-50%) scale(1.1);
}

/* Backdrop & Layout Modal Quản lý danh mục ghim */
.custom-pin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10015; /* Nằm trên customPinManagerModal (z-index: 10002) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.custom-pin-modal-backdrop.active {
  display: flex;
}

.custom-pin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-pin-modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.custom-pin-modal-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
}

.btn-close-custom-pin-modal {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
}

.btn-close-custom-pin-modal:hover {
  color: #ef4444;
}

.custom-pin-modal-body {
  padding: 16px 18px;
  max-height: 65vh;
  overflow-y: auto;
}

.custom-pin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pin-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 6px;
}

.pin-form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f1f5f9;
  padding: 8px 12px;
  font-size: 0.88rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.pin-form-input:focus {
  border-color: #38bdf8;
}

.btn-primary-custom-pin {
  background: #0284c7;
  color: #ffffff;
  border: 1px solid #38bdf8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary-custom-pin:hover {
  background: #0369a1;
  border-color: #7dd3fc;
}

.btn-secondary-custom-pin {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-custom-pin:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Quản lý danh mục ghim */
.cat-manager-modal-card {
  max-width: 520px;
}

.cat-create-box {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
}

.cat-create-inputs-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.input-cat-icon {
  width: 44px !important;
  text-align: center;
  padding: 8px 4px !important;
  font-size: 1.1rem;
}

.input-cat-color-picker {
  width: 40px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

.input-cat-name {
  flex: 1;
}

.cat-manager-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 8px;
}

.cat-manager-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.cat-manager-item-row:hover {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(56, 189, 248, 0.3);
}

.cat-manager-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-manager-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}

.cat-manager-item-count {
  font-size: 0.8rem;
  color: #94a3b8;
}

.btn-delete-cat-item {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-cat-item:hover {
  background: rgba(239, 68, 68, 0.3);
}

.cat-manager-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-edit-cat-item {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-edit-cat-item:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

.cat-manager-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.cat-edit-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.btn-save-cat-inline {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
}

.btn-cancel-cat-inline {
  padding: 6px 10px !important;
  font-size: 0.8rem !important;
}

/* Modal Di chuyển Ghim sang Danh mục khác */
.move-cat-modal-card {
  max-width: 460px;
}

.move-pin-cat-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 8px;
}

.move-cat-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.move-cat-option-item:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(2px);
}

.move-cat-option-item.is-current {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  cursor: default;
}

.move-cat-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.move-cat-option-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}

.move-cat-option-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.move-cat-option-count {
  font-size: 0.8rem;
  color: #94a3b8;
}

.move-cat-current-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: #38bdf8;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Thao tác chuyển danh mục trên Pin Card */
.pin-card-cat-badge.is-clickable {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.pin-card-cat-badge.is-clickable:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.btn-pin-move:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

/* =========================================================================
   RESPONSIVE & TỐI ƯU MOBILES - ĐẶC BIỆT IPHONE 16 PRO MAX
   ========================================================================= */
@media (max-width: 640px) {
  .custom-pin-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    margin: auto 0 0 0 !important;
    max-height: 92vh !important;
  }

  .custom-pin-modal-body {
    padding: 14px 16px max(24px, env(safe-area-inset-bottom)) !important;
    max-height: calc(92vh - 65px) !important;
  }

  .pin-icon-picker-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
  }

  .pin-color-picker-palette {
    gap: 6px;
  }

  .pin-color-btn {
    width: 26px;
    height: 26px;
  }

  .custom-pin-manager-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    margin: auto 0 0 0 !important;
    max-height: 94vh !important;
  }

  .custom-pin-mgr-body {
    padding: 12px 14px max(24px, env(safe-area-inset-bottom)) !important;
  }

  .custom-pin-mgr-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .custom-pin-mgr-quick-actions {
    width: 100%;
    justify-content: space-between;
  }

  .custom-pin-card {
    padding: 10px 12px;
  }

  .pin-lightbox-prev {
    left: 8px;
  }

  .pin-lightbox-next {
    right: 8px;
  }
}

/* =========================================================================
   CẢI TIẾN UPLOAD ẢNH & PDF CHO ĐIỂM GHIM CÁ NHÂN (TIMEMARK & PDF VIEWER)
   ========================================================================= */

.pin-photo-badges-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pin-timemark-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.pin-timemark-toggle-label:hover {
  background: rgba(16, 185, 129, 0.22);
}

.pin-timemark-toggle-label input[type="checkbox"] {
  accent-color: #10b981;
  cursor: pointer;
  margin: 0;
  width: 13px;
  height: 13px;
}

.pin-pdf-limit-badge {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

/* Khung Upload PDF */
.pin-pdf-upload-zone {
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
  padding: 12px;
  transition: all 0.2s ease;
}

.pin-pdf-upload-zone:hover {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.7);
}

.pdf-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 6px 0;
}

.pdf-dropzone-icon {
  font-size: 24px;
}

.pdf-dropzone-desc {
  font-size: 12px;
  color: #94a3b8;
}

.btn-upload-pdf-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-top: 4px;
}

.btn-upload-pdf-action:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #ffffff;
}

/* Thẻ PDF đã đính kèm */
.pin-pdf-attached-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
}

.pdf-card-thumb-wrap {
  width: 48px;
  height: 58px;
  border-radius: 6px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdf-card-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdf-fallback-icon {
  font-size: 24px;
}

.pdf-card-info-wrap {
  flex: 1;
  min-width: 0;
}

.pdf-card-filename {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.pdf-tag-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.pdf-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-pdf-preview {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pdf-preview:hover {
  background: rgba(56, 189, 248, 0.28);
}

.btn-pdf-remove {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pdf-remove:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Preview Thumbnail với ProgressBar */
.pin-img-thumb-card.uploading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.pin-img-thumb-card .thumb-upload-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 2;
}

/* Thẻ PDF trên bản đồ InfoWindow & danh sách Card */
.pin-info-pdf-block, .pin-card-pdf-strip {
  margin-top: 8px;
}

.pin-info-pdf-btn, .pin-card-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  max-width: 100%;
}

.pin-info-pdf-btn:hover, .pin-card-pdf-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

.pdf-icon-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}

.pdf-btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MODAL XEM TRỰC TIẾP TÀI LIỆU PDF */
.pin-pdf-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pin-pdf-viewer-card {
  width: 92vw;
  max-width: 960px;
  height: 90vh;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

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

.pdf-viewer-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pdf-viewer-icon {
  font-size: 24px;
}

.pdf-viewer-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-viewer-meta {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.pdf-viewer-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-pdf-header-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pdf-header-action:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.btn-pdf-header-close {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pdf-header-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.pin-pdf-viewer-body {
  flex: 1;
  background: #0b0f19;
  position: relative;
}

.pin-pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* =========================================================================
   BẮT BUỘC ĐỔI MẬT KHẨU LẦN ĐẦU (FORCE CHANGE PASSWORD)
========================================================================= */
.change-pass-force-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  margin-bottom: 14px;
  animation: fadeIn 0.25s ease-out;
}

.change-pass-force-banner .force-banner-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.change-pass-force-banner .force-banner-text {
  font-size: 12px;
  line-height: 1.45;
  color: #fde68a;
}

.change-pass-force-banner .force-banner-text strong {
  display: block;
  font-size: 13px;
  color: #fbbf24;
  margin-bottom: 3px;
}

.change-pass-force-banner .force-banner-text p {
  margin: 0;
  color: #fef3c7;
  opacity: 0.9;
}

.btn-force-cancel {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

.btn-force-cancel:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

@keyframes modalShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.modal-shake {
  animation: modalShake 0.4s ease-in-out !important;
}

.user-badge-pwd-pending {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.user-badge-pwd-ok {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* =========================================================================
   SỔ TAY HƯỚNG DẪN SỬ DỤNG TSBĐ.VN (USER GUIDE MODAL & LIGHTBOX)
========================================================================= */

/* 1. NÚT HƯỚNG DẪN TRÊN THANH TOP NAV BAR (DESKTOP & CHUNG) */
.top-guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  background: rgba(11, 19, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  color: #38bdf8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 10px rgba(56, 189, 248, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.top-guide-btn:hover {
  background: rgba(15, 23, 42, 0.98);
  border-color: #38bdf8;
  color: #7dd3fc;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.top-guide-btn:active {
  transform: scale(0.96);
}

.guide-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  transition: transform 0.25s ease;
}

.top-guide-btn:hover .guide-btn-icon {
  transform: scale(1.12) rotate(-5deg);
}

.guide-btn-text {
  letter-spacing: 0.2px;
}

/* 2. NÚT TRONG SPEED DIAL CÔNG CỤ */
.speed-dial-item.item-userguide {
  border-color: rgba(56, 189, 248, 0.25);
}

.speed-dial-item.item-userguide:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

/* 3. MODAL SỔ TAY HƯỚNG DẪN */
.user-guide-modal-overlay {
  z-index: 10005 !important;
}

.user-guide-modal-card {
  max-width: 1060px !important;
  height: 90vh !important;
  max-height: 90vh !important;
  background: rgba(11, 19, 30, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Header */
.user-guide-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(15, 23, 42, 0.6) !important;
  flex-shrink: 0 !important;
}

.user-guide-icon-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  font-size: 20px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  flex-shrink: 0 !important;
}

.guide-version-badge {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  font-size: 11px !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  margin-left: 6px !important;
}

.guide-header-search-wrap {
  position: relative;
  flex: 0 1 360px;
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px 12px;
  gap: 8px;
  transition: all 0.2s ease;
}

.guide-header-search-wrap:focus-within {
  background: rgba(15, 23, 42, 0.95);
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.guide-search-icon {
  font-size: 13px;
  color: #94a3b8;
  flex-shrink: 0;
}

.guide-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 13px;
  width: 100%;
}

.guide-search-input::placeholder {
  color: #64748b;
}

.btn-clear-guide-search {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.btn-clear-guide-search:hover {
  color: #f8fafc;
}

/* 4. THANH MỤC LỤC TRÊN DI ĐỘNG (HORIZONTAL CHIPS) */
.user-guide-mobile-chips {
  display: none;
}

@media (max-width: 768px) {
  .user-guide-mobile-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
  }

  .user-guide-mobile-chips::-webkit-scrollbar {
    display: none;
  }

  .guide-chip-btn {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .guide-chip-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #f8fafc;
  }

  .guide-chip-btn.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
  }
}

/* 5. KHUNG BODY CHIA CỘT */
.user-guide-body-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Sidebar Mục Lục (Desktop) */
.user-guide-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: rgba(11, 19, 30, 0.65);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-sidebar-header {
  padding: 4px 8px 10px;
}

.guide-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
}

.guide-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.4;
}

.guide-toc-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.guide-toc-item.active {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
  font-weight: 600;
}

.guide-toc-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-toc-item.active .guide-toc-num {
  background: #0284c7;
  color: #ffffff;
}

@media (max-width: 768px) {
  .user-guide-sidebar {
    display: none !important;
  }
}

/* 6. VÙNG NỘI DUNG MARKDOWN */
.user-guide-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .user-guide-content-area {
    padding: 16px 14px !important;
  }

  .user-guide-header {
    flex-wrap: wrap !important;
    padding: 12px 14px !important;
  }

  .guide-header-search-wrap {
    order: 3;
    flex: 1 1 100% !important;
    margin-top: 6px;
  }
}

/* 7. ĐỊNH DẠNG MARKDOWN HIỂN THỊ CHUẨN */
.user-guide-markdown-body {
  color: #cbd5e1;
  font-size: 14.5px;
  line-height: 1.75;
  max-width: 860px;
  margin: 0 auto;
}

.user-guide-markdown-body h1 {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 10px 0;
  letter-spacing: -0.3px;
  line-height: 1.35;
}

.user-guide-markdown-body h2 {
  font-size: 17.5px;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 36px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 24px;
}

.user-guide-markdown-body h3 {
  font-size: 14.5px;
  font-weight: 600;
  color: #93c5fd;
  margin-top: 18px;
  margin-bottom: 8px;
}

.user-guide-markdown-body p {
  margin: 0 0 14px 0;
  color: #cbd5e1;
}

.user-guide-markdown-body ul,
.user-guide-markdown-body ol {
  margin: 0 0 18px 0;
  padding-left: 24px;
}

.user-guide-markdown-body li {
  margin-bottom: 8px;
}

.user-guide-markdown-body strong {
  color: #ffffff;
  font-weight: 600;
}

.user-guide-markdown-body hr {
  border: none;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  margin: 32px 0;
}

.user-guide-markdown-body code {
  background: rgba(30, 41, 59, 0.85);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-guide-markdown-body pre {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  margin: 16px 0;
}

.user-guide-markdown-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #f1f5f9;
}

/* Bảng tra cứu phím tắt */
.user-guide-markdown-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0;
  font-size: 13.5px;
}

.user-guide-markdown-body th {
  background: rgba(30, 41, 59, 0.9);
  color: #94a3b8;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.user-guide-markdown-body td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.45);
}

.user-guide-markdown-body tr:last-child td {
  border-bottom: none;
}

.user-guide-markdown-body tr:hover td {
  background: rgba(30, 41, 59, 0.5);
}

/* Thẻ ảnh chụp thực tế có viền kính & Lightbox Zoom */
.user-guide-markdown-body .guide-img-container {
  margin: 22px auto;
  text-align: center;
}

.user-guide-markdown-body img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.user-guide-markdown-body img:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 16px 44px rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.user-guide-img-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 8px;
}

/* Spinner đang tải */
.guide-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 14px;
}

.guide-loading-spinner .spinner-circle {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: guideSpin 0.8s linear infinite;
}

@keyframes guideSpin {
  to { transform: rotate(360deg); }
}

/* 8. LIGHTBOX PHÓNG TO ẢNH MINH HỌA */
.guide-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: guideFadeIn 0.2s ease;
}

.guide-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.guide-lightbox-card {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: guideScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-lightbox-img-wrap {
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #000;
}

.guide-lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  display: block;
}

.guide-lightbox-caption {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  text-align: center;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.guide-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, background 0.2s ease;
  line-height: 1;
  z-index: 2;
}

.guide-lightbox-close:hover {
  transform: scale(1.1);
  background: #dc2626;
}

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

@keyframes guideScaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* =========================================================================
   USER REGISTRATION REQUESTS, CAPTCHA, APPROVAL & SMTP CONFIG STYLES
   ========================================================================= */

/* 1. Header Register Button */
.auth-btn-register {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(2, 132, 199, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.auth-btn-register:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(2, 132, 199, 0.45));
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

/* 2. Notification Badges */
.badge-pending-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  margin-left: auto;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  margin-left: 4px;
}

/* 3. Captcha UI Wrap */
.captcha-box-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.captcha-svg-display {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  min-width: 140px;
  height: 40px;
}

.btn-refresh-captcha {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-refresh-captcha:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #38bdf8;
  transform: rotate(45deg);
}

.captcha-input-field {
  flex: 1;
  text-transform: uppercase;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 15px;
}

/* 4. Requests Filter Pills & Toolbar */
.requests-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.filter-pill-btn.active {
  background: rgba(14, 165, 233, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.btn-refresh-requests {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-refresh-requests:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* 5. Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.badge-status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-status-approved {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-status-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* 6. Applicant Info Card */
.applicant-info-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}

.applicant-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.applicant-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.applicant-val {
  font-size: 13.5px;
  color: #f8fafc;
  word-break: break-word;
}

.badge-suggested-tag {
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
}

.btn-success-approve {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.btn-success-approve:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
}

.btn-perm-danger-outline {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-perm-danger-outline:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  color: #ffffff;
}

/* Modals sizing */
.guest-register-card {
  max-width: 500px;
}

.approve-request-card {
  max-width: 580px;
}

.smtp-settings-card {
  max-width: 620px;
}

/* ========================================================================== */
/* 7. MODERN FLAT ADMIN UI SYSTEM (NO EMOJI, CLEAN SVGS, ENTERPRISE BADGES)    */
/* ========================================================================== */

/* Inline SVG helpers */
.admin-svg-inline {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.svg-eye-icon {
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.15s ease, color 0.15s ease;
}

.pwd-toggle-btn:hover .svg-eye-icon,
.btn-toggle-key-eye:hover .svg-eye-icon {
  color: #38bdf8;
  transform: scale(1.1);
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Header & Column Icons */
.perm-col-head .col-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #38bdf8;
  margin-bottom: 2px;
}

.perm-col-head .col-icon svg {
  width: 16px;
  height: 16px;
}

/* Flat Role Badges */
.flat-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.flat-role-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.flat-role-admin {
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.flat-role-manager-1 {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.flat-role-manager-2 {
  background: rgba(192, 132, 252, 0.16);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.flat-role-staff {
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.flat-role-surveyor {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.flat-role-tester {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.flat-role-guest {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Flat Scope Badges */
.flat-scope-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.flat-scope-all {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.3);
}

/* Special Account Tags */
.flat-tag-root,
.flat-tag-self {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.flat-tag-root {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.flat-tag-self {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Flat Status Pills with Dot */
.flat-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.flat-status-pill.status-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.flat-status-pill.status-pending .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.flat-status-pill.status-approved {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.flat-status-pill.status-approved .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.flat-status-pill.status-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.flat-status-pill.status-warning .status-dot {
  background: #f59e0b;
}

.flat-status-pill.status-rejected {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.flat-status-pill.status-rejected .status-dot {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* Flat Quota Pills */
.flat-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.flat-quota-pill.pill-safe {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.flat-quota-pill.pill-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.flat-quota-pill.pill-blocked {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.flat-quota-pill.pill-unlimited {
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* User Action Buttons */
.btn-user-view {
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.35);
}

.btn-user-view:hover {
  background: rgba(99, 102, 241, 0.28);
  color: #ffffff;
  border-color: #6366f1;
  transform: translateY(-1px);
}

.btn-user-action svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* API Stats KPI Cards flat enhancements */
.api-kpi-card .kpi-icon-wrap svg {
  display: block;
}

/* Admin API Keys Modal Card Heads */
.admin-key-icon svg {
  display: block;
}