@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-family: 'Montserrat', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;

  --bg-app: #f4f6f9;
  --bg-sidebar: rgba(255, 255, 255, 0.85);
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --bg-input: #f1f3f7;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: rgba(226, 232, 240, 0.8);
  --accent-color: #1e9ebb;
  --accent-gradient: linear-gradient(135deg, #47cde0 0%, #0e7490 100%);
  --accent-glow: rgba(71, 205, 224, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  --glass-blur: 12px;

  --status-normal: #10b981;
  --status-warning: #f59e0b;
  --status-critical: #ef4444;
  --status-info: #3b82f6;

  --map-ui-bg: #ffffff;
  --map-ui-hover: #f8fafc;
  --map-ui-text: #1e293b;

  /* Tokens compartidos de la ficha de mural. */
  --popup-card-width: 320px;
  --popup-card-padding-x: 16px;
  --popup-card-padding-y: 10px;
  --popup-row-padding-y: 3px;
  --popup-row-min-height: 28px;
  --popup-heading-color: #263238;
  --popup-value-color: #455a64;
  --popup-icon-color: #63c8d5;
  --popup-divider-color: rgba(0, 0, 0, 0.07);
  --popup-direction-color: #65c99a;
}

[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-sidebar: rgba(15, 23, 42, 0.85);
  --bg-card: #1e293b;
  --bg-card-hover: #26354a;
  --bg-input: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(51, 65, 85, 0.5);
  --accent-color: #47cde0;
  --accent-gradient: linear-gradient(135deg, #47cde0 0%, #0e7490 100%);
  --accent-glow: rgba(71, 205, 224, 0.3);
  --glass-bg: rgba(15, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --glass-blur: 16px;

  --map-ui-bg: #1e293b;
  --map-ui-hover: #334155;
  --map-ui-text: #f8fafc;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1100;
  transition: var(--transition-smooth);
}

[data-theme="dark"] .navbar {
  background: rgba(38, 58, 64, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.16);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  background: var(--accent-color);
  border-radius: 9px 9px 3px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.brand-name {
  color: #008ecc;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.brand-logo-img,
.brand-logo-dark {
  height: 42px;
  width: auto;
  object-fit: contain;
  background: none;
  padding: 0;
  border: none;
  border-radius: 4px;
  display: block;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo-dark {
  display: none;
}

.brand-logo-mark,
.brand-logo-mark-dark {
  display: none;
  height: 30px;
  width: auto;
  object-fit: contain;
}

[data-theme="dark"] .brand-logo-img {
  display: none;
}

[data-theme="dark"] .brand-logo-dark {
  display: block;
}

.layer-icon-img img {
  width: 30px;
  height: 34px;
  object-fit: contain;
}

/* Las etiquetas PNG ya son pines con su color propio: el wrapper es
   transparente para mostrar exactamente el color de cada imagen. */
.layer-icon-wrapper.layer-icon-img {
  background: none;
  background-color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
  width: 38px;
  height: 44px;
  flex-shrink: 0;
}

.layer-icon-wrapper.layer-icon-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Pin individual: divIcon con la misma forma que el agrupado (sin fondo Leaflet). */
.lugar-pin-icon {
  background: none;
  border: none;
}

/* Pañuelo siempre blanco puro, en ambos temas. */
.lugar-pin-icon img {
  filter: brightness(0) invert(1);
}

.layer-subdesc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cambalache-branding {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 999;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.cambalache-branding:hover {
  opacity: 1;
}

.cambalache-branding img {
  height: 24px;
  width: auto;
}

[data-theme="dark"] .cambalache-branding img {
  filter: brightness(0) invert(1);
}

.nav-btn {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 8px 8px 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: #55bfd0;
  transform: translateY(-1px);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: #55bfd0;
  color: #269db0;
  transform: translateY(-1px);
}

.user-menu-btn {
  position: relative;
}

.user-menu-chevron {
  font-size: 0.7rem;
  opacity: 0.7;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 6px;
  min-width: 190px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: fadeInUp 0.25s ease-out;
}

.user-dropdown.active {
  display: flex;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  transition: var(--transition-smooth);
}

.user-dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--accent-color);
}

#theme-toggle i {
  transition: transform 0.5s ease;
}

.theme-sun-icon {
  width: 18px;
  height: 18px;
  display: block;
  background-color: var(--text-secondary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0'/%3E%3Cpath d='M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M8 12a4 4 0 1 0 8 0a4 4 0 1 0 -8 0'/%3E%3Cpath d='M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7'/%3E%3C/svg%3E") center / contain no-repeat;
}

#theme-toggle:hover i {
  transform: rotate(45deg);
}

.app-container {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  height: 100vh;
}

.sidebar {
  width: 340px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
  position: relative;
  padding-top: 50px;
}


.sidebar.right-sidebar {
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.sidebar.collapsed {
  width: 0 !important;
  overflow: hidden;
  border: none !important;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.sidebar-title i {
  color: var(--accent-color);
}

#sidebar-info-toggle .sidebar-title {
  font-size: 0.95rem;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#sidebar-info-toggle {
  cursor: pointer;
}

.sidebar-header-arrow {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.sidebar-header-arrow.rotated {
  transform: rotate(180deg);
}

.sidebar-info-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.35s ease;
  opacity: 0;
  padding: 0 20px;
}

.sidebar-info-panel.active {
  max-height: 60vh;
  overflow-y: auto;
  opacity: 1;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-info-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sidebar-info-body h4 {
  font-size: 0.95rem;
}

.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: var(--map-ui-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  color: var(--text-primary);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  transition: var(--transition-smooth);
}

.sidebar-toggle-btn:hover {
  background: var(--map-ui-hover);
  color: var(--accent-color);
}

.left-toggle-btn {
  left: 340px;
}

.left-toggle-btn.collapsed-layout {
  left: 0 !important;
}

.right-toggle-btn {
  right: 340px;
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

.right-toggle-btn.collapsed-layout {
  right: 0;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 10px 16px 10px 40px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.layer-category-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

#viewer-tooltip {
  position: fixed;
  z-index: 3000;
  background: #e8faf3;
  border: 1px solid #b2e8d5;
  border-radius: 8px;
  box-shadow: var(--glass-shadow);
  padding: 4px 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
}

[data-theme="dark"] #viewer-tooltip {
  background: var(--bg-card);
  border-color: var(--border-color);
}

#welcome-modal .modal-body {
  font-size: 0.8rem;
  line-height: 1.6;
}

#welcome-modal .modal-signature-title {
  color: #008ecc;
  font-size: 0.9rem;
}

[data-theme="dark"] #welcome-modal .modal-signature-title {
  color: #47cde0;
}

#welcome-modal .modal-card {
  max-width: 580px;
}

#welcome-modal .modal-header {
  padding: 20px 24px;
}

#welcome-modal .modal-body {
  gap: 12px;
  max-height: 78vh;
}

