/* ===== FUENTES ===== */
@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Light Italic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Medium Italic.ttf') format('truetype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Bold Italic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Xbold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Xbold Italic.ttf') format('truetype');
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Heavy.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Heavy Italic.ttf') format('truetype');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Black.ttf') format('truetype');
  font-weight: 950;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Volkswagen Serial';
  src: url('../assets/fonts/Volkswagen Serial Black Italic.ttf') format('truetype');
  font-weight: 950;
  font-style: italic;
  font-display: swap;
}

/* ===== VARIABLES CSS ===== */
:root {
  /* Fuente principal */
  --font-family: 'Volkswagen Serial', sans-serif;
  /* Colores principales */
  --color-accent: #00C188;
  --color-accent-light: #00D1B2;
  --color-primary-text: #021A2C;
  --color-btn-from: #3fa9f5;

  /* Colores semánticos */
  --color-teal: #007184;
  --color-blue: #2196F3;
  --color-orange: #FF8C00;
  --color-switch-active: #7a9b2f;
  --color-slider-accent: #ff4081;
  --color-slider-accent-dark: #d81b60;
  --color-error: #f44336;
  --color-success: #4caf50;
  --govco-blue: #3673CC;

  /* Colores de fondo */
  --bg-body: #d2d3d2;
  --bg-dark: #333;
  --bg-dark-hover: #3a3a3a;
  --bg-light: #fff;
  --bg-light-secondary: #f5f5f5;
  --bg-light-hover: #f0f0f0;
  --bg-light-active: #eee;
  --bg-neutral: #F8F9FA;
  --bg-input: #F4F6F8;
  --bg-input-focus: #EDF0F2;
  --bg-action: #F0F4F8;
  --bg-action-hover: #E1E8EF;
  --bg-row-alt: #F6FFFC;
  --bg-popup-blue: #f0f8ff;
  --bg-popup-orange: #fff3e0;

  /* Colores de texto */
  --text-heading: #1a1a1a;
  --text-primary: #333;
  --text-label: #555;
  --text-secondary: #666;
  --text-muted: #888;
  --text-placeholder: #999;
  --text-light: #aaa;
  --text-white: #fff;

  /* Colores de borde */
  --border-subtle: #eee;
  --border-light: #e0e0e0;
  --border-medium: #ddd;
  --border-dark: #444;
  --border-dashed: #ccc;

  /* Colores con transparencia */
  --overlay-light-10: rgba(255, 255, 255, 0.1);
  --overlay-light-15: rgba(255, 255, 255, 0.15);
  --overlay-light-20: rgba(255, 255, 255, 0.2);
  --overlay-light-30: rgba(255, 255, 255, 0.3);
  --overlay-light-40: rgba(255, 255, 255, 0.4);
  --overlay-light-50: rgba(255, 255, 255, 0.5);
  --overlay-light-60: rgba(255, 255, 255, 0.6);
  --overlay-light-70: rgba(255, 255, 255, 0.7);
  --overlay-light-80: rgba(255, 255, 255, 0.8);
  --overlay-light-95: rgba(255, 255, 255, 0.95);
  --overlay-dark-05: rgba(0, 0, 0, 0.05);
  --overlay-dark-08: rgba(0, 0, 0, 0.08);
  --overlay-dark-10: rgba(0, 0, 0, 0.1);
  --overlay-dark-15: rgba(0, 0, 0, 0.15);
  --overlay-dark-20: rgba(0, 0, 0, 0.2);
  --overlay-dark-30: rgba(0, 0, 0, 0.3);
  --overlay-dark-50: rgba(0, 0, 0, 0.5);
  --overlay-dark-60: rgba(0, 0, 0, 0.6);
  --overlay-dark-70: rgba(0, 0, 0, 0.7);
  --overlay-dark-85: rgba(0, 0, 0, 0.85);
  --color-accent-15: rgba(0, 193, 136, 0.15);
  --color-accent-06: rgba(0, 193, 136, 0.06);
  --color-accent-30: rgba(0, 193, 136, 0.3);
  --color-accent-35: rgba(0, 193, 136, 0.35);
  --color-accent-50: rgba(0, 193, 136, 0.5);
  --color-accent-60: rgba(0, 193, 136, 0.6);
  --color-teal-05: rgba(0, 113, 132, 0.05);
  --color-primary-rgb: 26, 74, 46;
  --color-primary-40: rgba(26, 74, 46, 0.4);

  /* Colores del splash */
  --splash-bg: #0D1B2A;
  --splash-blue: #60a5fa;
  --splash-blue-30: rgba(96, 165, 250, 0.3);
  --splash-blue-60: rgba(96, 165, 250, 0.6);
  --splash-blue-orb: #0EA5E9;
  --splash-white-30: rgba(255, 255, 255, 0.3);
  --splash-white-45: rgba(255, 255, 255, 0.45);
  --splash-white-50: rgba(255, 255, 255, 0.5);
  --splash-white-62: rgba(255, 255, 255, 0.62);
  --splash-white-85: rgba(255, 255, 255, 0.85);

  /* Colores de notificación (Toast) */
  --color-info-blue: #007ac2;
  --color-green-primary: #34a853;
  --color-warning-orange: #fbbc05;
  --color-warning-bg: #fff8e1;
  --color-danger: #d93025;
  --color-danger-bg: #fce8e6;
  --color-danger-text: #b00020;

  /* Tamaños de fuente */
  --font-size-xs: 8px;
  --font-size-sm: 9px;
  --font-size-base: 11px;
  --font-size-md: 12px;
  --font-size-lg: 13px;
  --font-size-xl: 14px;
  --font-size-2xl: 18px;

  /* Tamaños de componentes */
  --navbar-height: clamp(2.563rem, 2.116rem + 1.19vw, 3.188rem);
  --sidebar-width: clamp(2.875rem, 2.648rem + 1.14vw, 3.5rem);
  --panel-width: 320px;
  --info-bar-height: 24px;
  --main-gap: 3px;

  /* Tamaños de botones */
  --btn-size-sm: 36px;
  --btn-size-md: 40px;
  --btn-size-lg: 48px;
  --btn-size-xl: 56px;
  --btn-size-2xl: 64px;
  --btn-size-3xl: 72px;
  --btn-size-4xl: 80px;

  /* Tamaños de iconos */
  --icon-size-xs: 12px;
  --icon-size-sm: 16px;
  --icon-size-md: 24px;
  --icon-size-lg: 32px;

  /* Filtros de iconos */
  --icon-filter: brightness(0) opacity(0.8);

  /* Espaciados */
  --spacing-xs: 2px;
  --spacing-sm: 4px;
  --spacing-md: 8px;
  --spacing-lg: 12px;
  --spacing-xl: 16px;
  --spacing-2xl: 20px;
  --spacing-3xl: 24px;

  /* Border radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-full: 50%;

  /* Transiciones */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;

  /* Sombras */
  --shadow-xs: 0 1px 3px var(--overlay-dark-20);
  --shadow-sm: 0 2px 6px var(--overlay-dark-15);
  --shadow-md: 0 2px 6px var(--overlay-dark-20);
  --shadow-lg: 0 2px 8px var(--overlay-dark-20);
  --shadow-xl: 0 8px 16px var(--overlay-dark-15);
  --shadow-main: 0 -4px 12px var(--overlay-dark-30);

  /* Z-index */
  --z-base: 0;
  --z-above: 1;
  --z-above-2: 2;
  --z-above-mid: 5;
  --z-above-elevated: 10;
  --z-main: 100;
  --z-info-bar: 400;
  --z-map-controls: 500;
  --z-panel: 800;
  --z-dropdown: 810;
  --z-panel-toggle: 850;
  --z-sidebar: 900;
  --z-navbar: 1000;
  --z-modal: 1100;
  --z-modal-overlay: 2000;
  --z-toast: 2000;
  --z-loader: 9999;
  --z-dialog: 10000;
  --z-dialog-close: 10001;
  --z-fullscreen: 12000;
  --z-landing: 99999;
}

/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
  font-family: var(--font-family);
}

/* Cursor pointer para elementos interactivos sin etiqueta nativa */
.clickable-image {
  cursor: pointer;
}

/* Estado del body durante redimensionado con arrastre */
.body--dragging-resize {
  user-select: none;
  cursor: ns-resize;
}

[hidden] {
  display: none !important;
}

/* Scrollbars ultra-delgados (WebKit: Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-body);
}

/* ===== MAIN CONTAINER ===== */
main {
  position: fixed;
  top: 0;
  left: calc(var(--sidebar-width));
  right: 0;
  bottom: 0;
  z-index: var(--z-main);
  overflow: hidden;
}

/* ===== HEADER / NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: calc(var(--sidebar-width) + 5px);
  right: 0;
  height: var(--navbar-height);
  background: var(--overlay-light-40);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  z-index: var(--z-navbar);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.navbar-app-logo {
  width: calc(var(--panel-width) - (var(--spacing-xl) * 2));
  height: auto;
  object-fit: contain;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.navbar-btn {
  width: var(--btn-size-sm);
  height: var(--btn-size-sm);
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-light);
  color: var(--text-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.navbar-btn:hover {
  background: var(--bg-light-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.navbar-btn svg,
.navbar-btn img {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

.navbar-btn2 {
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.navbar-btn2 svg,
.navbar-btn2 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Wrapper para botón con badge de notificaciones */
.navbar-btn-wrapper {
  position: relative;
  display: inline-flex;
}

.navbar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: #16a34a;
  color: var(--text-white);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

.navbar-badge[hidden] {
  display: none;
}

/* ===== SIDEBAR IZQUIERDA (Categorías) ===== */
.sidebar-left {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  margin-left: 5px;
  margin-bottom: 5px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.sidebar-logo {
  width: var(--sidebar-width);
  height: var(--navbar-height);
  background: var(--color-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: auto;
  height: var(--btn-size-md);
  object-fit: contain;
}

.sidebar-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--sidebar-width);
  height: var(--btn-size-2xl);
  padding: var(--spacing-md) var(--spacing-sm);
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  box-sizing: border-box;
}

.sidebar-category:hover {
  background: var(--bg-light-hover);
  color: var(--text-primary);
}

.sidebar-category.active {
  background: var(--bg-light-hover);
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

.sidebar-category svg,
.sidebar-category img {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  margin-bottom: var(--spacing-xs);
  object-fit: contain;
}

/* Iconos SVG en estado inactivo - color gris */
.sidebar-category:not(.active)>img,
.layer-info-btn img,
.legend-empty img {
  filter: brightness(0) saturate(100%) invert(79%) sepia(0%) saturate(0%) hue-rotate(180deg) brightness(95%) contrast(88%);
  transition: filter var(--transition-fast);
}

/* Iconos SVG en estado activo - color oscuro */
.sidebar-category.active>img,
.layer-info-btn:hover img {
  filter: brightness(0) saturate(100%) invert(20%) sepia(15%) saturate(1000%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* #btn-home-sidebar img {
  filter: none;
} */

.sidebar-category span {
  color: var(--color-primary-text);
  font-size: var(--font-size-sm);
  font-weight: 200;
  text-align: center;
  line-height: 0.9;
}

.sidebar-divider {
  flex: 1;
}

/* ===== PANEL DE LEYENDA/ANÁLISIS ===== */
.panel {
  position: absolute;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  width: var(--panel-width);
  height: calc(100% - var(--navbar-height) - 5px);
  background: var(--bg-light);
  z-index: var(--z-panel);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform var(--transition-normal) ease;
}

.panel.collapsed {
  transform: translateX(calc(var(--panel-width) * -1));
}


/* Botón toggle del panel (fuera del panel) */
.panel-toggle-btn {
  position: absolute;
  top: calc(var(--navbar-height) + 8px);
  left: var(--panel-width);
  z-index: var(--z-panel-toggle);
  width: 28px;
  height: 28px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
  transition: left var(--transition-normal) ease,
    transform var(--transition-normal) ease,
    border-radius var(--transition-normal) ease,
    background var(--transition-fast);
}

.panel-toggle-btn:hover {
  background: var(--bg-light-active);
}

.panel-toggle-btn img {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transform: rotate(90deg);
  transition: opacity var(--transition-fast), transform var(--transition-normal) ease;
}

.panel-toggle-btn:hover img {
  opacity: 1;
}

/* Cuando el panel está colapsado, mover el botón al borde izquierdo */
.panel.collapsed~.panel-toggle-btn {
  left: 0;
  transform: translateX(0);
  border-radius: 0 50% 50% 0;
  animation: panel-toggle-pulse 2s infinite;
}

@keyframes panel-toggle-pulse {
  0% {
    box-shadow: var(--shadow-md), 0 0 0 0 var(--color-accent);
  }

  70% {
    box-shadow: var(--shadow-md), 0 0 0 18px rgba(0, 193, 136, 0);
  }

  100% {
    box-shadow: var(--shadow-md), 0 0 0 0 rgba(0, 193, 136, 0);
  }
}

.panel.collapsed~.panel-toggle-btn img {
  transform: rotate(-90deg);
}

.panel-content {
  flex: 1;
  overflow: hidden;
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
}

.panel-skeleton-item {
  cursor: default;
  pointer-events: none;
}

.panel-skeleton-block {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-light) 25%, var(--bg-medium, #2a2a2a) 50%, var(--bg-light) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.panel-skeleton-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.panel-skeleton-title {
  height: 12px;
  width: 70%;
}

.panel-skeleton-desc {
  height: 10px;
  width: 90%;
  opacity: 0.6;
}

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

.panel-header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-xl);
}

.panel-header-section .panel-section-title {
  margin-bottom: 0;
}

.panel-header-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-xl);
}

.panel-section-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  /* text-transform: uppercase; */
  margin-bottom: var(--spacing-xl);
}

.panel-header-title-row .panel-section-title {
  align-self: flex-start;
  margin-bottom: 0;
  margin-top: 0;
}

.panel-back-btn[hidden] {
  display: none !important;
}

.panel-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  margin-right: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s;
}

.panel-back-btn img {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
  opacity: 0.5;
}

.panel-back-btn:hover {
  color: var(--text-primary);
}

.panel-back-btn:hover img {
  opacity: 0.8;
}

.predio-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.panel-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--spacing-md);
}

/* Headers estáticos de los paneles (ocultos por defecto, CSS los muestra según la vista) */
.panel-static-header {
  display: none;
  padding: var(--spacing-xl) var(--spacing-xl) 0;
}

.panel.panel-tab-explorar:not(.panel-searching):not(.panel-showing-detail) #panel-header-explorar,
.panel.panel-tab-datos:not(.panel-searching):not(.panel-showing-detail) #panel-header-datos,
.panel.panel-tab-leyenda #panel-header-leyenda,
.panel.panel-tab-herramientas #panel-header-herramientas,
.panel.panel-tab-buscar #panel-header-buscar,
.panel.panel-searching #panel-header-buscar,
.panel.panel-showing-detail #panel-header-buscar {
  display: block;
}

.panel-info {
  font-size: var(--font-size-md);
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: var(--spacing-xl);
}

.panel-info a {
  color: var(--color-accent-light);
}

/* ===== PREDIO INFO PANEL ===== */
.predio-info-panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

/* ===== GRILLA DE TEMÁTICAS ===== */
.themes-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.theme-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-light-secondary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-accent);
  box-shadow: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: var(--spacing-md);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.theme-item:hover {
  background: var(--bg-light);
  transform: translateY(-1px);
}

.theme-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
}

.theme-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.theme-item img {
  width: 36px;
  height: 36px;
  display: block;
  filter: brightness(0) saturate(100%) invert(20%) sepia(15%) saturate(1000%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.theme-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.theme-item-description {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
  font-weight: 400;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.theme-item-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  display: none;
}


/* ===== GRILLA DE HERRAMIENTAS ===== */
.tools-grid {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md) var(--spacing-xl);
  gap: var(--spacing-sm);
}

.tool-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}

.tool-item:hover {
  background: var(--bg-neutral);
  transform: translateY(-1px);
}

.tool-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-neutral);
  border-radius: var(--radius-sm);
}

.tool-item-icon img {
  width: 20px;
  height: 20px;
  opacity: 1;
  filter: var(--icon-filter, none);
}

.tool-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tool-item-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.tool-item-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-item-arrow {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.35;
}

.tool-subpanel {
  padding: var(--spacing-md) var(--spacing-xl);
}

.tool-placeholder {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--spacing-xl);
}

/* ===== PANEL DE TEMÁTICA ===== */
.theme-layers--scroll {
  overflow: auto;
}

.theme-layers {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  overflow: hidden;
}

/* Paginación con puntos */
.layers-pagination,
.themes-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-xl) 0;
  margin-top: auto;
}

.pagination-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: var(--radius-full);
  background: var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-dot:hover {
  background: var(--text-muted);
  transform: scale(1.2);
}

.pagination-dot.active {
  background: var(--color-accent);
  transform: scale(1.3);
}

.pagination-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}

.pagination-chevron:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

.pagination-chevron svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-layer-item {
  background: var(--bg-light-secondary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  min-height: 60px;
  height: auto;
  display: flex;
  flex-direction: column;
}

.theme-layer-item:hover {
  background: var(--bg-light-hover);
}

.theme-layer-header {
  display: flex;
  align-items: center;
  padding: var(--spacing-md);
  cursor: pointer;
  gap: var(--spacing-md);
  flex: 1;
  min-height: 48px;
}

/* Switch de capa */
.layer-switch {
  position: relative;
  width: 30px;
  height: 16px;
  flex-shrink: 0;
}

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

.layer-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-primary-text);
  transition: var(--transition-fast);
  border-radius: 20px;
}

.layer-switch-slider::before {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 3px;
  bottom: 3px;
  background-color: var(--bg-light);
  transition: var(--transition-fast);
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
}

.layer-switch input:checked+.layer-switch-slider {
  background-color: var(--color-accent);
}

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