.layer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px 4px 20px 4px;
  padding: 14px;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.layer-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--glass-shadow);
  border-color: rgba(19, 236, 164, 0.3);
}

.layer-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.layer-card-main .switch {
  margin-left: auto;
}

.layer-card-main .layer-info {
  flex: 1;
  min-width: 0;
}

.layer-expand-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.layer-expand-arrow:hover {
  color: var(--accent-color);
}

.layer-card .layer-card-body {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.layer-card.expanded .layer-card-body {
  display: flex;
}

.layer-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.layer-icon-wrapper {
  width: 52px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.2rem;
  background-color: var(--accent-color);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C7.03 2 3 6.03 3 11c0 3 1.5 5.5 3.5 7L12 22l5.5-4C19.5 16.5 21 14 21 11c0-4.97-4.03-9-9-9z' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C7.03 2 3 6.03 3 11c0 3 1.5 5.5 3.5 7L12 22l5.5-4C19.5 16.5 21 14 21 11c0-4.97-4.03-9-9-9z' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.layer-meta {
  display: flex;
  flex-direction: column;
}

.layer-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.layer-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .3s;
  border-radius: 12px 4px 12px 4px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 6px 2px 6px 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
  background-color: var(--accent-color);
}

input:focus+.slider {
  box-shadow: 0 0 1px var(--accent-color);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

.layer-actions-bar {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

.layer-action-btn {
  background: var(--bg-card);
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.layer-action-btn:hover {
  background: var(--border-color);
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.layer-action-btn.active {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
}

.layer-svg-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  background: currentColor;
}

.layer-icon-info {
  -webkit-mask-image: url('../images/info-circle.svg');
  mask-image: url('../images/info-circle.svg');
}

.layer-icon-filter {
  -webkit-mask-image: url('../images/filter.svg');
  mask-image: url('../images/filter.svg');
}

.layer-icon-opacity {
  -webkit-mask-image: url('../images/layers-intersect-2.svg');
  mask-image: url('../images/layers-intersect-2.svg');
}

[data-theme="dark"] .layer-card {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .layer-card:hover {
  background: var(--bg-card-hover);
}

[data-theme="dark"] .layer-actions-bar {
  border-top-color: var(--border-color);
}

.layer-panel {
  display: none;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  margin-top: 8px;
  animation: fadeIn 0.2s ease-in-out;
}

.layer-panel.active {
  display: block;
}

.layer-filter-panel {
  background: #e8faf3;
  border-color: #b2e8d5;
}

[data-theme="dark"] .layer-filter-panel {
  background: var(--bg-card);
  border-color: var(--border-color);
}

.layer-description-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.opacity-control-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 0.8rem;
  width: 100%;
}

.opacity-control-group label {
  grid-column: 1 / -1;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.opacity-slider {
  grid-column: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  align-self: center;
  width: 100%;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  transition: transform 0.1s;
}

.opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.opacity-value {
  grid-column: 2;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-color);
  width: 35px;
  text-align: right;
  white-space: nowrap;
  align-self: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-select,
.filter-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition-smooth);
}

[data-theme="dark"] .filter-select,
[data-theme="dark"] .filter-input {
  background: var(--bg-input);
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--accent-color);
}

.tipo-check-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 150px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px 10px;
}

[data-theme="dark"] .tipo-check-list {
  background: var(--bg-input);
}

.tipo-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1.4;
}