.layer-switch input:focus+.layer-switch-slider {
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.3);
}

.layer-switch:hover .layer-switch-slider {
  background-color: var(--text-muted);
}

.layer-switch input:checked:hover+.layer-switch-slider {
  background-color: var(--color-switch-active);
}

.theme-layer-title {
  font-size: var(--font-size-md);
  color: var(--text-primary);
  flex: 1;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.theme-layer-item.layer-active {
  border-left: 3px solid var(--color-accent);
}

/* Estado de carga de capa */
.theme-layer-item.layer-loading .theme-layer-header {
  position: relative;
}

.theme-layer-item.layer-loading .theme-layer-title {
  opacity: 0.5;
}

.theme-layer-item.layer-loading .layer-switch {
  pointer-events: none;
  opacity: 0.5;
}

/* ===== CONTENEDOR DE LEYENDA DE CAPA ===== */
.layer-legend-container {
  display: none;
  flex-direction: column;
  padding: var(--spacing-lg) var(--spacing-md);
  margin-top: var(--spacing-md);
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-light);
}


.multitemporal-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: var(--font-size-lg);
  font-weight: 400;
  color: var(--text-secondary);
  pointer-events: none;
}

.multitemporal-label img {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  opacity: 0.8;
  filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(180deg) brightness(95%) contrast(88%);
}

.theme-layer-item.layer-loading .theme-layer-header::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  border: 2px solid var(--border-light);
  border-top-color: var(--color-accent);
  border-radius: var(--radius-full);
  animation: layer-spinner 0.8s linear infinite;
}

@keyframes layer-spinner {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Botón de información de capa */
.layer-info-btn {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.layer-info-btn:hover {
  color: var(--color-accent);
}

.layer-info-btn svg {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
}

/* ===== MODAL DE INFORMACIÓN DE CAPA ===== */
.layer-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-dark-50);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  backdrop-filter: blur(2px);
}

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

.layer-modal {
  background: var(--bg-light);
  border-radius: 0;
  box-shadow: 0 15px 40px var(--overlay-dark-20);
  width: 50vw;
  max-width: 800px;
  min-height: 40vh;
  overflow: hidden;
  position: relative;
  transform: scale(0.95);
  transition: transform var(--transition-fast);
  border-left-width: 8px;
  border-left-style: solid;
  display: grid;
  grid-template-rows: auto 1fr;
}

.layer-modal-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
  z-index: var(--z-base);
  display: block;
  filter: invert(0.25);
}

.layer-modal-overlay.active .layer-modal {
  transform: scale(1);
}

.layer-modal-header {
  display: block;
  padding: 40px 40px 0px 60px;
  background: transparent;
  color: var(--text-heading);
  position: relative;
  z-index: var(--z-above);
}

.layer-modal-title {
  font-size: 24px;
  font-weight: 300;
  margin: 0 0 16px 0;
  line-height: 1.1;
  color: var(--text-heading);
  letter-spacing: -0.5px;
}

.layer-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-placeholder);
  opacity: 0.7;
  transition: all var(--transition-fast);
  z-index: var(--z-above-elevated);
}

.layer-modal-close:hover {
  opacity: 1;
  color: var(--text-primary);
  transform: rotate(90deg);
}

.layer-modal-close svg,
.layer-modal-close img {
  width: 36px;
  height: 36px;
  filter: invert(1) brightness(0.3);
}

.layer-modal-content {
  padding: 0 40px 30px 60px;
  position: relative;
  min-height: 300px;
  z-index: var(--z-above);
}

.layer-modal-text {
  position: relative;
  z-index: var(--z-above);
}

.layer-modal-description {
  font-size: 12px;
  color: var(--text-label);
  line-height: 1.75;
  margin: 0 0 24px 0;
  font-weight: 300;
}

.layer-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 6px;
}

/* ===== MODAL DE ERROR DE CONFIGURACIÓN ===== */
.config-error-modal {
  border-left-color: var(--color-danger);
  max-width: 540px;
  min-height: unset;
}

.config-error-modal .layer-modal-header {
  padding-bottom: 24px;
}

.config-error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-danger-bg);
  margin-bottom: 16px;
}

.config-error-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.config-error-content {
  padding: 0 40px 32px 60px;
  position: relative;
  z-index: var(--z-above);
}

.config-error-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--color-accent);
  color: var(--color-primary-text);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.config-error-retry-btn:hover {
  opacity: 0.85;
}

.config-error-retry-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== MAPA ===== */
#viewDiv {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-main);
}

/* ===== CONTROLES DEL MAPA ===== */
.map-controls {
  position: absolute;
  bottom: 30px;
  right: 10px;
  display: flex;
  flex-direction: row;
  gap: 0;
  background: var(--overlay-light-60);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: var(--z-map-controls);
}

.map-control-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  padding: 0;
}

.map-control-btn:hover {
  background: var(--bg-light-hover);
}

.map-control-btn.active {
  background: var(--bg-light-active);
}

.map-control-btn svg,
.map-control-btn img {
  width: 20px;
  height: 20px;
  filter: brightness(0) contrast(100%);
  transition: filter var(--transition-fast);
}

.map-controls-group {
  display: flex;
  flex-direction: row;
  gap: 0px;
}

.map-controls-group:not(:last-child) {
  margin-right: 10px;
}

.map-controls-group .map-control-btn {
  box-shadow: none;
  border-radius: 0;
}

.map-controls-group .map-control-btn:not(:last-child) {
  border-right: none;
}

/* ===== INFO BAR (Bottom) ===== */
.info-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--info-bar-height);
  background: var(--overlay-light-20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xl);
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  z-index: var(--z-info-bar);
  border-top: 1px solid var(--border-light);
}

.info-bar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

.info-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.info-bar a {
  color: var(--text-secondary);
  text-decoration: none;
}

.info-bar a:hover {
  color: var(--text-primary);
}

/* ===== ESRI WIDGETS CUSTOMIZATION ===== */
.esri-ui-corner .esri-component {
  box-shadow: var(--shadow-sm);
}

.esri-zoom {
  display: none !important;
}

.esri-attribution {
  display: none !important;
}

/* ===== PANEL DE LEYENDA ===== */
.legend-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.legend-empty svg,
.legend-empty img {
  width: 50%;
  height: auto;
  opacity: 0.5;
}

.legend-empty p {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.legend-empty span {
  font-size: var(--font-size-base);
  font-weight: 500;
}

.legend-container {
  flex: 1;
  overflow-y: auto;
}

/* Personalización del widget de leyenda de ArcGIS */
.legend-container .esri-legend {
  padding: 0;
}

.legend-container .esri-legend__layer {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.legend-container .esri-legend__layer:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.legend-container .esri-legend__layer-caption {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.legend-container .esri-legend__layer-body {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

.legend-container .esri-legend__layer-table {
  margin: 0;
}

.legend-container .esri-legend__layer-cell--symbols {
  width: var(--icon-size-md);
  padding-right: var(--spacing-md);
}

.legend-container .esri-legend__layer-cell--info {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

.legend-container .esri-legend__service {
  padding: 0;
}

.legend-container .esri-legend__service-label {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  padding: 0;
  margin-bottom: var(--spacing-md);
}

/* ===== LEYENDA PERSONALIZADA ===== */
#customLegends {
  margin-bottom: 12px;
}

.custom-legend-layer {
  margin-bottom: 12px;
  padding: 8px 0;
  background: transparent;
  border-radius: 0;
  border-left: none;
  border-bottom: 1px solid var(--border-light);
}

.custom-legend-layer:last-child {
  border-bottom: none;
}

.custom-legend-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 6px;
  gap: 8px;
  flex-wrap: wrap;
}

/* Botón de colapsar/expandir */
.legend-collapse-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.legend-collapse-btn:hover {
  background-color: var(--overlay-dark-05);
}

.legend-collapse-btn img {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.legend-collapse-btn:hover img {
  opacity: 1;
}

/* Rotación del icono cuando está colapsado */
.custom-legend-layer.collapsed .legend-collapse-btn img {
  transform: rotate(-90deg);
}

/* Contenedor colapsable */
.custom-legend-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  padding-left: 28px;
}

.custom-legend-layer.collapsed .custom-legend-content {
  max-height: 0;
  opacity: 0;
}

.custom-legend-title {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-heading);
  flex: 1;
  padding-bottom: 0;
  border-bottom: none;
  text-align: left;
}

.custom-legend-sublayer-title {
  font-size: 12px;
  font-weight: 500;
  flex: 1;
}

.custom-legend-sublayer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  margin-bottom: 4px;
  margin-left: -20px;
  gap: 6px;
}

/* Botón colapsar sublayer */
.legend-sublayer-collapse-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.legend-sublayer-collapse-btn img {
  width: 12px;
  height: 12px;
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s;
}

.legend-sublayer-collapse-btn:hover img {
  opacity: 1;
}

.legend-sublayer-collapse-btn.collapsed img {
  transform: rotate(-90deg);
}

/* Contenedor colapsable sublayer */
.custom-legend-sublayer-content {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.custom-legend-sublayer-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.legend-sublayer-visibility-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.legend-sublayer-visibility-btn:hover {
  background-color: var(--overlay-dark-05);
}

.legend-sublayer-visibility-btn img {
  width: 12px;
  height: 12px;
  opacity: 1;
  filter: brightness(0.5);
}

.legend-sublayer-visibility-btn:hover img {
  filter: brightness(0.3);
}

.legend-sublayer-visibility-btn.sublayer-hidden img {
  filter: brightness(0.7);
  opacity: 0.6;
}

.custom-legend-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  width: 100%;
  margin-top: 2px;
  padding-left: 28px;
}

.legend-control-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.legend-control-btn:hover {
  background-color: var(--overlay-dark-05);
}

.legend-control-btn img {
  width: 14px;
  height: 14px;
  opacity: 1;
}

.legend-control-btn:hover img {
  filter: brightness(0.1);
}

.legend-drag-btn {
  cursor: grab;
}

.legend-drag-btn:active {
  cursor: grabbing;
}

.custom-legend-layer.layer-hidden .custom-legend-title {
  opacity: 0.6;
  font-style: italic;
}

.custom-legend-layer.layer-hidden .custom-legend-label {
  opacity: 0.6;
  font-style: italic;
}

.custom-legend-layer.layer-hidden .legend-control-btn img {
  opacity: 0.4;
}

.custom-legend-layer.dragging {
  opacity: 0.5;
}

.custom-legend-layer.out-of-scale {
  opacity: 0.45;
}

.custom-legend-layer.out-of-scale .custom-legend-title {
  font-style: italic;
}

.custom-legend-layer.out-of-scale::after {
  content: 'Fuera de escala';
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 0 4px 0;
  font-style: italic;
}

.custom-legend-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}

/* Corrección para iconos de leyenda (imágenes Base64) */
.custom-legend-item img {
  opacity: 1 !important;
  filter: none !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-block !important;
  visibility: visible !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  max-width: 32px !important;
  max-height: 32px !important;
}

.custom-legend-label {
  font-size: 12px;
  color: var(--text-label);
  line-height: normal;
  font-weight: 400;
  padding-left: 5px;
}

/* ===== LEYENDA CLUSTER ===== */
.custom-legend-cluster-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}

.custom-legend-cluster-title {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0 0 6px 0;
  font-weight: 500;
}

.custom-legend-cluster-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-legend-cluster-row .custom-legend-label {
  padding-left: 0;
}

/* ===== MEDIR (subpanel de herramientas) ===== */

.medir-mode-btns {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.medir-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-sm);
  background: var(--bg-neutral);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.medir-btn img {
  width: 22px;
  height: 22px;
  opacity: 0.6;
}

.medir-btn:hover {
  background: var(--bg-light-hover);
  border-color: var(--border-medium);
}

.medir-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--text-white);
}

.medir-btn.active img {
  opacity: 1;
  filter: brightness(10);
}

.medir-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  background: var(--bg-neutral);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.medir-result-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.medir-result-value {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-accent);
}

.medir-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* El widget Measurement de Esri se oculta visualmente —
   usamos su lógica pero mostramos el resultado en nuestro panel */
#measurement-widget-container {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ===== DIBUJAR (subpanel de herramientas) ===== */

.dibujar-mode-btns {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.dibujar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-sm);
  background: var(--bg-neutral);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.dibujar-btn img {
  width: 22px;
  height: 22px;
  opacity: 0.6;
}

.dibujar-btn:hover {
  background: var(--bg-light-hover);
  border-color: var(--border-medium);
}

.dibujar-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--text-white);
}

.dibujar-btn.active img {
  opacity: 1;
  filter: brightness(10);
}

.dibujar-count {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-align: center;
  min-height: 16px;
  margin-bottom: var(--spacing-sm);
}

.dibujar-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}

/* El widget Sketch de Esri se monta aquí; ocupa el ancho completo del panel */
.dibujar-widget-container {
  width: 100%;
  margin-bottom: var(--spacing-lg);
}

.dibujar-actions {
  display: flex;
  justify-content: center;
}

.dibujar-btn-limpiar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--bg-neutral);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.dibujar-btn-limpiar img {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.dibujar-btn-limpiar:hover {
  background: var(--bg-light-hover);
  border-color: var(--border-medium);
}

/* ===== COORDENADAS (subpanel de herramientas) ===== */

.coordenadas-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: var(--spacing-lg);
}

.coordenadas-results {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.coord-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-neutral);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
}

.coord-label {
  grid-column: 1;
  grid-row: 1;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coord-value {
  grid-column: 1;
  grid-row: 2;
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.coord-copy-btn {
  grid-column: 2;
  grid-row: 1 / 3;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  opacity: 0.5;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.coord-copy-btn img {
  width: 14px;
  height: 14px;
  display: block;
}

.coord-copy-btn:hover {
  opacity: 1;
  background: var(--bg-light-hover);
}

.coord-copy-btn.copied {
  opacity: 1;
  background: var(--color-accent-15);
}

/* ===== COMPARTIR (subpanel de herramientas) ===== */

/* Fila toggle splash */
.share-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
}

/* Toggle switch */
.share-toggle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.share-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.share-toggle-track {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  background: var(--border-medium);
  border-radius: 10px;
  transition: background 0.2s;
  cursor: pointer;
}

.share-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--bg-light);
  transition: transform 0.2s;
}

.share-toggle-input:checked+.share-toggle-track {
  background: var(--color-accent);
}

.share-toggle-input:checked+.share-toggle-track::after {
  transform: translateX(14px);
}

/* Fila URL: input + botón copiar en línea */
.share-url-row {
  display: flex;
  gap: var(--spacing-sm);
}

.share-url-input {
  flex: 1;
  min-width: 0;
}

.share-copy-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Feedback copiado: capa absoluta encima del botón, sin alterar tamaño */
.swipe-btn.copied {
  position: relative;
  overflow: hidden;
}

.swipe-btn.copied::after {
  content: "✓ Copiado";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-white);
  border-radius: inherit;
  pointer-events: none;
}

/* Fila dimensiones iframe */
.share-dim-row {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.share-dim-field {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.share-dim-field span {
  white-space: nowrap;
}

.share-dim-input {
  flex: 1;
  min-width: 0;
  text-align: center;
}

/* Textarea código iframe */
.share-iframe-code {
  width: 100%;
  font-family: monospace;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  resize: vertical;
  line-height: 1.5;
  box-sizing: border-box;
  min-height: 72px;
}

/* ===== PANEL DE BASEMAP (Configuración) ===== */
.basemap-panel {
  position: absolute;
  bottom: 70px;
  right: 10px;
  width: 300px;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: calc(var(--z-map-controls) + 10);
  overflow: hidden;
  transform: scale(0.95) translateY(8px);
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.basemap-panel.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.basemap-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-light);
}

.basemap-panel-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: 0;
}

.basemap-panel-title img {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
}

.basemap-panel-close {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition-fast);
}

.basemap-panel-close:hover {
  background: var(--bg-light-hover);
}

.basemap-panel-close img {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  filter: invert(1) brightness(0.3);
}

.basemap-panel-body {
  padding: var(--spacing-lg);
  max-height: 420px;
  overflow-y: auto;
}

.basemap-section-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-md);
}

.basemap-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.basemap-gallery-item {
  background: var(--bg-light-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.basemap-gallery-item:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.basemap-gallery-item--selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.basemap-gallery-thumbnail {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}

.basemap-gallery-title {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== PEGMAN DRAG MODE ===== */
#viewDiv.pegman-active {
  cursor: url('../assets/icons/streetview.svg') 12 54, crosshair !important;
}

#streetview[draggable="true"] {
  cursor: grab;
}

#streetview[draggable="true"]:active {
  cursor: grabbing;
}

/* ===== MODAL DE STREET VIEW ===== */
.streetview-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: none;
  padding: 0;
  width: 90%;
  height: 90%;
  max-width: 1800px;
  max-height: 90vh;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: visible;
  display: none;
  flex-direction: column;
  z-index: var(--z-dialog);
}

.streetview-dialog[open] {
  display: flex;
  animation: streetview-scale-in 0.3s ease-out;
}

.streetview-dialog::backdrop {
  background: var(--overlay-dark-30);
  backdrop-filter: blur(4px);
}

@keyframes streetview-scale-in {
  from {
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.streetview-close-btn {
  position: absolute;
  top: -20px;
  right: -20px;
  z-index: var(--z-dialog-close);
  background: var(--bg-dark);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin: 0;
  padding: 0;
  animation: streetview-btn-pulse 2s ease-in-out infinite;
}

@keyframes streetview-btn-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 var(--color-primary-40);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 8px transparent;
    transform: scale(1.05);
  }
}

.streetview-close-btn::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
}

.streetview-close-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  animation-play-state: paused;
  transform: scale(1.05);
}

.streetview-close-btn:hover img {
  filter: brightness(0) invert(1);
}

.streetview-close-btn:active {
  transform: scale(0.95);
  background: var(--color-accent);
  border-color: var(--color-accent);
  animation-play-state: paused;
}