.tipo-check-input {
  accent-color: var(--accent-color);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.tipo-quick-links {
  font-weight: 400;
  font-size: 0.72rem;
}

.tipo-quick-links a {
  color: var(--accent-color);
  text-decoration: none;
}

.tipo-quick-links a:hover {
  text-decoration: underline;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-card.accent {
  background: var(--accent-color);
  border: none;
}

.stat-card.accent .stat-label {
  color: rgba(255, 255, 255, 0.8);
}

.stat-card.accent .stat-value {
  color: #ffffff;
}

.chart-container {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-download-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 5;
}

.chart-container:hover .chart-download-btn {
  opacity: 0.7;
}

.chart-download-btn:hover {
  opacity: 1 !important;
  background: var(--bg-card-hover);
  color: var(--accent-color);
}

.dashboard-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dashboard-empty-state i {
  font-size: 3rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.6;
}

.dashboard-empty-state p {
  font-size: 0.9rem;
}

.selected-feature-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.feature-title {
  font-size: 1rem;
  font-weight: 600;
}

.feature-badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-verificado {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-comunidad {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

.feature-attributes-table {
  width: 100%;
  border-collapse: collapse;
}

.feature-attributes-table td {
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.feature-attributes-table td:first-child {
  color: var(--text-secondary);
  font-weight: 500;
}

.feature-attributes-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text-primary);
}

.map-wrapper {
  flex: 1;
  position: relative;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg-app);
}

.map-actions-bar {
  position: absolute;
  top: 62px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.leaflet-top {
  top: 62px !important;
}

.map-control-btn {
  background: var(--map-ui-bg);
  border: 1px solid var(--border-color);
  color: var(--map-ui-text);
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.map-control-btn:hover {
  background: var(--map-ui-hover);
  color: var(--accent-color);
  transform: scale(1.05);
}

.basemap-selector-btn {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 1000;
}

.basemap-selector-btn .nav-btn {
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #39b8cf;
  color: #334155;
  border-radius: 10px 10px 0 10px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
}

.basemap-selector-btn .nav-btn i {
  color: #269db0;
}

.basemap-selector-btn .nav-btn .basemap-icon {
  width: 18px;
  height: 18px;
  mask: url('../images/stack-front.svg') no-repeat center / contain;
  -webkit-mask: url('../images/stack-front.svg') no-repeat center / contain;
  background: #269db0;
  display: inline-block;
}

[data-theme="dark"] .basemap-selector-btn .nav-btn {
  background: rgba(31, 48, 53, 0.96);
  color: #f8fafc;
}

.basemap-dropdown {
  position: absolute;
  bottom: 72px;
  left: 24px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color);
  border-radius: 12px 12px 0 12px;
  padding: 14px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
  display: none;
  grid-template-columns: repeat(2, 124px);
  gap: 12px 10px;
  z-index: 1000;
  animation: fadeInUp 0.25s ease-out;
  clip-path: polygon(0 0, 100% 0, 100% 95%, 95% 100%, 0 100%);
}

[data-theme="dark"] .basemap-dropdown {
  background: rgba(30, 41, 59, 0.98);
}

.basemap-dropdown.active {
  display: grid;
}

.basemap-option {
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.basemap-thumb {
  height: 68px;
  border-radius: 8px;
  border: 3px solid transparent;
  background-size: cover;
  background-position: center;
  transition: var(--transition-smooth);
}

.basemap-option:hover .basemap-thumb,
.basemap-option.active .basemap-thumb {
  border-color: #39b8cf;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.basemap-label {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-argenmap {
  background-color: #1d4ed8;
  background-image: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
}

.bg-argenmap-gris {
  background-color: #475569;
  background-image: linear-gradient(135deg, #64748b 0%, #cbd5e1 100%);
}

.bg-argenmap-oscuro {
  background-color: #0f172a;
  background-image: linear-gradient(135deg, #1e293b 0%, #020617 100%);
}

.bg-google-satellite {
  background-color: #14532d;
  background-image: linear-gradient(135deg, #15803d 0%, #1e3a8a 100%);
}

.leaflet-bar {
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  border-radius: var(--border-radius-sm) !important;
}

.leaflet-bar a {
  background-color: var(--map-ui-bg) !important;
  color: var(--map-ui-text) !important;
  border-bottom: 1px solid var(--border-color) !important;
  transition: var(--transition-smooth);
}

.leaflet-bar a:hover {
  background-color: var(--map-ui-hover) !important;
  color: var(--accent-color) !important;
}

.home-control-btn {
  width: 30px;
  height: 30px;
  background-color: var(--map-ui-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.home-control-btn:hover {
  background-color: var(--map-ui-hover);
}

.home-control-icon {
  display: inline-block;
  width: 17px;
  height: 17px;
  background: var(--map-ui-text);
  -webkit-mask-image: url('../images/home.svg');
  mask-image: url('../images/home.svg');
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.home-control-btn:hover .home-control-icon {
  background: var(--accent-color);
}

.layers-control-btn {
  width: 30px;
  height: 30px;
  background-color: var(--map-ui-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.layers-control-btn:hover {
  background-color: var(--map-ui-hover);
}

.layers-control-icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  background: var(--map-ui-text);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.layers-toggle-left {
  -webkit-mask-image: url('../images/toggle-left.svg');
  mask-image: url('../images/toggle-left.svg');
}

.layers-toggle-right {
  -webkit-mask-image: url('../images/toggle-right.svg');
  mask-image: url('../images/toggle-right.svg');
}

.layers-control-btn:hover .layers-control-icon {
  background: var(--accent-color);
}

.layers-control-btn.active {
  border-color: var(--accent-color);
}

.layers-control-btn.active .layers-control-icon {
  background: var(--accent-color);
}

.leaflet-container {
  font-family: var(--font-family) !important;
}

.leaflet-popup-content-wrapper {
  position: relative;
  background: var(--bg-card) !important;
  border: 1px solid rgba(203, 213, 225, 0.65) !important;
  box-shadow: 0 5px 16px rgba(71, 85, 105, 0.16) !important;
  color: var(--text-primary) !important;
  border-radius: 38px 15px 15px 15px !important;
  padding: 0 !important;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: var(--popup-card-width) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-right: 1px solid var(--border-color) !important;
}

.leaflet-popup-close-button {
  top: 8px !important;
  right: 8px !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.25) !important;
  color: #ffffff !important;
  font-size: 1.25rem !important;
  line-height: 20px !important;
  z-index: 10;
}

.leaflet-popup-close-button:hover {
  color: var(--accent-color) !important;
}

/* Marker Cluster customization */
.marker-cluster-small {
  background-color: rgba(255, 255, 255, 0.9) !important;
}
.marker-cluster-small div {
  background-color: #1e9ebb !important;
  color: #ffffff !important;
  font-weight: bold !important;
  font-size: 14px !important;
}
.marker-cluster-medium {
  background-color: rgba(255, 255, 255, 0.9) !important;
}
.marker-cluster-medium div {
  background-color: #1e9ebb !important;
  color: #ffffff !important;
  font-weight: bold !important;
  font-size: 14px !important;
}
.marker-cluster-large {
  background-color: rgba(255, 255, 255, 0.9) !important;
}
.marker-cluster-large div {
  background-color: #1e9ebb !important;
  color: #ffffff !important;
  font-weight: bold !important;
  font-size: 14px !important;
}

.popup-multimedia-container {
  width: 100%;
  height: 180px;
  position: relative;
  background-color: #000;
  overflow: hidden;
  border-radius: 38px 15px 0 0;
}

.popup-multimedia-container img,
.popup-multimedia-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-multimedia-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  color: #ffffff;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 400;
  display: none;
}

.popup-details {
  position: relative;
  background: var(--bg-card);
  padding: var(--popup-card-padding-y) var(--popup-card-padding-x) 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 3px solid transparent;
  border-image: url('../images/cambalinea.png') 1 round;
  border-image-slice: 1;
  border-radius: 0 0 15px 15px;
}

.popup-details,
.popup-details * {
  font-family: 'Inter', sans-serif !important;
}

#right-sidebar-content,
#right-sidebar-content * {
  font-family: 'Inter', sans-serif !important;
}

/* Escala armonizada con el popup (textos ~0.8, destacados ~1.0). */
#right-sidebar-content .stat-value { font-size: 1.05rem; }
#right-sidebar-content .stat-card.accent .stat-value { font-size: 1.75rem; }
#right-sidebar-content .stat-card.accent {
  grid-column: 1 / -1;
  width: fit-content;
  margin: 0 auto;
  padding: 12px 32px;
  text-align: center;
}
#right-sidebar-content .feature-title { font-size: 0.92rem; }
#right-sidebar-content h3 { font-size: 0.92rem; }
#right-sidebar-content .feature-attributes-table td { font-size: 0.78rem; padding: 6px 0; }

.popup-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popup-tag {
  color: #47CDE0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.popup-title {
  color: var(--popup-heading-color);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
}

.popup-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--popup-value-color);
}

.popup-text b {
  color: var(--popup-heading-color);
  font-weight: 600;
}

.popup-text i {
  color: #39b8cf;
}

.popup-author-row {
  min-height: 32px;
  height: 32px;
  box-sizing: border-box;
  padding: 6px 0;
  border-bottom: 1px solid var(--popup-divider-color);
}

.popup-header .badge-verificado,
.popup-header .badge-comunidad {
  align-self: flex-start;
  margin-top: 2px;
}

.popup-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
}

.popup-status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.popup-status-good {
  background: #d9f3b8;
  color: #4d7c19;
}

.popup-community-badge {
  background: #dff7fa;
  color: #36afc1;
}

.popup-community-badge::before {
  display: none;
}

.popup-data-grid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.popup-data-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: var(--popup-row-min-height);
  padding: var(--popup-row-padding-y) 0;
  border-bottom: 1px solid var(--popup-divider-color);
  color: var(--popup-value-color);
  font-size: 0.78rem;
  line-height: 1.4;
  box-sizing: border-box;
}

.popup-data-row > span:last-child {
  min-width: 0;
  color: var(--popup-value-color);
}

.popup-data-row i {
  flex: 0 0 18px;
  color: var(--popup-icon-color);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 2px;
}

.popup-svg-icon {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: var(--popup-icon-color);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.popup-icon-user { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-user'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0' /%3E%3Cpath d='M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2' /%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-user'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0' /%3E%3Cpath d='M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2' /%3E%3C/svg%3E"); }
.popup-icon-category { -webkit-mask-image: url('../images/category.svg'); mask-image: url('../images/category.svg'); }
.popup-icon-jurisdiccion { -webkit-mask-image: url('../images/icon-building-estate.svg'); mask-image: url('../images/icon-building-estate.svg'); }

/* En el panel de detalle los íconos van en celeste accent (como antes). */
.selected-feature-panel .popup-svg-icon { background: var(--popup-icon-color); vertical-align: -3px; }
.popup-icon-users { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-users'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0' /%3E%3Cpath d='M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2' /%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75' /%3E%3Cpath d='M21 21v-2a4 4 0 0 0 -3 -3.85' /%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-users'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0' /%3E%3Cpath d='M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2' /%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75' /%3E%3Cpath d='M21 21v-2a4 4 0 0 0 -3 -3.85' /%3E%3C/svg%3E"); }
.popup-icon-tag { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-tag'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3Cpath d='M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3' /%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-tag'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M6.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3Cpath d='M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3' /%3E%3C/svg%3E"); }
.popup-icon-palette { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-palette'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25' /%3E%3Cpath d='M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3Cpath d='M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3Cpath d='M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-palette'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25' /%3E%3Cpath d='M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3Cpath d='M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3Cpath d='M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0' /%3E%3C/svg%3E"); }
.popup-icon-pin { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-map-pin'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0' /%3E%3Cpath d='M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0' /%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-map-pin'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0' /%3E%3Cpath d='M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0' /%3E%3C/svg%3E"); }
.popup-icon-shield { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-shield-check'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06' /%3E%3Cpath d='M15 19l2 2l4 -4' /%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-shield-check'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06' /%3E%3Cpath d='M15 19l2 2l4 -4' /%3E%3C/svg%3E"); }
.popup-icon-direction {
  background: var(--popup-direction-color) !important;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-direction-sign'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M3.32 12.774l7.906 7.905c.427 .428 1.12 .428 1.548 0l7.905 -7.905a1.095 1.095 0 0 0 0 -1.548l-7.905 -7.905a1.095 1.095 0 0 0 -1.548 0l-7.905 7.905a1.095 1.095 0 0 0 0 1.548' /%3E%3Cpath d='M8 12h7.5' /%3E%3Cpath d='M12 8.5l3.5 3.5l-3.5 3.5' /%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-direction-sign'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none' /%3E%3Cpath d='M3.32 12.774l7.906 7.905c.427 .428 1.12 .428 1.548 0l7.905 -7.905a1.095 1.095 0 0 0 0 -1.548l-7.905 -7.905a1.095 1.095 0 0 0 -1.548 0l-7.905 7.905a1.095 1.095 0 0 0 0 1.548' /%3E%3Cpath d='M8 12h7.5' /%3E%3Cpath d='M12 8.5l3.5 3.5l-3.5 3.5' /%3E%3C/svg%3E");
}

.popup-data-row b {
  color: var(--popup-heading-color);
  font-weight: 600;
}

.popup-directions-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--popup-direction-color) !important;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

[data-theme="dark"] .popup-title,
[data-theme="dark"] .popup-text b,
[data-theme="dark"] .popup-data-row b {
  color: #f1f5f9;
}

[data-theme="dark"] .popup-text,
[data-theme="dark"] .popup-data-row,
[data-theme="dark"] .popup-data-row > span:last-child {
  color: #cbd5e1;
}

[data-theme="dark"] {
  --popup-divider-color: rgba(255, 255, 255, 0.1);
}

.popup-pagination {
  background: var(--bg-input);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popup-page-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.popup-page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 28px;
  height: 28px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.8rem;
  transition: var(--transition-smooth);
}

.popup-page-btn:hover:not(.disabled) {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.popup-page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  box-shadow: var(--glass-shadow);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 540px;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-card-wide {
  max-width: 920px;
  width: 94%;
}

.data-table-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.data-table-wrap {
  overflow: auto;
  max-height: 60vh;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-input);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  z-index: 1;
}

.data-table thead th:hover {
  color: var(--accent-color);
}

.data-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.9rem;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--accent-color);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.tech-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-close-btn {
  display: none;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.sidebar-close-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.05);
}

.mobile-bottom-sheet {
  display: none;
}

@media (max-width: 1024px) {
  .sidebar-close-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    height: 100vh;
    top: 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1010;
  }

  .sidebar.left-sidebar {
    left: 0;
    transform: translateX(0);
  }

  .sidebar.left-sidebar.collapsed {
    transform: translateX(-100%);
    width: 340px;
  }

  .sidebar.right-sidebar {
    right: 0;
    transform: translateX(0);
  }

  .sidebar.right-sidebar.collapsed {
    transform: translateX(100%);
    width: 340px;
  }

  .left-toggle-btn {
    left: 340px;
    top: 50%;
    transform: translateY(-50%);
  }

  .left-toggle-btn.collapsed-layout {
    left: 0;
  }

  .right-toggle-btn {
    right: 340px;
    top: 50%;
    transform: translateY(-50%);
  }

  .right-toggle-btn.collapsed-layout {
    right: 0;
  }
}

.nav-logo-wrap {
  position: relative;
  height: 28px;
  display: inline-flex;
}

.nav-logo {
  height: 100%;
  width: auto;
  display: block;
}

.nav-logo-bars {
  display: none;
}

[data-theme="dark"] .nav-logo-text {
  clip-path: inset(0 0 22% 0);
  filter: brightness(10);
}

[data-theme="dark"] .nav-logo-bars {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  clip-path: inset(78% 0 0 0);
}



[data-theme="dark"] .brand-name {
  color: #47cde0;
}

[data-theme="dark"] .theme-sun-icon {
  background-color: #ffffff;
}

[data-theme="dark"] .nav-btn,
[data-theme="dark"] .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

[data-theme="dark"] .nav-btn:hover,
[data-theme="dark"] .icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #7dd3df;
  color: #7dd3df;
}



@media (max-width: 768px) {
  .leaflet-popup-content {
    width: min(var(--popup-card-width), calc(100vw - 40px)) !important;
  }

  .navbar {
    padding: 0 16px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .nav-btn span {
    display: none;
  }

  .nav-btn {
    padding: 8px;
  }

  .nav-logo-wrap {
    height: 30px;
  }

  .sidebar,
  .sidebar-toggle-btn {
    display: none !important;
  }

  .mobile-bottom-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1020;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  }

  .mobile-bottom-sheet.expanded {
    height: 60vh;
  }

  .sheet-drag-handle {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--text-secondary);
    opacity: 0.4;
    border-radius: 2px;
    z-index: 1021;
    pointer-events: none;
  }

  .sheet-header {
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    touch-action: none;
  }

  .sheet-tabs {
    display: flex;
    gap: 8px;
    height: 100%;
    align-items: center;
  }

  .sheet-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
  border-radius: 20px 8px 20px 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
  }

  .sheet-tab:hover {
    color: var(--text-primary);
    background: var(--bg-input);
  }

  .sheet-tab.active {
    color: #ffffff;
    background: var(--accent-gradient);
    box-shadow: 0 4px 12px var(--accent-glow);
  }

  .sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
  }

  .sheet-panel {
    display: none;
    height: 100%;
  }

  .sheet-panel.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
  }

  .sheet-panel #layers-container,
  .sheet-panel #right-sidebar-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .mobile-info-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
  }

  .mobile-info-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
  }

  .mobile-info-arrow.rotated {
    transform: rotate(180deg);
  }

  .mobile-info-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.35s ease;
    opacity: 0;
    padding: 0;
  }

  .mobile-info-panel.active {
    max-height: 60vh;
    overflow-y: auto;
    opacity: 1;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
  }

  .mobile-info-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
  }

  .mobile-info-body h4 {
    font-size: 0.9rem;
  }

  .basemap-selector-btn {
    bottom: 72px;
    left: 12px;
    z-index: 1030;
  }

  .basemap-dropdown {
    bottom: 120px;
    left: 12px;
    z-index: 1030;
  }

  /* Minimapa sobre el bottom-sheet colapsado */
  .leaflet-bottom.leaflet-right {
    margin-bottom: 64px;
  }

  /* Logo Madres compacto (círculo + emblema, sin letras) en móvil, según tema */
  .brand-logo-link .brand-logo-img,
  [data-theme="dark"] .brand-logo-link .brand-logo-dark {
    display: none;
  }

  .brand-logo-link .brand-logo-mark {
    display: block;
  }

  [data-theme="dark"] .brand-logo-link .brand-logo-mark {
    display: none;
  }

  [data-theme="dark"] .brand-logo-link .brand-logo-mark-dark {
    display: block;
  }
}