.streetview-close-btn:active img {
  filter: brightness(0) invert(1);
}

.streetview-close-btn img {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  transition: filter var(--transition-fast);
}

.streetview-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.streetview-map-container,
.streetview-panorama-container {
  flex: 1;
  position: relative;
  min-width: 0;
}

.streetview-map-container {
  border-right: 2px solid var(--border-light);
}

#streetview-google-map,
#streetview-panorama {
  width: 100%;
  height: 100%;
}

/* ===== POPUP STYLING ===== */
.popup-container {
  padding: 8px;
  max-width: 300px;
}

.popup-title {
  margin: 0 0 8px 0;
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.popup-section {
  margin: 12px 0;
  padding: 8px;
  background: var(--bg-light-secondary);
  border-radius: var(--radius-md);
}

.popup-section-blue {
  background: var(--bg-popup-blue);
}

.popup-section-orange {
  background: var(--bg-popup-orange);
}

.popup-label {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-md);
}

.popup-value {
  margin: 2px 0;
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
}

.popup-value em {
  font-style: italic;
}

/* ===== POPUP ATTACHMENTS ===== */
.attachment-container {
  margin-bottom: 16px;
}

.attachment-title {
  margin: 0 0 8px 0;
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.attachment-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.attachment-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.attachment-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.attachment-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.attachment-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, var(--overlay-dark-70));
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-white);
  pointer-events: none;
  font-weight: 600;
}

/* ===== NOTIFICACIONES TOAST ===== */

.gis-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 400px;
}

.gis-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  min-width: 320px;
  max-width: 400px;
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.gis-toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.gis-toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gis-toast__icon img {
  width: 20px;
  height: 20px;
}

.gis-toast__content {
  flex: 1;
  min-width: 0;
}

.gis-toast__title {
  font-weight: 700;
  font-size: var(--font-size-md);
  margin-bottom: 4px;
  color: var(--text-primary);
}

.gis-toast__message {
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-secondary);
}

.gis-toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.gis-toast__close:hover {
  background: var(--bg-light-hover);
  color: var(--text-primary);
}

.gis-toast__close img {
  width: 16px;
  height: 16px;
  filter: invert(1) brightness(0.3);
}

/* Variantes */
.gis-toast--info {
  border-color: var(--color-info-blue);
}

.gis-toast--info .gis-toast__icon {
  color: var(--color-info-blue);
}

.gis-toast--success {
  border-color: var(--color-green-primary);
}

.gis-toast--success .gis-toast__icon {
  color: var(--color-green-primary);
}

.gis-toast--warning {
  border-color: var(--color-warning-orange);
  background: var(--color-warning-bg);
}

.gis-toast--warning .gis-toast__icon {
  color: var(--color-warning-orange);
}

.gis-toast--danger {
  border-color: var(--color-danger);
  background: var(--color-danger-bg);
}

.gis-toast--danger .gis-toast__icon {
  color: var(--color-danger);
}

/* Badge styles for antes/ahora */
.attachment-item.badge-antes {
  border-color: var(--color-accent);
}

.attachment-item.badge-ahora {
  border-color: var(--color-blue);
}

/* Widget Table Styling */
.widget-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.widget-table-row td {
  padding: 10px;
  vertical-align: top;
  border: none;
}

/* Filas alternadas con fondo verde claro */
.widget-table-row:nth-child(even),
.pup-proyecto-wrapper .widget-table-row:nth-child(even) {
  background-color: var(--bg-light) !important;
}

.widget-table-row:nth-child(odd),
.pup-proyecto-wrapper .widget-table-row:nth-child(odd) {
  background-color: var(--bg-row-alt) !important;
}

/* Primera columna (campo/label) */
.widget-table-row td:first-child,
.pup-proyecto-wrapper .widget-table-row td:first-child {
  font-weight: 600;
  color: var(--text-secondary) !important;
  width: 45%;
  position: relative;
  padding-right: 24px;
}

/* Separador vertical entre columnas */
.widget-table-row td:first-child::after,
.pup-proyecto-wrapper .widget-table-row td:first-child::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 1px;
  background-color: var(--border-medium);
}

/* Segunda columna (valor) */
.widget-table-row td:last-child,
.pup-proyecto-wrapper .widget-table-row td:last-child {
  color: var(--text-label) !important;
  padding-left: 24px;
}

.widget-table-cell-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.widget-table-cell-empty {
  color: var(--text-placeholder);
  font-style: italic;
}

/* ===== IMPRIMIR (subpanel de herramientas) ===== */

.print-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

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

.print-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.print-select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-light);
  color: var(--text-primary);
  font-size: var(--font-size-md);
  font-family: var(--font-family);
  outline: none;
}

.print-select:focus {
  border-color: var(--color-accent);
}

.print-export-btn {
  margin-top: var(--spacing-xs);
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--text-white);
  font-size: var(--font-size-md);
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.print-export-btn:hover {
  opacity: 0.88;
}

.print-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.print-status {
  margin: 0;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.print-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}

.print-loader p {
  margin: 0;
  color: var(--color-accent);
  font-weight: 600;
  font-size: var(--font-size-md);
}

.print-status--error {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

.print-notice {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-light-secondary);
}

.print-history {
  margin-top: var(--spacing-md);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--spacing-md);
}

.print-history-title {
  margin: 0 0 var(--spacing-xs);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.print-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.print-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-light-secondary);
}

.print-history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.print-history-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.print-history-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.print-history-link {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.print-history-link:hover {
  text-decoration: underline;
}

/* ===== COMPARAR (subpanel de herramientas) ===== */
.swipe-form-group {
  margin-bottom: 16px;
}

.swipe-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.swipe-select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: var(--bg-light);
  font-size: var(--font-size-md);
  outline: none;
}

.swipe-select:focus {
  border-color: var(--color-accent);
}

.swipe-select-hint {
  margin-top: 4px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  word-break: break-word;
  min-height: 1em;
}

.swipe-actions {
  display: flex;
  justify-content: stretch;
  gap: 12px;
  margin-top: 24px;
}

.swipe-actions .swipe-btn {
  flex: 1;
}

.swipe-btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.swipe-btn-cancel {
  background: var(--bg-light-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.swipe-btn-cancel:hover {
  background: var(--border-light);
}

.swipe-btn-confirm {
  background: var(--color-accent);
  color: var(--text-white);
}

.swipe-btn-confirm:hover {
  background: var(--color-accent);
}


.swipe-info-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: 16px;
}

.esri-swipe__divider {
  max-height: 90vh;
  overflow: visible !important;
}

.esri-swipe__container:focus .esri-swipe__divider {
  outline-color: var(--color-accent);
}

.esri-swipe--horizontal .esri-swipe__divider {
  border-color: var(--color-accent);
}

.esri-swipe__handle {
  border-radius: 100%;
  border-color: var(--color-accent);
  border-width: 3px;
}

/* Labels de capa en el comparador (left calculado por JS, top por CSS) */
.swipe-layer-label {
  position: fixed;
  top: calc(50% + 30px);
  transform: translateY(-50%);
  background: var(--overlay-dark-85);
  color: var(--text-white);
  font-size: var(--font-size-base);
  font-family: inherit;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: auto;
  cursor: default;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  z-index: var(--z-map-controls);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ===== SEARCH PANEL ===== */

/* Buscador transversal: visible en explorar/datos/tema/buscar, oculto en leyenda y herramientas */
#panel-search-box {
  display: none;
}

.panel.panel-tab-explorar #panel-search-box,
.panel.panel-tab-datos #panel-search-box,
.panel.panel-tab-buscar #panel-search-box,
.panel.panel-searching #panel-search-box {
  display: block;
}

.search-view {
  position: relative;
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-light);
}

/* Ocultar panel-content en buscar, leyenda y herramientas */
.panel.panel-tab-buscar .panel-content,
.panel.panel-searching .panel-content,
.panel.panel-tab-leyenda .panel-content,
.panel.panel-tab-herramientas .panel-content {
  display: none !important;
}

/* Leyenda: contenedor estático, equivalente a #tools-subpanels */
#legend-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: var(--spacing-xl);
}

.panel.panel-tab-leyenda #legend-content {
  display: flex;
  flex-direction: column;
}

#tools-subpanels {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.panel.panel-tab-herramientas #tools-subpanels {
  display: flex;
  flex-direction: column;
}

/* Barra de acercar a — solo visible en modo leyenda */
.legend-zoom-bar {
  display: none;
  flex-direction: column;
  position: relative;
  padding: 10px 12px;
  background: var(--bg-neutral);
  border-bottom: 1px solid var(--border-light);
}

.panel.panel-tab-leyenda .legend-zoom-bar {
  display: flex;
}

/* Mostrar resultados en buscar o al buscar desde explorar/datos */
.panel.panel-tab-buscar .search-view,
.panel.panel-searching .search-view {
  display: flex !important;
}

.search-box-wrapper {
  padding: var(--spacing-md);
  background-color: var(--bg-light-secondary);
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

#unified-search-input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background-color: var(--bg-light);
  color: var(--text-primary);
  font-size: var(--font-size-md);
  transition: all 0.2s;
}

#unified-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.1);
}

.search-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
  z-index: var(--z-above);
  width: 18px;
  height: 18px;
}

.search-input-icon img {
  filter: brightness(0) saturate(100%) invert(50%);
  width: 100%;
  height: 100%;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  opacity: 0.5;
  z-index: var(--z-above);
  width: 18px;
  height: 18px;
}

.search-clear-btn img {
  filter: brightness(0) saturate(100%) invert(50%);
  width: 100%;
  height: 100%;
}

.search-clear-btn:hover {
  opacity: 1;
}

.search-results-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--spacing-sm);
  max-height: calc(100vh - 250px);
}

.search-placeholder[hidden] {
  display: none !important;
}

.search-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-primary);
  text-align: center;
  padding: var(--spacing-xl);
  opacity: 0.6;
}

.search-placeholder img,
.search-results-empty img {
  width: 64px;
  height: 64px;
  margin-bottom: var(--spacing-md);
  margin-right: 0;
  opacity: 0.75;
}

.search-theme-group {
  margin-bottom: 20px;
}

.search-theme-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--bg-light-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}

.search-result-item:hover {
  background: var(--bg-light-active);
}

.search-result-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.search-result-icon img {
  width: 28px;
  height: 28px;
  margin-right: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.search-result-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-orange);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-menu {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-result-menu:hover {
  opacity: 1;
}

.search-result-menu img {
  width: 20px;
  height: 20px;
}

#search-pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin-top: auto;
}

.search-results-empty[hidden] {
  display: none !important;
}

.search-results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-primary);
  text-align: center;
  padding: var(--spacing-xl);
  opacity: 0.6;
}

.search-results-empty img {
  width: 64px;
  height: 64px;
  margin-bottom: var(--spacing-md);
  opacity: 0.75;
}

.search-results-empty h3 {
  /* margin: 0 0 var(--spacing-sm); */
  font-size: var(--font-size-md);
  font-weight: 500;
  /* color: var(--text-primary); */
}

/*
.search-results-empty p {
  margin: 0;
  font-size: var(--font-size-sm, 12px);
} */

/* ===== GLOBAL LOADER ===== */
.global-loader--visible {
  display: flex;
}

.global-loader {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-dark-20);
  z-index: var(--z-loader);
  justify-content: center;
  align-items: center;
  border-radius: 8px;
}

.loader-content {
  background: var(--bg-light);
  padding: 24px 32px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 200px;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-bottom-color: var(--color-accent);
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}

.global-loader p {
  color: var(--color-accent);
  font-weight: 600;
  font-size: var(--font-size-md);
  margin: 0;
}

.loader-cancel-btn {
  margin-top: 8px;
  padding: 8px 24px;
  background-color: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: 20px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  transition: all 0.2s ease;
}

.loader-cancel-btn:hover {
  background-color: var(--color-danger-bg);
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


/* ===== SEARCH LOADING ANIMATION ===== */
.search-loading-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-xl);
  gap: var(--spacing-md);
  color: var(--text-muted);
  text-align: center;
  height: 100%;
  min-height: 200px;
}

.search-loading-icon {
  width: 64px;
  height: auto;
  /* animation: jump-bounce 1s infinite ease-in-out; */
  /* transform-origin: center center; */
  /* filter: drop-shadow(0 4px 6px var(--overlay-dark-10)); */
}

@keyframes jump-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* ===== PREDIO INFO ===== */

.search-back-btn {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s;
  /* margin-right: 10px; */
}

.search-back-btn img {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
  opacity: 0.5;
}

.search-back-btn:hover {
  color: var(--text-primary);
}

.search-back-btn:hover img {
  opacity: 0.8;
}

.predio-info-panel {
  padding: 0 5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow-y: auto;
}

.predio-main-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.predio-number-highlight {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0;
  word-break: break-all;
  line-height: 1.2;
}

.predio-details-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 4px;
  margin: 4px 0;
}

.predio-details-content {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.predio-section-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}

.predio-detail-row {
  display: flex;
  background-color: var(--bg-light);
  border-radius: 4px;
  padding: 6px 10px;
  margin: 0;
  align-items: center;
}

.predio-detail-label {
  flex: 0 0 40%;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-right: 10px;
  border-right: 2px solid var(--border-medium);
}

.predio-detail-value {
  flex: 1;
  font-size: 11px;
  color: var(--text-primary);
  padding-left: 10px;
}

/* Action Buttons Grid */
.predio-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.action-btn:hover:not(:disabled) {
  background: var(--bg-light-active);
  transform: translateY(-2px);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.action-btn img {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.action-btn span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Proyectos Section */
.proyectos-section,
.sitios-section {
  margin-top: 20px;
}

.proyectos-section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.proyectos-count {
  font-size: 42px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.sitios-count {
  font-size: 42px;
  font-weight: 700;
  color: var(--color-btn-from);
  line-height: 1;
}

.proyectos-title-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.2;
}

.sitios-title-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-btn-from);
  line-height: 1.2;
}

.proyecto-card-new {
  display: flex;
  gap: 15px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.proyecto-card-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--overlay-dark-08);
}

.proyecto-thumb-new {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-light);
  flex-shrink: 0;
}

.proyecto-info-new {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.proyecto-title-new {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 5px 0;
}

.proyecto-desc-new {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  line-height: 1.4;
}

.proyecto-status-new {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
}

.sitios-status-new {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-btn-from);
}

/* ===== POPUP PROYECTO URBANO ===== */
.pup-proyecto-wrapper {
  display: flex;
  min-height: 220px;
  margin: -12px;
}

.pup-foto-col {
  width: 40%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pup-foto-half {
  flex: 1;
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
}

.pup-foto-half+.pup-foto-half {
  border-top: 2px solid var(--text-white);
}

.pup-foto-full {
  flex: 1;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.pup-foto-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--overlay-dark-50);
  color: var(--text-white);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  pointer-events: none;
}

.pup-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  min-width: 0;
}

.pup-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pup-kpis-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.pup-inversion {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.pup-inversion-valor {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.pup-inversion-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
}

.pup-estado {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
}


.search-loading-text {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  animation: pulse-text 1.5s infinite ease-in-out;
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* ===== IMAGE SWIPE COMPARISON ===== */

.image-swipe-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark-30);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-fullscreen);
}

.image-swipe-modal--visible {
  display: flex !important;
}

.image-swipe-container {
  width: 90%;
  max-width: 900px;
  overflow: hidden;
  position: relative;
  animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Botón cerrar: flotante sobre la imagen, esquina superior derecha */
.image-swipe-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: var(--z-above-elevated);
  background: rgba(0, 0, 0, 0.55);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  color: #fff;
}

.image-swipe-close svg {
  width: 16px;
  height: 16px;
  display: block;
}

.image-swipe-close:hover {
  background: rgba(0, 0, 0, 0.85);
}

.swipe-loader--visible {
  display: flex;
}

.swipe-container--visible {
  display: block !important;
}

.swipe-loader {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 400px;
}

.swipe-loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: swipeSpinner 0.7s linear infinite;
}

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

.image-swipe-body {
  padding: 0;
  display: block;
  overflow: hidden;
}

/* altura calculada por JS según aspect ratio; 400px es fallback visual */
.swipe-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  user-select: none;
}

.swipe-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.before-wrapper {
  z-index: var(--z-above);
}

.after-wrapper {
  z-index: var(--z-above-2);
  overflow: hidden;
}

.swipe-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Línea divisora verde */
.swipe-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--color-accent);
  cursor: ew-resize;
  z-index: var(--z-above-elevated);
  transform: translateX(-50%);
}

/* Botón circular del handle */
.swipe-handle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: var(--text-white);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--overlay-dark-30);
  pointer-events: none;
}

.swipe-handle-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
}

/* Labels del comparador */
.swipe-container .swipe-label {
  position: absolute;
  bottom: 14px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  z-index: var(--z-above-mid);
  pointer-events: none;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px var(--overlay-dark-20);
}

/* Antes: fondo blanco, texto oscuro — lado izquierdo */
.swipe-container .before-label {
  left: 14px;
  background: var(--text-white);
  color: var(--color-primary-text);
}

/* Ahora: fondo verde, texto blanco — lado derecho */
.swipe-container .after-label {
  right: 14px;
  background: var(--color-accent);
  color: var(--text-white);
}

.attachment-container {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-light);
}

.attachment-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-item {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: var(--bg-light);
}

.attachment-item:hover {
  transform: scale(1.05);
  border-color: var(--govco-blue, #3673CC);
  box-shadow: 0 4px 10px var(--overlay-dark-10);
}

.attachment-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--overlay-dark-60);
  color: var(--text-white);
  font-size: 10px;
  padding: 2px 4px;
  text-align: center;
  font-weight: 500;
}

.badge-antes {
  border-color: var(--color-error);
}

.badge-ahora {
  border-color: var(--color-success);
}