@media (max-width: 480px) {
  .brand-sub {
    display: none;
  }

  .modal-header,
  .modal-body {
    padding: 16px;
  }

  #welcome-modal .modal-body {
    font-size: 0.75rem;
    gap: 10px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.print-only {
  display: none !important;
}

body.print-mode-active {
  background-color: #ffffff !important;
  color: #000000 !important;
  height: 100vh !important;
  overflow: visible !important;
}

body.print-mode-active .navbar,
body.print-mode-active .sidebar,
body.print-mode-active .sidebar-toggle-btn,
body.print-mode-active .map-actions-bar,
body.print-mode-active .basemap-selector-btn,
body.print-mode-active .mobile-bottom-sheet,
body.print-mode-active .modal-overlay,
body.print-mode-active .modal-backdrop {
  display: none !important;
}

body.print-mode-active .app-container {
  display: block !important;
  width: 100% !important;
  height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.print-mode-active .map-wrapper {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100vh !important;
  padding: 30px !important;
  box-sizing: border-box !important;
}

body.print-mode-active .print-only {
  display: block !important;
}

body.print-mode-active #map {
  flex: 1 !important;
  height: 65vh !important;
  border: 2px solid #1e293b !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  margin: 15px 0 !important;
}

.print-header-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #1e293b;
  padding-bottom: 8px;
  font-family: var(--font-family);
}