/* ===== CUSTOM TIME SLIDER ===== */
.custom-time-slider-wrapper {
  display: none;
  padding: 10px 15px 30px;
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-light);
  margin-top: 0;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 0;
  box-sizing: border-box;
}

.custom-time-slider-wrapper.visible {
  display: block;
}

.custom-time-slider {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.time-controls {
  display: flex;
  align-items: center;
  width: 100%;
}

.time-play-btn:disabled {
  opacity: 0.3;
}

.time-play-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.time-play-btn:hover {
  background-color: var(--overlay-dark-05);
}

.time-play-btn img {
  width: 20px;
  height: 20px;
  display: block;
  filter: invert(40%) sepia(80%) saturate(1000%) hue-rotate(100deg) brightness(100%) contrast(100%);
}

.time-range-wrapper {
  flex-grow: 1;
  position: relative;
  min-width: 0;
}

/* ===== ESRI SLIDER (Time) ===== */
.esri-slider {
  background-color: transparent !important;
  padding: 10px 0 !important;
  box-shadow: none !important;
  border: none !important;
}

.esri-slider__track {
  height: 4px !important;
  background-color: var(--border-light) !important;
}

.esri-slider__track-fill {
  background-color: var(--color-accent) !important;
}

.esri-slider__thumb {
  border-color: var(--color-slider-accent) !important;
  border-width: 2px !important;
  background-color: var(--bg-light) !important;
  width: 14px !important;
  height: 14px !important;
  top: -5px !important;
}

.esri-slider__thumb:hover {
  border-color: var(--color-slider-accent-dark) !important;
  transform: scale(1.1);
}

.esri-slider__label {
  color: var(--text-secondary) !important;
  font-family: "Volkswagen Serial", sans-serif !important;
  font-size: 9px !important;
}

.esri-slider__ticks {
  margin-top: unset !important;
}

.esri-slider__tick {
  background-color: var(--border-dashed) !important;
  width: 1px !important;
}


.esri-slider__content {
  margin: 0 !important;
}

.esri-slider__max,
.esri-slider__min {
  font-size: 11px;
}

.esri-slider__tick-label {
  font-size: 9px !important;
  color: var(--text-muted) !important;
}

/* ===== CONTROL DE TRANSPARENCIA ===== */
.legend-transparency-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-transparency-btn:hover {
  color: var(--text-primary);
  background-color: var(--overlay-dark-05);
  border-radius: 4px;
}

.transparency-slider-wrapper {
  display: none;
  padding: 10px 15px 30px;
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-light);
  margin-top: 0;
  border-radius: 0;
}

.transparency-slider-wrapper.visible {
  display: block;
}

/* ===== FILTRO ESPACIAL EN LEYENDA ===== */
.legend-filter-wrapper {
  display: none;
  position: relative;
  padding: 10px 12px;
  background-color: var(--bg-neutral);
  border-top: 1px solid var(--border-light);
  margin-top: 5px;
  border-radius: 4px;
}

.legend-filter-wrapper.visible {
  display: block;
}

.legend-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.legend-filter-input {
  width: 100%;
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-light);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.legend-filter-input:focus {
  border-color: var(--color-accent);
}

.legend-filter-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.legend-filter-input-clear {
  position: absolute;
  right: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: #6B7280;
  transition: color 0.2s, background-color 0.2s;
}

.legend-filter-input-clear:hover {
  color: #374151;
  background-color: rgba(0, 0, 0, 0.08);
}

.legend-filter-input-clear img {
  width: 12px;
  height: 12px;
  filter: invert(1);
}


.legend-filter-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 2px;
  background: var(--bg-neutral);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  box-shadow: 0 4px 12px var(--overlay-dark-20);
  z-index: var(--z-dropdown);
}

.legend-filter-results.open {
  display: block;
}

.legend-filter-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.15s;
}

.legend-filter-result-item:hover {
  background-color: var(--overlay-dark-05);
}

.legend-filter-result-name {
  font-size: 12px;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-filter-result-type {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 8px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.legend-filter-no-results {
  padding: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.legend-filter-more {
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}


.legend-extent-btn img {
  filter: brightness(0) contrast(100%);
}

.legend-control-btn.legend-filter-btn.active {
  background-color: var(--color-accent);
  border-radius: 3px;
  color: #fff;
}

.legend-control-btn.legend-filter-btn.active img {
  filter: brightness(0) invert(1);
}

.transparency-slider-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.transparency-slider-wrapper .esri-slider {
  background-color: transparent;
  margin-bottom: 5px;
  padding-left: 28px !important;
}

.layer-modal-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-modal-meta-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: none;
}


.layer-modal-meta-value {
  font-size: 12px;
  color: var(--text-label);
  line-height: 1.5;
  font-weight: 300;
}

span.layer-modal-meta-value {
  text-shadow:
    0 0 3px var(--bg-light),
    0 0 6px var(--overlay-light-80),
    0 0 10px var(--overlay-light-60);
}

/* Ocultar visualmente pero mantener seleccionable - texto blanco sobre fondo blanco */
.metaNoVisible {
  color: var(--bg-light) !important;
}

.metaNoVisible .layer-modal-meta-label,
.metaNoVisible .layer-modal-meta-value {
  color: var(--bg-light) !important;
}

.linkURL a {
  color: var(--color-accent);
  text-decoration: underline;
  word-break: break-all;
}

.linkURL a:hover {
  color: var(--color-accent-light);
}

/* ===== FEATURE TABLE PANEL ===== */
.feature-table-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50vh;
  min-height: 20vh;
  max-height: 50vh;
  display: none;
  flex-direction: column;
  background: var(--bg-light);
  z-index: var(--z-panel);
  box-shadow: 0 -2px 8px var(--overlay-dark-20);
  transition: left var(--transition-normal) ease;
}

.feature-table-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  cursor: ns-resize;
  background: transparent;
  z-index: 1;
}

.feature-table-resize-handle:hover,
.feature-table-resize-handle.dragging {
  background: var(--color-accent);
  opacity: 0.5;
}

.feature-table-panel.active {
  display: flex;
}

/* Ajustar left cuando el panel está visible */
.panel:not(.collapsed)~.feature-table-panel {
  left: var(--panel-width);
}

.legend-table-btn.active {
  background-color: var(--color-accent-15);
}

.feature-table-header {
  display: flex;
  align-items: center;
  background: var(--bg-light-secondary);
  border-bottom: 1px solid var(--border-light);
  min-height: 36px;
  gap: 0;
}

.feature-table-tabs {
  display: flex;
  flex: 1;
  overflow-x: auto;
  min-width: 0;
}

.feature-table-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  cursor: pointer;
  border-right: 1px solid var(--border-light);
  white-space: nowrap;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.feature-table-tab:hover {
  background-color: var(--bg-light-hover);
}

.feature-table-tab.active {
  background-color: var(--bg-light);
  color: var(--text-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--color-accent);
}

.feature-table-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.feature-table-tab-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 2px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.feature-table-tab-close:hover {
  color: var(--color-danger);
  background-color: var(--overlay-dark-05);
}

.feature-table-close-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0 4px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition-fast);
}

.feature-table-close-btn:hover {
  background-color: var(--overlay-dark-05);
}

.feature-table-close-btn img {
  width: 16px;
  height: 16px;
  filter: invert(1) brightness(0.3);
  transition: filter var(--transition-fast);
}

.feature-table-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.feature-table-wrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* ===== LANDING / SPLASH SCREEN ===== */
#appLanding {
  position: fixed;
  inset: 0;
  z-index: var(--z-landing);
  background: var(--splash-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.splash-skip #appLanding {
  display: none;
}

#appLanding.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
}

/* Grid animado de fondo */
.splash-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-accent-06) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-accent-06) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: splashGridDrift 20s linear infinite;
}

@keyframes splashGridDrift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 48px 48px;
  }
}

/* Líneas decorativas de ciudad */
.splash-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('../assets/images/Barranquilla.webp');
  background-size: auto 100%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.35;
}

/* Orbs de luz */
.splash-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: splashOrbPulse 6s ease-in-out infinite alternate;
}

.splash-orb--1 {
  width: 500px;
  height: 500px;
  background: var(--color-accent);
  opacity: 0.12;
  top: -120px;
  left: -100px;
}

.splash-orb--2 {
  width: 400px;
  height: 400px;
  background: var(--splash-blue-orb);
  opacity: 0.10;
  bottom: -80px;
  right: -60px;
  animation-delay: 2s;
}

.splash-orb--3 {
  width: 300px;
  height: 300px;
  background: var(--color-accent);
  opacity: 0.08;
  bottom: 20%;
  left: 30%;
  animation-delay: 4s;
}

@keyframes splashOrbPulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.18);
  }
}

/* Nodos de datos */
.splash-node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 14px var(--color-accent-60);
  animation: splashNodePulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

.splash-node::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--color-accent-30);
  animation: splashNodeRipple 2.5s ease-in-out infinite;
}

.splash-node--1 {
  animation-delay: 0.3s;
}