.print-header-title h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

.print-header-title span {
  font-size: 0.8rem;
  color: #64748b;
}

.print-header-meta {
  text-align: right;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.print-footer-layout {
  border-top: 2px solid #1e293b;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-family: var(--font-family);
}

.print-legend-container h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

.print-footer-meta {
  text-align: right;
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

@media print {
  body * {
    visibility: hidden;
  }

  body.print-mode-active,
  body.print-mode-active * {
    visibility: visible;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 1000;
  background: transparent;
  transition: background 0.2s;
}

.sidebar-resizer:hover,
.sidebar-resizer.dragging {
  background: rgba(19, 236, 164, 0.4) !important;
}

body.dragging-sidebar .sidebar,
body.dragging-sidebar .left-toggle-btn {
  transition: none !important;
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 85vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--border-radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.1);
  object-fit: contain;
}

.lightbox-caption {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  max-width: 600px;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 3rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* ===== Auth Modal (estilo AppMurales app) ===== */
.auth-card {
  background: #ffffff;
  max-width: 420px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  max-height: calc(100vh - 24px);
}

.auth-card .modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  font-size: 1.5rem;
  line-height: 1;
}

.auth-body {
  padding: 16px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-header {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-logo {
  width: 80%;
  max-width: 280px;
  height: 112px;
  object-fit: contain;
  margin-bottom: 6px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e9ebb;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 16px;
  color: #666666;
  text-align: center;
}

.auth-form {
  width: 100%;
  margin-top: 8px;
}

.auth-input-container {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #cccccc;
  margin-bottom: 14px;
  padding-bottom: 5px;
}

.auth-icon {
  margin-right: 10px;
  color: #666666;
  font-size: 16px;
  width: 18px;
  text-align: center;
}

.auth-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  padding: 10px 0;
  color: #1e293b;
  font-family: inherit;
}

.auth-visibility-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #666666;
  font-size: 16px;
  padding: 4px;
}

.auth-visibility-btn:hover {
  color: #1e9ebb;
}

.auth-btn {
  background-color: #1e9ebb;
  border: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  padding: 15px;
  border-radius: 10px 10px 0 10px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  width: 100%;
  cursor: pointer;
  margin-top: 14px;
  transition: background-color 0.2s, transform 0.2s;
}

.auth-btn:hover {
  background-color: #0fcb8d;
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-link-btn {
  background: none;
  border: none;
  color: #1e9ebb;
  font-size: 16px;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  padding: 4px;
  cursor: pointer;
}

.auth-link-btn:hover {
  text-decoration: underline;
}

.auth-msg {
  display: none;
  font-size: 14px;
  text-align: center;
  border-radius: 8px;
  padding: 10px 12px;
}

.auth-msg.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.auth-msg.success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.auth-footer {
  text-align: center;
  font-size: 12px;
  color: #999999;
}

.auth-footer a {
  font-size: 12px;
  color: #1e9ebb;
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

@media (max-height: 720px) {
  .auth-logo {
    height: 84px;
    margin-bottom: 4px;
  }

  .auth-title {
    font-size: 20px;
  }

  .auth-subtitle {
    font-size: 14px;
  }

  .auth-input-container {
    margin-bottom: 10px;
  }

  .auth-input {
    padding: 6px 0;
    font-size: 15px;
  }

  .auth-btn {
    padding: 12px;
    margin-top: 12px;
    font-size: 16px;
  }

  .auth-link-btn {
    margin-top: 10px;
    font-size: 14px;
  }
}
/* Minimapa de referencia (paleta Madres) */
.leaflet-control-minimap { border-radius: 10px !important; border: 3px solid rgba(30, 158, 187, 0.5) !important; box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important; overflow: hidden; }
.leaflet-control-minimap-toggle-display { border-radius: 10px 0 0 0 !important; background-color: rgba(30, 158, 187, 0.85) !important; background-image: none !important; }
#print-preview-toolbar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; align-items: center; gap: 8px; background: var(--map-ui-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 8px 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.25); font-size: 0.8rem; color: var(--map-ui-text); max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
#print-preview-toolbar .ppt-btn { border: 1px solid var(--border-color); background: var(--map-ui-bg); color: var(--map-ui-text); border-radius: 8px; padding: 7px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
#print-preview-toolbar .ppt-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
#print-preview-toolbar .ppt-primary { background: var(--accent-color); border-color: var(--accent-color); color: #fff; }
#print-preview-toolbar .ppt-primary:hover { color: #fff; filter: brightness(1.05); }
@media print { #print-preview-toolbar { display: none !important; } }
@page { size: A4 landscape; margin: 10mm; }
body.print-mode-active .map-wrapper { height: auto !important; min-height: 0 !important; padding: 5mm !important; }
body.print-mode-active .print-header-layout { display: flex !important; justify-content: space-between; align-items: center; padding-bottom: 3mm; }
body.print-mode-active .print-footer-layout { display: flex !important; padding-top: 3mm; }
body.print-mode-active #map { flex: none !important; height: 128mm !important; margin: 4mm 0 !important; }
body.print-mode-active .print-header-title h2 { font-size: 16pt; }
body.print-mode-active .print-header-brand, body.print-mode-active .print-header-side { display: flex !important; align-items: center; gap: 4mm; }
body.print-mode-active .print-logo { height: 10mm !important; width: auto !important; }