.splash-node--2 {
  animation-delay: 1s;
  background: var(--splash-blue);
  box-shadow: 0 0 14px var(--splash-blue-60);
}

.splash-node--2::after {
  border-color: var(--splash-blue-30);
}

.splash-node--3 {
  animation-delay: 0.6s;
}

.splash-node--4 {
  animation-delay: 1.5s;
  background: var(--splash-blue);
  box-shadow: 0 0 14px var(--splash-blue-60);
}

.splash-node--4::after {
  border-color: var(--splash-blue-30);
}

.splash-node--5 {
  animation-delay: 0.9s;
}

.splash-node--6 {
  animation-delay: 1.8s;
}

@keyframes splashNodePulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.6);
    opacity: 1;
  }
}

@keyframes splashNodeRipple {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* Contenido principal del splash */
.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
  padding: 0 32px;
}

/* Logo */
.splash-logo {
  margin-bottom: 40px;
  opacity: 0;
  animation: splashRiseUp 0.7s 0.2s ease both;
}

.splash-logo-img {
  height: 7.5vh;
  width: auto;
}

/* Línea divisora animada */
.splash-divider {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  margin-bottom: 36px;
  animation: splashExpandLine 0.8s 0.6s ease both;
}

@keyframes splashExpandLine {
  from {
    width: 0;
    opacity: 0;
  }

  to {
    width: 260px;
    opacity: 1;
  }
}

/* Título de bienvenida */
.splash-welcome {
  font-size: clamp(18px, 5vw, 36px);
  font-weight: 500;
  color: var(--text-white);
  line-height: 2;
  margin-bottom: 48px;
  opacity: 0;
  animation: splashRiseUp 0.7s 0.5s ease both;
}

.splash-welcome span {
  color: var(--color-accent);
}

/* Tagline */
.splash-tagline {
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 400;
  color: var(--splash-white-62);
  line-height: 1.65;
  margin-bottom: 48px;
  max-width: 520px;
  opacity: 0;
  animation: splashRiseUp 0.7s 0.75s ease both;
}

.splash-tagline strong {
  color: var(--splash-white-85);
}

/* Botón de entrada */
.splash-enter-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(60deg,
      var(--color-btn-from) 0%,
      var(--color-btn-from) 25%,
      var(--color-accent) 50%,
      var(--color-btn-from) 65%,
      var(--color-btn-from) 100%);
  background-size: 200% 100%;
  background-position: 0% 0;
  color: var(--text-white);
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(63, 169, 245, 0.4);
  transition: transform 0.18s, box-shadow 0.18s;
  opacity: 0;
  animation: splashRiseUp 0.7s 1s ease both, splashBtnFlow 4s 1.8s linear infinite;
  letter-spacing: 0.02em;
}

.splash-enter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-btn-from));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.splash-enter-btn span,
.splash-enter-btn img {
  position: relative;
  z-index: 1;
}

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

  100% {
    background-position: -100% 0;
  }
}

.splash-enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px var(--color-accent-50);
  animation-play-state: running, paused;
}

.splash-enter-btn:hover::before {
  opacity: 1;
}

.splash-enter-btn img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  position: relative;
  z-index: 1;
}

/* Footer del splash */
.splash-footer {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  animation: splashRiseUp 0.7s 1.2s ease both;
  white-space: nowrap;
  padding: 0 24px;
}

.splash-footer-divider {
  width: 1px;
  height: 32px;
  background: var(--splash-white-30);
  flex-shrink: 0;
}

.splash-footer-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.splash-footer-line {
  font-size: 11px;
  color: var(--splash-white-30);
  letter-spacing: 0.04em;
  text-align: left;
  margin: 0;
}

.splash-footer-line strong {
  color: var(--splash-white-50);
  font-weight: 500;
}

.splash-footer-line a {
  color: inherit;
  text-decoration: none;
}

.splash-footer-line a:hover {
  text-decoration: underline;
}

@keyframes splashRiseUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== SPLASH MOBILE ===== */
@media (max-width: 600px) {
  .splash-content {
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
  }

  .splash-logo {
    margin-bottom: 24px;
  }

  .splash-logo-img {
    height: auto;
    width: min(80vw, 320px);
  }

  .splash-welcome {
    font-size: clamp(22px, 6vw, 28px);
    line-height: 1.4;
    margin-bottom: 24px;
  }

  .splash-divider {
    margin-bottom: 20px;
  }

  .splash-tagline {
    font-size: 14px;
    margin-bottom: 32px;
    max-width: 100%;
  }

  .splash-enter-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
  }

  .splash-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    white-space: normal;
    left: 0;
    right: 0;
    transform: none;
    padding: 0 24px;
    bottom: 16px;
  }

  .splash-footer-divider {
    width: 40px;
    height: 1px;
  }

  .splash-footer-line {
    text-align: center;
  }

  /* Reducir tamaño de orbs para que no causen overflow en móvil */
  .splash-orb--1 {
    width: 300px;
    height: 300px;
  }

  .splash-orb--2 {
    width: 250px;
    height: 250px;
  }

  .splash-orb--3 {
    width: 180px;
    height: 180px;
  }
}

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

/* ===== MODAL CARTA CATASTRAL (reCAPTCHA) ===== */
.recaptcha-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.recaptcha-modal {
  background: var(--bg-light);
  border-radius: var(--radius-lg, 8px);
  width: 360px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.recaptcha-modal-overlay.visible .recaptcha-modal {
  transform: translateY(0);
}

.recaptcha-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.recaptcha-modal-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.recaptcha-modal-title img {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
}

.recaptcha-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.recaptcha-modal-close:hover {
  background: var(--bg-light-hover);
}

.recaptcha-modal-close img {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
}

.recaptcha-modal-content {
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.recaptcha-modal-description {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.recaptcha-modal-predio-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--bg-subtle, #f3f4f6);
  border-radius: var(--radius-sm, 4px);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
}

.recaptcha-modal-predio-label {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.recaptcha-modal-predio-value {
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.recaptcha-widget-container {
  display: flex;
  justify-content: center;
  min-height: 78px;
}

.recaptcha-modal-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

.recaptcha-btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-sm, 4px);
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, opacity 0.15s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.recaptcha-btn img {
  width: 16px;
  height: 16px;
}

.recaptcha-btn-cancel {
  background: var(--bg-subtle, #f3f4f6);
  color: var(--text-primary);
}

.recaptcha-btn-cancel:hover {
  background: var(--bg-light-hover);
}

.recaptcha-btn-confirm {
  background: var(--color-primary, #1a73e8);
  color: #fff;
}

.recaptcha-btn-confirm:hover:not(:disabled) {
  background: var(--color-primary-dark, #1558b0);
}

.recaptcha-btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.recaptcha-modal-status {
  font-size: var(--font-size-sm);
  min-height: 1.2em;
  text-align: center;
}

.recaptcha-modal-status.success {
  color: var(--color-success, #16a34a);
}

.recaptcha-modal-status.error {
  color: var(--color-danger, #dc2626);
}

.recaptcha-modal-status.loading {
  color: var(--text-secondary);
}

/* Botón de exportar reporte PDF — ícono en verde accent */
#btnExportPredioReport img {
  filter: invert(57%) sepia(73%) saturate(415%) hue-rotate(116deg) brightness(93%) contrast(91%);
}

/* Modal de confirmación de reporte */
.report-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.report-confirm-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.report-confirm-modal {
  background: var(--bg-light);
  border-radius: var(--radius-lg, 8px);
  width: 360px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.report-confirm-overlay.visible .report-confirm-modal {
  transform: translateY(0);
}

.report-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--border-medium);
}

.report-confirm-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.report-confirm-title img {
  width: var(--icon-size-lg);
  height: var(--icon-size-lg);
  filter: invert(57%) sepia(73%) saturate(415%) hue-rotate(116deg) brightness(93%) contrast(91%);
}

.report-confirm-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-confirm-close:hover {
  background: var(--bg-light-hover);
}

.report-confirm-close img {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
}

.report-confirm-content {
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.report-confirm-description {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.report-confirm-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.report-confirm-steps li {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.report-confirm-steps li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  margin-top: 5px;
}

.report-confirm-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
}

/* ===== TOOLTIPS ===== */
.tooltip {
  position: fixed;
  padding: 6px 10px;
  background: var(--color-primary-text);
  color: var(--text-white);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: 1.3;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  white-space: nowrap;
  z-index: var(--z-dialog);
  opacity: 0;
  animation: tooltip-fade-in var(--transition-fast) ease forwards;
}

/* Flecha del tooltip */
.tooltip::after {
  content: '';
  position: absolute;
  border: 5px solid transparent;
}

/* --- Posición: Arriba --- */
.tooltip--top::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--color-primary-text);
}

/* --- Posición: Abajo --- */
.tooltip--bottom::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--color-primary-text);
}

/* --- Posición: Izquierda --- */
.tooltip--left::after {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--color-primary-text);
}

/* --- Posición: Derecha --- */
.tooltip--right::after {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--color-primary-text);
}

/* Animación de entrada */
@keyframes tooltip-fade-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}