:root {
  color-scheme: dark;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Color Palette - Dark by default (Estilo eventclass.pascualfm.es) */
  --bg-main: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: rgba(22, 33, 56, 0.65);
  --bg-card-hover: rgba(30, 44, 75, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-accent: #38bdf8;

  /* Anular variables por defecto de Bootstrap para que no oscurezcan el texto */
  --bs-body-color: var(--text-main);
  --bs-body-color-rgb: 248, 250, 252;
  --bs-heading-color: var(--text-main);
  --bs-secondary-color: var(--text-muted);
  --bs-tertiary-color: var(--text-muted);
  --bs-table-color: var(--text-main);
  --bs-card-color: var(--text-main);
  --bs-body-bg: var(--bg-main);

  --accent-primary: #3b82f6;
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #ec4899 100%);
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --card-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);

  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;

  /* Variables exactas de http://localhost/wordpress/ (Estilo Stat-Card / Mueble) */
  --wp-btn-grad-1: #212529;
  --wp-btn-grad-2: #495057;
  --wp-btn-border: rgba(255, 255, 255, 0.12);
  --wp-btn-shadow1: rgba(0, 0, 0, 0.5);
  --wp-btn-shadow2: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  color-scheme: light;

  /* Modo Claro: Variables exactas de WordPress */
  --wp-btn-grad-1: #fdfbfb;
  --wp-btn-grad-2: #ebedee;
  --wp-btn-border: rgba(255, 255, 255, 0.6);
  --wp-btn-shadow1: rgba(0, 0, 0, 0.08);
  --wp-btn-shadow2: rgba(0, 0, 0, 0.03);

  --bs-body-color: #0f172a;
  --bs-body-color-rgb: 15, 23, 42;
  --bs-heading-color: #0f172a;
  --bs-secondary-color: #475569;
  --bs-tertiary-color: #475569;
  --bs-table-color: #0f172a;
  --bs-card-color: #0f172a;
  --bs-body-bg: #f8fafc;

  --bg-main: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --border-card: rgba(0, 0, 0, 0.08);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-accent: #0284c7;

  --accent-primary: #2563eb;
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #4f46e5 50%, #db2777 100%);
  --card-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .blob {
  opacity: 0.11;
}

[data-theme="light"] .theme-toggle-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #64748b;
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0284c7;
}

[data-theme="light"] .badge-status {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

[data-theme="light"] .form-control,
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #0f172a !important;
}

[data-theme="light"] select option {
  background-color: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .table tbody tr {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .table tbody tr:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .tarjeta {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] a.tarjeta:hover {
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.1), 0 0 15px rgba(2, 132, 199, 0.15);
}

[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
}

/* ========================================================
   TEMA ORGANIZADOR PRO / SAAS FORMAL
   (Estilo exacto de eventclass.pascualfm.es [data-theme="organizer"])
   ======================================================== */
[data-theme="organizer"] {
  color-scheme: dark;

  --bs-body-color: #f8fafc;
  --bs-body-color-rgb: 248, 250, 252;
  --bs-heading-color: #f8fafc;
  --bs-secondary-color: #ced4da;
  --bs-tertiary-color: #ced4da;
  --bs-table-color: #f8fafc;
  --bs-card-color: #f8fafc;
  --bs-body-bg: #2B3035;

  --app-bg: #2B3035;
  --app-card-bg: #212529;
  --app-text-title: #f8fafc;
  --app-text-normal: #ced4da;
  --app-text-muted: #adb5bd;
  --app-border: #495057;
  --app-border-subtle: #468cdb;

  --app-primary: #4a90e2;
  --app-primary-hover: #357abd;
  --app-primary-rgb: 74, 144, 226;

  --bg-main: var(--app-bg);
  --bg-secondary: var(--app-card-bg);
  --bg-card: var(--app-card-bg);
  --bg-card-hover: #262a2e;
  --border-card: var(--app-border-subtle);

  --text-main: var(--app-text-title);
  --text-muted: var(--app-text-normal);
  --text-accent: var(--app-primary);

  --accent-primary: var(--app-primary);
  --accent-gradient: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  --accent-gold: #f59e0b;
  --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="organizer"] .background-decorations {
  display: none !important;
}

[data-theme="organizer"] .card,
[data-theme="organizer"] .glass-card,
[data-theme="organizer"] .tarjeta,
[data-theme="organizer"] .auth-card {
  background: linear-gradient(135deg, #212529 0%, #495057 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="organizer"] .card::before,
[data-theme="organizer"] .glass-card::before,
[data-theme="organizer"] .tarjeta::before,
[data-theme="organizer"] .auth-card::before {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
}

[data-theme="organizer"] .tarjeta:hover {
  border-color: #4a90e2 !important;
}

[data-theme="organizer"] .form-control,
[data-theme="organizer"] input,
[data-theme="organizer"] select,
[data-theme="organizer"] textarea {
  background-color: #212529 !important;
  border: 1px solid #495057 !important;
  color: #e9ecef !important;
}

[data-theme="organizer"] .btn-primary {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
  border: 1px solid #4a90e2 !important;
  box-shadow: 0 4px 14px rgba(74, 144, 226, 0.35) !important;
}

[data-theme="organizer"] .table tbody tr {
  background: #212529;
  border: 1px solid #495057;
}

[data-theme="organizer"] .table tbody tr:hover {
  background: #2b3035;
}

/* ========================================================
   PIEL PRO (ORGANIZADOR) PARA METEO, PROYECTOS Y PIRÁMIDE
   ======================================================== */
[data-theme="organizer"] .meteo-rock-widget,
[data-theme="organizer"] .proyecto-card,
[data-theme="organizer"] .stat-card,
[data-theme="organizer"] .pyramid-header-card,
[data-theme="organizer"] .pyramid-card,
[data-theme="organizer"] .pyramid-kpi-card,
[data-theme="organizer"] .empty-state-card {
  background: linear-gradient(135deg, #212529 0%, #495057 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
  color: #f8fafc !important;
}

[data-theme="organizer"] .proyecto-card:hover,
[data-theme="organizer"] .stat-card:hover,
[data-theme="organizer"] .meteo-rock-widget:hover {
  border-color: #4a90e2 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Meteo en Modo Pro */
[data-theme="organizer"] .meteo-temp-big-card,
[data-theme="organizer"] .meteo-subcard,
[data-theme="organizer"] .hourly-strip-wrapper {
  background: #212529 !important;
  border: 1px solid #495057 !important;
}

[data-theme="organizer"] .meteo-badge-status {
  border-radius: 6px !important;
}

[data-theme="organizer"] .tacto-optimo {
  background: rgba(34, 197, 94, 0.18) !important;
  border-color: #22c55e !important;
  color: #4ade80 !important;
}

[data-theme="organizer"] .btn-toggle-meteo,
[data-theme="organizer"] .meteo-sun-badge {
  background: #212529 !important;
  border: 1px solid #495057 !important;
  color: #ced4da !important;
}

[data-theme="organizer"] .btn-toggle-meteo:hover {
  background: #2b3035 !important;
  color: #fff !important;
}

/* Proyectos en Modo Pro */
[data-theme="organizer"] .filter-pills {
  background: #212529 !important;
  border: 1px solid #495057 !important;
}

[data-theme="organizer"] .filter-pill {
  color: #adb5bd !important;
}

[data-theme="organizer"] .filter-pill.active {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35) !important;
}

[data-theme="organizer"] .btn-pegue {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
  border: 1px solid #4a90e2 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3) !important;
}

[data-theme="organizer"] .btn-pegue-encadenada {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  border: 1px solid #16a34a !important;
  color: #fff !important;
}

[data-theme="organizer"] .specs-bar {
  background: #212529 !important;
  border: 1px solid #495057 !important;
  color: #ced4da !important;
}

[data-theme="organizer"] .specs-pegues {
  background: #2b3035 !important;
  color: #f8fafc !important;
  border: 1px solid #495057 !important;
}

[data-theme="organizer"] .last-attempt-box {
  background: #1c2024 !important;
  border: 1px solid #343a40 !important;
}

[data-theme="organizer"] .stat-icon {
  background: #2b3035 !important;
  border: 1px solid #495057 !important;
}

[data-theme="organizer"] .sort-select,
[data-theme="organizer"] .search-input {
  background-color: #212529 !important;
  border: 1px solid #495057 !important;
  color: #e9ecef !important;
}

/* Pirámide en Modo Pro */
[data-theme="organizer"] .pyramid-level-block {
  background: #212529 !important;
  border: 1px solid #495057 !important;
}

[data-theme="organizer"] .pyramid-level-block:hover {
  background: #262b30 !important;
  border-color: #4a90e2 !important;
}

[data-theme="organizer"] .pyramid-row-track {
  background: #1c2024 !important;
  border: 1px solid #343a40 !important;
}

[data-theme="organizer"] .pyramid-vias-dropdown {
  background: #1c2024 !important;
  border-top-color: #343a40 !important;
}

[data-theme="organizer"] .pyramid-via-item {
  background: #212529 !important;
  border: 1px solid #495057 !important;
}

[data-theme="organizer"] .btn-icon {
  background: #2b3035 !important;
  border: 1px solid #495057 !important;
  color: #ced4da !important;
}

[data-theme="organizer"] .btn-icon:hover {
  background: #343a40 !important;
  border-color: #4a90e2 !important;
  color: #fff !important;
}

[data-theme="organizer"] .view-mode-selector {
  background: #212529 !important;
  border-color: #495057 !important;
}

[data-theme="organizer"] .btn-view-mode {
  color: #adb5bd !important;
}

[data-theme="organizer"] .btn-view-mode.active {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%) !important;
  color: #fff !important;
}

/* Selector de Vista Lista / Mapa (Normal) */
.view-mode-selector {
  display: inline-flex;
  background: rgba(125, 125, 125, 0.08);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.btn-view-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-view-mode:hover {
  color: var(--text-main);
}

.btn-view-mode.active {
  background: var(--primary, #f97316);
  color: #fff;
  box-shadow: none;
}

/* ========================================================
   GLOBAL TEXT CONTRAST & BOOTSTRAP OVERRIDES
   Garantiza contraste óptimo y que ningún texto quede oscuro
   ======================================================== */
body, main, .app-container, .card, .glass-card, .tarjeta, .auth-card {
  color: var(--text-main) !important;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--text-main) !important;
}

p, span, div, strong, b, label, .form-label {
  color: inherit;
}

.text-muted, small.text-muted, p.text-muted, span.text-muted {
  color: var(--text-muted) !important;
}

.lead {
  color: var(--text-muted) !important;
}

.tarjeta strong {
  color: var(--text-main) !important;
}

.tarjeta small {
  color: var(--text-muted) !important;
}

/* Tablas: Forzar color legible de cabeceras, filas y celdas */
.table,
.table > :not(caption) > * > *,
.table th,
.table td {
  color: var(--text-main) !important;
  background-color: transparent !important;
}

.table thead th {
  color: var(--text-muted) !important;
}

/* Formularios: Etiquetas, textos de ayuda y placeholders */
.form-label, label {
  color: var(--text-main) !important;
}

.form-control, input, select, textarea {
  color: var(--text-main) !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.7;
}

.form-text, .field-hint {
  color: var(--text-muted) !important;
}



* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-bottom: 40px;
}

/* Background Animated Blobs */
.background-decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.18;
  animation: float 20s infinite alternate ease-in-out;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: #38bdf8;
  top: -80px;
  left: -80px;
}

.blob-2 {
  width: 480px;
  height: 480px;
  background: #a855f7;
  bottom: 5%;
  right: -100px;
  animation-duration: 25s;
}

.blob-3 {
  width: 320px;
  height: 320px;
  background: #ec4899;
  top: 40%;
  left: 35%;
  opacity: 0.13;
  animation-duration: 18s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* App Container */
.app-container {
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

/* Header Principal */
.app-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-card);
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
}

.header-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  outline: none !important;
  border: none !important;
}

.header-brand-link:focus,
.header-brand-link:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.header-brand-link .user-title-img,
.header-brand-link .user-title-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-brand-link:hover .user-title-img {
  transform: scale(1.08) rotate(-4deg);
}

.header-brand-link .user-title-text {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
}

.header-right-zone {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1.15rem;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--wp-btn-grad-1) 0%, var(--wp-btn-grad-2) 100%) !important;
  border: 1px solid var(--wp-btn-border) !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px var(--wp-btn-shadow1), 0 2px 4px var(--wp-btn-shadow2) !important;
  user-select: none;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary) !important;
  transform: translateY(-2px) rotate(15deg);
  box-shadow: 0 10px 20px var(--wp-btn-shadow1), 0 4px 8px var(--wp-btn-shadow2) !important;
}

.theme-toggle-btn:disabled,
.theme-toggle-btn[disabled] {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.8) !important;
  transform: none !important;
  box-shadow: none !important;
}

.theme-pro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1.15rem;
  color: var(--text-main);
  background: linear-gradient(135deg, var(--wp-btn-grad-1) 0%, var(--wp-btn-grad-2) 100%) !important;
  border: 1px solid var(--wp-btn-border) !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px var(--wp-btn-shadow1), 0 2px 4px var(--wp-btn-shadow2) !important;
  user-select: none;
  flex-shrink: 0;
}

.theme-pro-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary) !important;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 20px var(--wp-btn-shadow1), 0 4px 8px var(--wp-btn-shadow2) !important;
}

.theme-pro-btn.active {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 6px 18px rgba(74, 144, 226, 0.45) !important;
}


.header-left h1,
.header-title-container h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  outline: none !important;
  border: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.header-left h1:focus,
.header-left h1:focus-visible,
.header-title-container h1:focus,
.header-title-container h1:focus-visible,
.app-header h1:focus,
.app-header h1:focus-visible,
h1:focus,
h1:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.header-left h1 .user-title-icon,
.header-left h1 .user-title-img,
.header-title-container h1 .user-title-icon,
.header-title-container h1 .user-title-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  font-size: 1.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.header-left h1 .user-title-text,
.header-title-container h1 .user-title-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.action-pill-btn {
  background: linear-gradient(135deg, var(--wp-btn-grad-1) 0%, var(--wp-btn-grad-2) 100%) !important;
  border: 1px solid var(--wp-btn-border) !important;
  border-radius: 14px;
  padding: 0.5rem 1.1rem !important;
  color: var(--text-main) !important;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--wp-btn-shadow1), 0 2px 4px var(--wp-btn-shadow2) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--wp-btn-shadow1), 0 4px 8px var(--wp-btn-shadow2) !important;
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
}

.action-pill-btn.logout-pill:hover {
  border-color: #ef4444 !important;
  color: #f87171 !important;
}

/* Avatar de usuario en cabecera */
.user-avatar-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  vertical-align: middle;
}
.user-avatar-icon-img {
  max-width: 15px;
  max-height: 15px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.user-avatar-photo-img,
.user-avatar-img-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-primary);
  display: inline-block;
  vertical-align: middle;
}
.user-avatar-emoji-btn {
  font-size: 1.05rem;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* Modal de Perfil - Avatares */
.avatar-preview-box {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-body);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  margin: 0 auto 0.85rem auto;
}
.avatar-preview-icon {
  max-width: 52px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.avatar-preview-photo,
.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-preview-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.avatar-presets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.avatar-preset-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.avatar-preset-btn:hover {
  transform: scale(1.15);
  border-color: var(--accent-primary);
}
.avatar-preset-btn.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.15);
}
.avatar-preset-img {
  max-width: 28px;
  max-height: 28px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Home - Avatar grande */
.home-avatar-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 auto 0.75rem auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  outline: none;
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.home-avatar-btn:hover .home-avatar-badge,
.home-avatar-btn:hover .home-avatar-photo {
  transform: scale(1.06);
  border-color: #f59e0b;
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.45);
}

.home-avatar-btn:active {
  transform: scale(0.96);
}

.home-avatar-badge {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-avatar-emoji {
  font-size: 2.8rem;
  line-height: 1;
}

.home-avatar-icon-img {
  max-width: 56px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.home-avatar-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  margin: 0 auto;
  display: block;
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-avatar-edit-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.92);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 20px;
  padding: 2px 10px;
  margin-top: -12px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease, transform 0.2s ease;
}

[data-theme="light"] .home-avatar-edit-pill {
  background: #ffffff;
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.4);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.home-avatar-btn:hover .home-avatar-edit-pill {
  background: #f59e0b;
  color: #0f172a;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

/* ========================================================
   BARRA DE NAVEGACIÓN - EXACTO .nav-link-custom DE WORDPRESS
   http://localhost/wordpress/ (Inicio, Características, Galería...)
   ======================================================== */
.nav-pill-track {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.3rem 0.2rem 1.25rem;
  scrollbar-width: thin;
  margin-bottom: 1.5rem;
}

.nav-pill-item {
  background: linear-gradient(135deg, var(--wp-btn-grad-1) 0%, var(--wp-btn-grad-2) 100%) !important;
  border: 1px solid var(--wp-btn-border) !important;
  border-radius: 14px;
  padding: 0.5rem 1.1rem !important;
  color: var(--text-main) !important;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--wp-btn-shadow1), 0 2px 4px var(--wp-btn-shadow2) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-pill-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--wp-btn-shadow1), 0 4px 8px var(--wp-btn-shadow2) !important;
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
}

/* Estado activo / seleccionado (Idéntico a WordPress .nav-link-custom.active) */
.nav-pill-item.active {
  background: linear-gradient(135deg, var(--wp-btn-grad-1) 0%, var(--wp-btn-grad-2) 100%) !important;
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
  font-weight: 700;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35), inset 0 0 0 1px var(--accent-primary) !important;
}

/* Glassmorphism Cards */
.card, .glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(14px);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  color: var(--text-main);
}

.card::before, .glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0.75;
}

.card-header-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-card);
}

.card-header-clean h2, .card-header-clean h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Interactive Dashboard Tiles */
.tarjeta {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tarjeta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
}

a.tarjeta:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
  color: #fff;
}

a.tarjeta:hover::before {
  opacity: 1;
}

.tarjeta .icono {
  font-size: 2.2rem;
  line-height: 1;
}

.tarjeta strong {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.tarjeta small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.tarjeta.deshabilitada {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ========================================================
   BOTONES - Morfología y relieve exactos de WordPress
   ======================================================== */
.btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  text-decoration: none;
  line-height: 1.25;
  user-select: none;
  white-space: nowrap;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Botón Primario: Mantiene su color gradiente característico con el relieve y sombras de WordPress */
.btn-primary {
  background: var(--accent-gradient) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px var(--wp-btn-shadow1), 0 2px 4px var(--wp-btn-shadow2), 0 0 15px rgba(59, 130, 246, 0.3) !important;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 10px 20px var(--wp-btn-shadow1), 0 4px 8px var(--wp-btn-shadow2), 0 0 25px rgba(59, 130, 246, 0.5) !important;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 10px var(--wp-btn-shadow1) !important;
}

/* Botón Secundario: Estilo exacto de las tarjetas/muebles de WordPress */
.btn-secondary {
  background: linear-gradient(135deg, var(--wp-btn-grad-1) 0%, var(--wp-btn-grad-2) 100%) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--wp-btn-border) !important;
  border-radius: 14px;
  box-shadow: 0 4px 12px var(--wp-btn-shadow1), 0 2px 4px var(--wp-btn-shadow2) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
  box-shadow: 0 10px 20px var(--wp-btn-shadow1), 0 4px 8px var(--wp-btn-shadow2) !important;
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
}

/* Botón Peligro / Eliminar: Fondo con acento rojo suave y hover rojo intenso */
.btn-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(0);
}

/* Variante compacta para tablas y acciones rápidas */
.btn-compact {
  padding: 0.5rem 0.95rem !important;
  font-size: 0.86rem !important;
  border-radius: 0.65rem !important;
  gap: 0.4rem !important;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label, label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-main);
}

.form-control, input, select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius-sm);
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-card) !important;
  color: var(--text-main) !important;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

/* File Upload Controls (InputFile) */
input[type="file"].form-control,
.form-control[type="file"] {
  background-color: var(--bg-secondary) !important;
  color: var(--text-main) !important;
  border: 1px dashed var(--border-card) !important;
  padding: 0.5rem 0.85rem !important;
  cursor: pointer;
  display: flex;
  align-items: center;
}

input[type="file"]::file-selector-button,
.form-control[type="file"]::file-selector-button {
  background: linear-gradient(135deg, var(--wp-btn-grad-1) 0%, var(--wp-btn-grad-2) 100%) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--wp-btn-border) !important;
  border-radius: 10px !important;
  padding: 0.45rem 1rem !important;
  margin-right: 1rem !important;
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--wp-btn-shadow1) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="file"]::file-selector-button:hover,
.form-control[type="file"]::file-selector-button:hover {
  border-color: var(--accent-primary) !important;
  color: var(--accent-primary) !important;
  transform: translateY(-1px);
}

select option {
  background-color: #131b2e;
  color: #f1f5f9;
}

.form-text, .field-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Auth Card */
.auth-card {
  max-width: 440px;
  margin: 3.5rem auto;
  padding: 2.25rem;
  border-radius: var(--border-radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
}

.auth-card h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-align: center;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-card a {
  color: var(--text-accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-card a:hover {
  text-decoration: underline;
}

/* Tables */
.table {
  color: var(--text-main);
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  margin-top: 1rem;
}

.table thead th {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border: none;
  padding: 0.6rem 1rem;
}

.table tbody tr {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border: none;
  color: var(--text-main);
}

.table tbody tr td:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.table tbody tr td:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Pill Badges */
.badge-pill-accent {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
}

.badge-grade {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #fff;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  border: 1px solid;
  margin-bottom: 1.25rem;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Loading */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1.25rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-family: var(--font-heading);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

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

/* Footer */
.app-footer {
  margin-top: 3.5rem;
  margin-bottom: 2rem;
  background: transparent !important;
  border: none !important;
  padding: 0 1rem !important;
  text-align: center;
}

.footer-card {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.35rem 1.75rem !important;
  border-radius: 16px !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.footer-app-name {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-escalador-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: -3px;
  margin-right: 6px;
}

.footer-credits {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-credits strong {
  color: var(--accent-primary, #f97316);
}

.footer-bullet {
  color: var(--text-muted);
  opacity: 0.5;
}

.footer-portal-link {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  padding: 2px 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  font-size: 0.82rem;
}

.footer-portal-link:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.footer-offline-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
}

/* ========================================================
   ESTILOS FOOTER PARA MODO ORGANIZADOR PRO (💼)
   ======================================================== */
[data-theme="organizer"] .footer-card {
  background: linear-gradient(135deg, #212529 0%, #495057 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="organizer"] .footer-app-name {
  color: #f8fafc !important;
}

[data-theme="organizer"] .footer-credits {
  color: #ced4da !important;
}

[data-theme="organizer"] .footer-credits strong {
  color: #4a90e2 !important;
}

[data-theme="organizer"] .footer-bullet {
  color: #6c757d !important;
}

[data-theme="organizer"] .footer-portal-link {
  color: #4a90e2 !important;
  border: 1px solid #4a90e2 !important;
  background: rgba(74, 144, 226, 0.12) !important;
  box-shadow: none !important;
}

[data-theme="organizer"] .footer-portal-link:hover {
  color: #ffffff !important;
  background: #4a90e2 !important;
  border-color: #357abd !important;
  box-shadow: 0 4px 14px rgba(74, 144, 226, 0.35) !important;
  transform: translateY(-1px);
}

[data-theme="organizer"] .footer-offline-hint {
  color: #adb5bd !important;
}

/* Blazor Error UI */
#blazor-error-ui {
  background: #1e293b;
  color: #f87171;
  bottom: 0;
  box-shadow: 0 -1px 20px rgba(0, 0, 0, 0.5);
  display: none;
  left: 0;
  padding: 0.75rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 10000;
  border-top: 2px solid #ef4444;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-weight: 600;
}

#blazor-error-ui .reload {
  color: #38bdf8;
  text-decoration: underline;
  cursor: pointer;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 1.5rem;
  font-size: 1.2rem;
  color: #94a3b8;
}

/* ========================================================
   RUTAS GPX Y APROXIMACIÓN (Geo Tracker / Senderismo)
   ======================================================== */
.route-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.route-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.route-badge-inactive {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px dashed rgba(148, 163, 184, 0.3);
}

.gpx-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.gpx-metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  text-align: center;
  backdrop-filter: blur(8px);
}

.gpx-metric-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-primary);
  display: block;
}

.gpx-metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.gpx-map-container {
  width: 100%;
  height: 380px;
  border-radius: 14px;
  border: 1px solid var(--border-card);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin: 1rem 0;
  z-index: 1;
}

.gpx-upload-box {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  background: rgba(56, 189, 248, 0.03);
  transition: all 0.25s ease;
  cursor: pointer;
}

.gpx-upload-box:hover {
  border-color: var(--accent-primary);
  background: rgba(56, 189, 248, 0.08);
}

/* Panel de Edición y Recorte de GPX */
.gpx-trim-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.gpx-trim-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.gpx-range-input {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* ========================================================
   MODAL DE VISUALIZACIÓN Y RECORTE GPX
   ======================================================== */
.gpx-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1040;
  animation: gpxFadeIn 0.2s ease-out;
}

.gpx-modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 1rem;
  pointer-events: none;
}

.gpx-modal-dialog {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  width: 95vw;
  max-width: 1250px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: gpxScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gpx-modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.gpx-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gpx-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.gpx-modal-dialog .gpx-map-container {
  height: 440px;
  margin: 0 0 1rem 0;
}

@keyframes gpxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 768px) {
  .gpx-modal-backdrop {
    padding: 0.5rem;
  }
  .gpx-modal-dialog {
    width: 100vw;
    height: 96vh;
    max-height: 96vh;
    border-radius: 14px;
  }
  .gpx-modal-dialog .gpx-map-container {
    height: 300px;
  }
}

/* ========================================================
   BARRA DE NAVEGACIÓN INFERIOR PARA MÓVILES (Estilo App Nativa)
   ======================================================== */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--wp-btn-grad-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--wp-card-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.mobile-tab-item {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted) !important;
  text-decoration: none !important;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 6px 1px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mobile-tab-item .mobile-tab-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-tab-item:active .mobile-tab-icon {
  transform: scale(0.85);
}

.mobile-tab-item.active {
  color: var(--accent-primary) !important;
  font-weight: 700;
}

.mobile-tab-item.active .mobile-tab-icon {
  transform: scale(1.18) translateY(-2px);
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.45));
}

.mobile-tab-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  background: var(--accent-primary);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 8px var(--accent-primary);
}

/* ========================================================
   OPTIMIZACIONES DE ESPACIO EN PANTALLAS MÓVILES (<= 768px)
   ======================================================== */
@media (max-width: 768px) {
  /* Dejar margen abajo en el contenedor para que la barra fija no tape nada */
  .app-container {
    padding: 0.55rem 0.75rem !important;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 12px)) !important;
  }

  /* Encabezado compacto en móvil EN UNA SOLA LÍNEA */
  .app-header {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.45rem !important;
    gap: 0.4rem !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Marca (Izquierda): Título e icono reducidos para convivir en una sola línea */
  .header-brand {
    order: 1 !important;
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    margin-top: 0 !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }

  .header-brand-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  .header-brand-link .user-title-img,
  .header-brand-link .user-title-icon {
    width: 26px !important;
    height: 26px !important;
    object-fit: contain !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
  }

  .header-brand-link .user-title-text {
    font-size: 1.05rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Zona Derecha: todo en fila compacta */
  .header-right-zone {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: auto !important;
    order: 2 !important;
    gap: 0.25rem !important;
    flex-shrink: 0 !important;
  }

  /* Indicador offline / online compacto solo icono */
  .sync-widget-wrapper {
    display: inline-flex !important;
    position: static !important; /* Para que el panel flotante se posicione relativo al contenedor en móvil */
  }

  .sync-dropdown-panel {
    position: fixed !important;
    top: 55px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
  }

  .sync-status-btn {
    padding: 0.2rem 0.45rem !important;
    height: 30px !important;
    font-size: 0.75rem !important;
    border-radius: 8px !important;
    gap: 0.2rem !important;
  }

  .sync-status-btn .sync-text {
    display: none !important;
  }

  .theme-buttons-group {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
  }

  .theme-toggle-btn, .theme-pro-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
  }

  .header-actions {
    gap: 0.25rem !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Botón de perfil en móvil: botón táctil 30x30 con el icono 👤 */
  .user-pill {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    cursor: pointer;
  }
  .user-pill .user-email-label {
    display: none !important;
  }
  .user-pill .btn-icon {
    font-size: 0.85rem !important;
    margin: 0 !important;
  }

  /* Avatar de usuario en cabecera */
  .user-avatar-img-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--accent-primary);
    display: inline-block;
    vertical-align: middle;
  }
  .user-avatar-emoji-btn {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
  }

  /* Modal de Perfil - Avatares */
  .avatar-preview-box {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-body);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    margin: 0 auto 0.85rem auto;
  }
  .avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .avatar-preview-emoji {
    font-size: 2.5rem;
    line-height: 1;
  }

  .avatar-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  .avatar-preset-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
  }
  .avatar-preset-btn:hover {
    transform: scale(1.15);
    border-color: var(--accent-primary);
  }
  .avatar-preset-btn.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.45);
    background: rgba(249, 115, 22, 0.15);
  }
  .avatar-preset-img {
    max-width: 28px;
    max-height: 28px;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  /* Botón Salir: solo el icono de la puerta en un botoncito cuadrado táctil */
  .logout-pill {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }

  .logout-pill .btn-icon {
    font-size: 0.85rem !important;
    margin: 0 !important;
  }

  .logout-pill .btn-label {
    display: none !important; /* Ocultar texto 'Salir' en móvil */
  }

  /* Ocultar la barra de pills horizontal vieja en móviles */
  .nav-pill-track {
    display: none !important;
  }

  /* Maximizar espacio de tarjetas y cabeceras en móviles */
  .card, .glass-card {
    padding: 0.85rem 0.75rem !important;
    margin-bottom: 1rem !important;
    border-radius: 14px !important;
  }

  .card-header-clean {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
  }

  .card-header-clean h2, 
  .card-header-clean h3 {
    font-size: 1.05rem !important;
    gap: 6px !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-header-clean .btn-compact {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }

  /* Tabla de zonas compacta en móvil */
  .table {
    font-size: 0.88rem !important;
  }
  .table th, .table td {
    padding: 0.55rem 0.35rem !important;
    vertical-align: middle;
  }
  .zona-nombre {
    font-size: 0.95rem !important;
  }
  .table .btn-compact {
    padding: 0.28rem 0.55rem !important;
    font-size: 0.78rem !important;
  }

  .text-center-mobile {
    text-align: center !important;
  }

  .btn-icon-mobile {
    padding: 3px 5px !important;
    font-size: 0.75rem !important;
    min-width: 26px !important;
    height: 26px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
  }

  .th-compact {
    font-size: 0.68rem !important;
    padding: 0.4rem 0.2rem !important;
    letter-spacing: 0.04em !important;
    color: var(--text-muted) !important;
    font-weight: 700 !important;
  }

  /* Footer con margen para no chocar con la barra inferior */
  .app-footer {
    padding-bottom: 0.5rem !important;
  }
}

.th-compact {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

/* Indicador interactivo GPX / Parking junto al nombre */
.btn-gpx-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
  vertical-align: middle;
}

.btn-gpx-indicator:hover,
.btn-gpx-indicator:active {
  transform: scale(1.15);
  background: rgba(59, 130, 246, 0.35);
}

/* ========================================================
   ILUSTRACIONES LATERALES DECORATIVAS RESPONSIVE (PC / Desktop)
   Ocupan el 100% de la altura de la ventana (de arriba a abajo)
   ======================================================== */
.pc-side-bg {
  display: none !important;
  position: fixed;
  top: 0;
  bottom: 0;
  height: 100vh;
  z-index: 1; /* Detrás del contenido para no molestar */
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}

/* Solo se muestran en PC (>= 1200px) donde hay margen exterior suficiente */
@media (min-width: 1200px) {
  .pc-side-bg {
    display: flex !important;
    align-items: stretch;
  }
}

/* Blindaje absoluto: en móviles y tablets (< 1200px) NUNCA se muestran */
@media (max-width: 1199px) {
  .pc-side-bg,
  .pc-side-bg-left,
  .pc-side-bg-right,
  .pc-side-bg img {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
  }
}

/* Lateral Izquierdo (Roca que emerge de la izquierda) */
.pc-side-bg-left {
  left: 0;
  justify-content: flex-start;
  width: auto;
  max-width: clamp(200px, calc((100vw - 1000px) / 2 + 60px), 480px);
}

.pc-side-bg-left img {
  height: 100vh;
  max-height: 100vh;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  object-position: left center;
  filter: drop-shadow(8px 0 20px rgba(0, 0, 0, 0.45));
  opacity: 0.92;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lateral Derecho (Roca que emerge de la derecha) */
.pc-side-bg-right {
  right: 0;
  justify-content: flex-end;
  width: auto;
  max-width: clamp(200px, calc((100vw - 1000px) / 2 + 60px), 480px);
}

.pc-side-bg-right img {
  height: 100vh;
  max-height: 100vh;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  object-position: right center;
  filter: drop-shadow(-8px 0 20px rgba(0, 0, 0, 0.45));
  opacity: 0.92;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adaptación responsive para pantallas intermedias o portátiles (1200px a 1440px):
   Mantiene el 100% de altura pero atenúa su opacidad para una lectura perfecta */
@media (min-width: 1200px) and (max-width: 1440px) {
  .pc-side-bg-left,
  .pc-side-bg-right {
    max-width: clamp(140px, calc((100vw - 1020px) / 2), 260px);
  }

  .pc-side-bg-left img,
  .pc-side-bg-right img {
    opacity: 0.55;
  }
}

/* Pantallas Ultrawide / 4K (> 1920px): Presencia completa */
@media (min-width: 1921px) {
  .pc-side-bg-left,
  .pc-side-bg-right {
    max-width: min(550px, 25vw);
  }

  .pc-side-bg-left img,
  .pc-side-bg-right img {
    opacity: 0.95;
  }
}

/* ========================================================
   DRONES DJI NEO Y BASES DE DESPEGUE/ATERRIZAJE (PC)
   ======================================================== */
.drone-actor {
  display: block;
  position: fixed;
  width: var(--tamano-dron, 58px);
  height: var(--tamano-dron, 58px);
  max-width: var(--tamano-dron, 58px);
  max-height: var(--tamano-dron, 58px);
  z-index: 120 !important;
  cursor: grab;
  user-select: none;
  touch-action: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.8));
  transition: opacity 0.3s ease;
  will-change: transform, left, top;
}

.drone-actor:active {
  cursor: grabbing;
}

.drone-actor.drone-dragging {
  cursor: grabbing !important;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.9)) brightness(1.18) !important;
  transition: none !important;
  animation: none !important;
  z-index: 999999 !important;
  right: auto !important;
  bottom: auto !important;
}

.drone-actor.drone-returning {
  cursor: grab !important;
  filter: drop-shadow(0 18px 24px rgba(56, 189, 248, 0.55)) brightness(1.1) !important;
  animation: none !important;
  z-index: 999998 !important;
  right: auto !important;
  bottom: auto !important;
}

.drone-actor img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.drone-actor-right {
  transform: scaleX(-1);
}

/* Foco de Luz hacia la roca */
.drone-spotlight {
  position: absolute;
  top: 60%;
  left: 50%;
  width: 160px;
  height: 160px;
  margin-left: -80px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.32) 0%, rgba(56, 189, 248, 0.08) 50%, transparent 75%);
  clip-path: polygon(45% 0%, 55% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
  transform-origin: top center;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.drone-actor.flying .drone-spotlight {
  opacity: 1;
}

.drone-led-rec {
  position: absolute;
  top: 48%;
  right: 22%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  display: none;
  pointer-events: none;
}
.drone-led-nav {
  position: absolute;
  top: 48%;
  left: 22%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 7px #22c55e;
  display: none;
  pointer-events: none;
}

.drone-actor.flying .drone-led-rec {
  display: block;
  animation: ledPulse 0.8s infinite alternate;
}
.drone-actor.flying .drone-led-nav {
  display: block;
  animation: ledPulse 1.2s infinite alternate;
}

/* Estados de los Drones */
.drone-landed-left:not(.drone-dragging):not(.drone-returning) {
  left: calc(70px - (var(--tamano-dron, 58px) / 2)) !important;
  bottom: 46px !important;
  top: auto !important;
  right: auto !important;
  transform: scale(0.92);
  animation: none !important;
}
.drone-landed-right:not(.drone-dragging):not(.drone-returning) {
  right: calc(70px - (var(--tamano-dron, 58px) / 2)) !important;
  bottom: 46px !important;
  top: auto !important;
  left: auto !important;
  transform: scaleX(-1) scale(0.92);
  animation: none !important;
}

/* ========================================================
   ANIMACIONES CINEMATOGRÁFICAS DIFERENCIADAS (HOVERING SUTIL)
   Dron Izquierdo: Escalador chico (altura ~68vh)
   Dron Derecho: Escaladora chica (altura alta ~80vh)
   ======================================================== */

/* Despegue Izquierdo (hacia escalador a altura 68vh) */
.drone-takeoff-left:not(.drone-dragging):not(.drone-returning) {
  animation: droneTakeoffLeft 6.5s cubic-bezier(0.25, 1, 0.35, 1) forwards !important;
}
@keyframes droneTakeoffLeft {
  0% {
    left: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 46px;
    transform: scale(0.92) rotate(0deg);
  }
  25% {
    left: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 180px;
    transform: scale(0.98) rotate(-2deg);
  }
  60% {
    left: 56px;
    bottom: 48vh;
    transform: scale(1.03) rotate(3deg);
  }
  100% {
    left: 55px;
    bottom: 68vh;
    transform: scale(1) rotate(0deg);
  }
}

/* Despegue Derecho (hacia escaladora en altura alta 80vh) */
.drone-takeoff-right:not(.drone-dragging):not(.drone-returning) {
  animation: droneTakeoffRight 6.5s cubic-bezier(0.25, 1, 0.35, 1) forwards !important;
}
@keyframes droneTakeoffRight {
  0% {
    right: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 46px;
    transform: scaleX(-1) scale(0.92) rotate(0deg);
  }
  25% {
    right: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 200px;
    transform: scaleX(-1) scale(0.98) rotate(-2deg);
  }
  60% {
    right: 48px;
    bottom: 58vh;
    transform: scaleX(-1) scale(1.04) rotate(4deg);
  }
  100% {
    right: 36px;
    bottom: 80vh;
    transform: scaleX(-1) scale(1) rotate(0deg);
  }
}

/* Aterrizaje Izquierdo (desde altura 68vh hasta helipad) */
.drone-landing-left:not(.drone-dragging):not(.drone-returning) {
  animation: droneLandingLeft 6.5s cubic-bezier(0.35, 0, 0.25, 1) forwards !important;
}
@keyframes droneLandingLeft {
  0% {
    left: 55px;
    bottom: 68vh;
    transform: scale(1) rotate(0deg);
  }
  45% {
    left: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 380px;
    transform: scale(1.02) rotate(-2deg);
  }
  75% {
    left: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 140px;
    transform: scale(0.96) rotate(0deg);
  }
  100% {
    left: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 46px;
    transform: scale(0.92) rotate(0deg);
  }
}

/* Aterrizaje Derecho (desde altura alta 80vh hasta helipad) */
.drone-landing-right:not(.drone-dragging):not(.drone-returning) {
  animation: droneLandingRight 6.5s cubic-bezier(0.35, 0, 0.25, 1) forwards !important;
}
@keyframes droneLandingRight {
  0% {
    right: 36px;
    bottom: 80vh;
    transform: scaleX(-1) scale(1) rotate(0deg);
  }
  50% {
    right: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 420px;
    transform: scaleX(-1) scale(1.02) rotate(-2deg);
  }
  80% {
    right: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 150px;
    transform: scaleX(-1) scale(0.96) rotate(0deg);
  }
  100% {
    right: calc(70px - (var(--tamano-dron, 58px) / 2));
    bottom: 46px;
    transform: scaleX(-1) scale(0.92) rotate(0deg);
  }
}

/* Vuelo Cinematográfico Izquierdo: Grabando al escalador (Hovering sutil a ~68vh) */
.drone-flight-left:not(.drone-dragging):not(.drone-returning) {
  left: 55px !important;
  bottom: 68vh !important;
  top: auto !important;
  right: auto !important;
  animation: droneHoverLeft 10s ease-in-out infinite alternate !important;
}
@keyframes droneHoverLeft {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(-7px, -14px, 0) rotate(-1.5deg);
  }
  50% {
    transform: translate3d(7px, 10px, 0) rotate(2deg);
  }
  75% {
    transform: translate3d(-5px, -8px, 0) rotate(-1deg);
  }
  100% {
    transform: translate3d(3px, 12px, 0) rotate(1deg);
  }
}

/* Vuelo Cinematográfico Derecho: Grabando a la escaladora (Hovering sutil en zona alta ~80vh) */
.drone-flight-right:not(.drone-dragging):not(.drone-returning) {
  right: 36px !important;
  bottom: 80vh !important;
  top: auto !important;
  left: auto !important;
  animation: droneHoverRight 14s ease-in-out infinite alternate !important;
}
@keyframes droneHoverRight {
  0% {
    transform: scaleX(-1) translate3d(0, 0, 0) rotate(0deg);
  }
  30% {
    transform: scaleX(-1) translate3d(-6px, 12px, 0) rotate(-1deg);
  }
  60% {
    transform: scaleX(-1) translate3d(6px, -10px, 0) rotate(3deg);
  }
  85% {
    transform: scaleX(-1) translate3d(-4px, 8px, 0) rotate(0deg);
  }
  100% {
    transform: scaleX(-1) translate3d(4px, -6px, 0) rotate(2deg);
  }
}

/* BASES DE DESPEGUE (HELIPADS) */
.drone-helipad-zone {
  display: flex !important;
  position: fixed;
  bottom: 12px;
  z-index: 90;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: opacity 0.3s ease;
}
.drone-helipad-left {
  left: 25px;
}
.drone-helipad-right {
  right: 25px;
}

.drone-helipad-pad {
  width: 90px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #1e293b 0%, #0f172a 75%, #0284c7 100%);
  border: 2px dashed #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4), inset 0 0 10px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform: perspective(180px) rotateX(45deg);
  transition: all 0.3s ease;
}
.drone-helipad-pad::after {
  content: "H";
  font-weight: 900;
  font-size: 1.1rem;
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}
.drone-helipad-active .drone-helipad-pad {
  border-color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.6), inset 0 0 10px rgba(0,0,0,0.8);
}
.drone-helipad-active .drone-helipad-pad::after {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.btn-helipad-action {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 1px solid #38bdf8;
  padding: 4px 11px;
  border-radius: 14px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 106;
}
.btn-helipad-action:hover {
  transform: scale(1.05);
  opacity: 1 !important;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.6);
}
.btn-helipad-action.flying {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: #f87171;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
  animation: pulseLandBtn 1.8s infinite alternate;
}

@media (max-width: 899px) {
  .drone-actor,
  .drone-helipad-zone {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* ========================================================
   PANEL FLOTANTE DE AJUSTES DE FONDOS LATERALES (PC)
   ======================================================== */
.side-bg-settings-btn {
  position: relative;
}

@media (max-width: 1199px) {
  .side-bg-settings-btn {
    display: none !important; /* Solo se activa en PC donde se ven los fondos */
  }
}

.side-bg-settings-btn.is-off {
  opacity: 0.65;
  filter: grayscale(0.6);
}

.side-bg-settings-btn.active {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
}

.side-bg-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 270px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 1.15rem;
  z-index: 1050;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.15);
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .side-bg-panel {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 0 20px rgba(2, 132, 199, 0.1);
}

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

.side-bg-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-card);
}

.side-bg-panel-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-close-panel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.2s;
}

.btn-close-panel:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.side-bg-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.toggle-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Switch Estilo Roca */
.rock-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin: 0;
}

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

.rock-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
  border: 1px solid var(--border-card);
}

[data-theme="light"] .rock-slider {
  background-color: #cbd5e1;
}

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

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

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

/* Slider de Transparencia */
.side-bg-slider-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.slider-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.slider-info strong {
  color: var(--accent-primary);
  font-weight: 700;
}

.rock-range-input {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
  accent-color: #38bdf8;
  margin: 4px 0 8px;
}

[data-theme="light"] .rock-range-input {
  background: #e2e8f0;
}

/* Presets rápidos */
.side-bg-preset-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.3rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

[data-theme="light"] .btn-preset {
  background: #f1f5f9;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  border-color: var(--accent-primary);
}

.btn-preset.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.side-bg-off-hint {
  padding: 0.5rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================================
   MODAL PERSONALIZADO DE CONFIRMACIÓN DE ELIMINACIÓN
   ======================================================== */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.18s ease-out;
}

.confirm-modal-box {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 22px;
  max-width: 420px;
  width: 100%;
  padding: 1.85rem 1.5rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(239, 68, 68, 0.18);
  animation: modalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .confirm-modal-box {
  background: #ffffff;
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15), 0 0 25px rgba(239, 68, 68, 0.12);
}

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

.confirm-modal-avatar-wrapper {
  position: relative;
  display: inline-block;
  margin: 0 auto 0.85rem;
}

.confirm-modal-avatar-box {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 30%, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 2px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

[data-theme="light"] .confirm-modal-avatar-box {
  background: #f8fafc;
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15), 0 0 15px rgba(239, 68, 68, 0.15);
}

.confirm-avatar-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

.confirm-avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.confirm-avatar-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.confirm-modal-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  border: 2px solid #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .confirm-modal-avatar-badge {
  border-color: #ffffff;
}

.confirm-modal-header-text {
  margin-bottom: 0.5rem;
}

.confirm-modal-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f87171;
  margin-bottom: 0.2rem;
}

.confirm-modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.confirm-user-highlight {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.3);
}

.confirm-modal-badge {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.35rem 0.95rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.confirm-badge-icon {
  font-size: 1rem;
}

.confirm-modal-message {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
  line-height: 1.45;
}

.confirm-modal-submessage {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 1.15rem;
  background: rgba(30, 41, 59, 0.5);
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
}

[data-theme="light"] .confirm-modal-submessage {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.08);
}

.confirm-submessage-icon {
  font-size: 1.05rem;
  line-height: 1.1;
  flex-shrink: 0;
}

.confirm-submessage-text {
  flex-grow: 1;
}

.confirm-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-modal-cancel {
  border-radius: 12px !important;
  padding: 0.65rem 1rem !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
}

.btn-modal-confirm {
  border-radius: 12px !important;
  padding: 0.65rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important;
  transition: all 0.2s ease !important;
}

.btn-modal-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45) !important;
}

/* Modal más compacto y proporcionado para móvil */
@media (max-width: 576px) {
  .confirm-modal-overlay {
    padding: 10px;
  }

  .confirm-modal-box {
    max-width: 320px;
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }

  .confirm-modal-avatar-wrapper {
    margin: 0 auto 0.65rem;
  }

  .confirm-modal-avatar-box {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    padding: 4px;
  }

  .confirm-avatar-emoji {
    font-size: 1.75rem;
  }

  .confirm-modal-avatar-badge {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
    bottom: -3px;
    right: -3px;
  }

  .confirm-modal-kicker {
    font-size: 0.62rem;
  }

  .confirm-modal-title {
    font-size: 1.1rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
  }

  .confirm-modal-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
  }

  .confirm-modal-message {
    font-size: 0.82rem;
    line-height: 1.35;
    margin-bottom: 0.45rem;
  }

  .confirm-modal-submessage {
    font-size: 0.75rem;
    line-height: 1.3;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
  }

  .confirm-modal-actions {
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  .btn-modal-cancel {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
    min-height: 36px !important;
  }

  .btn-modal-confirm {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
    min-height: 36px !important;
    gap: 4px !important;
  }
}

/* ======================================================== */
/* SECCIÓN PROYECTOS DE ESCALADA                            */
/* ======================================================== */

.proyectos-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Estadísticas superiores */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(249, 115, 22, 0.4);
}

.stat-icon {
  font-size: 1.85rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.stat-icon-fire {
  background: rgba(249, 115, 22, 0.15);
}

.stat-icon-trophy {
  background: rgba(234, 179, 8, 0.15);
}

.stat-icon-bolt {
  background: rgba(168, 85, 247, 0.15);
}

.stat-icon-climb {
  background: rgba(59, 130, 246, 0.15);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Barra de herramientas / filtros */
.proyectos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.filter-pills {
  display: inline-flex;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-card);
}

.filter-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill.active {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-grow: 1;
  justify-content: flex-end;
}

.sort-select-wrapper {
  min-width: 210px;
}

.sort-select {
  border-radius: 10px;
  border-color: var(--border-card);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.82rem;
  padding: 0.38rem 0.65rem;
  font-weight: 500;
}

.sort-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
  background: var(--bg-card);
  color: var(--text-main);
}

.search-box-wrapper {
  flex-grow: 1;
  max-width: 260px;
}

.search-input {
  border-radius: 10px;
  border-color: var(--border-card);
  background: var(--bg-card);
  color: var(--text-main);
}

/* Grid de Tarjetas de Proyectos: 3 columnas en PC */
.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1040px) {
  .proyectos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .proyectos-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.proyecto-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.proyecto-card:hover {
  transform: translateY(-3px);
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.proyecto-card-encadenada {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(34, 197, 94, 0.05) 100%);
}

/* 1. Cabecera Equilibrada */
.proyecto-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding-bottom: 0.15rem;
  min-width: 0;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.badge-grado {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.3rem 0.55rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  flex-shrink: 0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.badge-grado-iniciacion {
  background: linear-gradient(135deg, #10b981, #059669);
}

.badge-grado-medio {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.badge-grado-avanzado {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.badge-grado-elite {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.header-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.via-nombre {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.via-ubicacion {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.link-ubicacion {
  color: var(--text-muted);
  text-decoration: none;
}

.link-ubicacion:hover {
  color: var(--primary);
}

.badge-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-proyecto {
  color: #fb923c;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.status-encadenada {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* 2. Barra Técnica Unificada */
.specs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  color: var(--text-muted);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.specs-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.specs-sep {
  color: rgba(255, 255, 255, 0.18);
}

.specs-pegues {
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 3. Caja de Último Pegue Nivelada */
.last-attempt-box {
  background: rgba(125, 125, 125, 0.04);
  border: 1px dashed var(--border-card);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.attempt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  min-width: 0;
}

.attempt-result {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.res-empty {
  color: var(--text-muted);
  font-style: italic;
}

.attempt-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.attempt-notes {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

/* 4. Notas Beta Generales */
.beta-badge {
  font-size: 0.74rem;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.06);
  border-left: 3px solid var(--primary);
  padding: 0.3rem 0.55rem;
  border-radius: 0 6px 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 5. Botonera Ergonómica Inferior */
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.btn-pegue {
  flex: 1;
  min-width: 0;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.45rem 0.6rem !important;
  font-size: 0.82rem !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}

.btn-pegue:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-pegue-encadenada {
  background: #16a34a !important;
  box-shadow: none !important;
}

.btn-pegue-encadenada:hover {
  background: #15803d !important;
}

.action-icons-group {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0 !important;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
}

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

/* Colores de resultados */
.res-color-encadene {
  color: #4ade80 !important;
}

.res-color-caida {
  color: #f87171 !important;
}

.res-color-top {
  color: #60a5fa !important;
}

.res-color-abandono {
  color: #fbbf24 !important;
}

/* Empty state */
.empty-state-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-card);
  border-radius: 20px;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  font-size: 3rem;
  display: block;
}

/* Modales personalizados */
.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-dialog-pegue {
  max-width: 450px;
}

.modal-dialog-historial {
  max-width: 520px;
}

.modal-dialog-editar {
  max-width: 420px;
}

.modal-header-custom {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-close-custom {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.btn-close-custom:hover {
  color: var(--text-main);
}

.modal-body-custom {
  padding: 1.25rem;
}

.modal-body-scroll {
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer-custom {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Selector de Resultado con Chips */
.resultado-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.btn-resultado {
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-resultado:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-resultado.active {
  border-width: 2px;
  font-weight: 700;
}

.btn-resultado.active.btn-res-caida {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  color: #f87171;
}

.btn-resultado.active.btn-res-encadene {
  background: rgba(34, 197, 94, 0.18);
  border-color: #22c55e;
  color: #4ade80;
}

.btn-resultado.active.btn-res-top {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
  color: #60a5fa;
}

.btn-resultado.active.btn-res-abandono {
  background: rgba(234, 179, 8, 0.18);
  border-color: #eab308;
  color: #facc15;
}

.res-icon {
  font-size: 1.35rem;
}

.res-text {
  font-size: 0.85rem;
}

/* Timeline del Historial */
.timeline-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.timeline-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.timeline-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  flex-grow: 1;
}

.timeline-notes {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Responsive Móvil para Proyectos */
@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .stat-icon {
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
  }

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

  .proyectos-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-pills {
    display: flex;
    justify-content: space-between;
  }

  .filter-pill {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0.4rem;
    font-size: 0.78rem;
  }

  .toolbar-controls {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .sort-select-wrapper {
    width: 100%;
  }

  .sort-select {
    width: 100%;
  }

  .search-box-wrapper {
    max-width: 100%;
    width: 100%;
  }

  .proyectos-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  /* ======================================================== */
  /* MODALES EN MÓVIL: TÍTULOS, TEXTO Y BOTONES COMPACTOS     */
  /* ======================================================== */
  .modal-backdrop-custom {
    padding: 0.5rem !important;
  }

  .modal-dialog-custom {
    width: 96% !important;
    max-width: 440px !important;
    max-height: 90vh !important;
    border-radius: 14px !important;
  }

  .modal-dialog-boulder,
  .modal-dialog-pegue,
  .modal-dialog-historial,
  .modal-dialog-editar {
    width: 96% !important;
    max-width: 440px !important;
  }

  /* Encabezados y títulos compactos */
  .modal-header-custom {
    padding: 0.65rem 0.85rem !important;
  }

  .modal-header-custom h4,
  .modal-header-custom h3,
  .modal-header-custom .modal-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }

  .modal-header-custom .small,
  .modal-header-custom .text-muted {
    font-size: 0.72rem !important;
    display: block !important;
    margin-top: 1px !important;
  }

  .btn-close-custom {
    font-size: 0.95rem !important;
    padding: 2px 6px !important;
  }

  /* Cuerpo y campos de texto del modal */
  .modal-body-custom {
    padding: 0.75rem 0.85rem !important;
  }

  .modal-body-scroll {
    max-height: 62vh !important;
  }

  .modal-dialog-custom .form-label,
  .modal-body-custom .form-label {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.2rem !important;
  }

  .modal-dialog-custom .form-control,
  .modal-dialog-custom .form-select,
  .modal-body-custom .form-control,
  .modal-body-custom .form-select {
    font-size: 0.82rem !important;
    padding: 0.35rem 0.55rem !important;
    border-radius: 8px !important;
    min-height: 35px !important;
  }

  .modal-dialog-custom textarea.form-control,
  .modal-body-custom textarea.form-control {
    font-size: 0.8rem !important;
    padding: 0.38rem 0.55rem !important;
    min-height: 52px !important;
  }

  .modal-dialog-custom .alert,
  .modal-body-custom .alert {
    font-size: 0.74rem !important;
    padding: 0.35rem 0.55rem !important;
    margin-bottom: 0.6rem !important;
  }

  .modal-body-custom .form-control-color {
    width: 36px !important;
    height: 35px !important;
    min-height: 35px !important;
    padding: 2px !important;
  }

  /* ======================================================== */
  /* BOTONES DEL MODAL EN MÓVIL (SOBRE TODO LOS BOTONES)      */
  /* ======================================================== */
  .modal-footer-custom {
    padding: 0.55rem 0.85rem !important;
    gap: 0.45rem !important;
  }

  .modal-footer-custom .btn,
  .modal-dialog-custom .modal-footer-custom .btn,
  .modal-footer-custom .btn-compact,
  .modal-dialog-custom .btn-compact {
    font-size: 0.78rem !important;
    padding: 0.36rem 0.72rem !important;
    min-height: 33px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    gap: 4px !important;
  }

  /* Botoneras agrupadas (Indoor/Outdoor, Encadenado/Proyecto) */
  .modal-dialog-custom .btn-group .btn {
    font-size: 0.74rem !important;
    padding: 0.32rem 0.45rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    min-height: 32px !important;
  }

  /* Chips selector de resultado (Caída, Encadene, Top) */
  .resultado-selector-grid {
    gap: 0.35rem !important;
    margin-bottom: 0.75rem !important;
  }

  .btn-resultado {
    padding: 0.4rem 0.3rem !important;
    border-radius: 9px !important;
    gap: 2px !important;
  }

  .btn-resultado .res-icon {
    font-size: 1.1rem !important;
  }

  .btn-resultado .res-text {
    font-size: 0.74rem !important;
    font-weight: 600 !important;
  }

  /* Historial de pegues dentro del modal */
  .timeline-badge {
    width: 25px !important;
    height: 25px !important;
    font-size: 0.68rem !important;
  }

  .timeline-card {
    padding: 0.45rem 0.6rem !important;
    font-size: 0.78rem !important;
  }

  .timeline-notes {
    font-size: 0.73rem !important;
    line-height: 1.3 !important;
  }
}

/* ======================================================== */
/* PIRÁMIDE DE ENCADENES & ESTADÍSTICAS                    */
/* ======================================================== */
.pyramid-wrapper {
  animation: fadeIn 0.3s ease-out;
}

.pyramid-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.pyramid-title-box h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pyramid-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot-avista { background: #16a34a; }
.legend-dot-flash { background: #d97706; }
.legend-dot-trabajada { background: #64748b; }

.pyramid-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pyramid-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.pyramid-kpi-val {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.pyramid-kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Contenedor de la Pirámide */
.pyramid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  margin-bottom: 1.5rem;
}

.pyramid-levels-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pyramid-level-block {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
  overflow: hidden;
}

.pyramid-level-block:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.pyramid-row-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  user-select: none;
}

.pyramid-row-grado {
  width: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.pyramid-row-track {
  flex: 1;
  height: 28px;
  background: rgba(125, 125, 125, 0.08);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
}

.pyramid-bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  transition: width 0.4s ease;
  overflow: hidden;
  white-space: nowrap;
}

.seg-avista { background: #16a34a; }
.seg-flash { background: #d97706; }
.seg-trabajada { background: #64748b; }

.pyramid-row-count {
  width: 65px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.pyramid-expand-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.pyramid-expand-icon.expanded {
  transform: rotate(180deg);
}

/* Detalle desplegable de vías del grado */
.pyramid-vias-dropdown {
  padding: 0.75rem 1rem 1rem 4.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.65rem;
}

.pyramid-via-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.pyramid-via-name {
  font-weight: 600;
  color: var(--text-main);
}

.pyramid-via-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pyramid-style-pill {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
}

.pill-avista { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.pill-flash { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-trabajada { background: rgba(139, 92, 246, 0.15); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.3); }

/* Responsive Pirámide */
@media (max-width: 768px) {
  .pyramid-kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .pyramid-vias-dropdown {
    padding-left: 1rem;
    grid-template-columns: 1fr;
  }

  .pyramid-row-grado {
    width: 48px;
  }

  .pyramid-row-count {
    width: 50px;
    font-size: 0.78rem;
  }
}

/* ======================================================== */
/* METEO EN LA ROCA & ADHERENCIA (OPEN-METEO)              */
/* ======================================================== */
/* METEO EN LA ROCA & ADHERENCIA (OPEN-METEO)              */
/* ======================================================== */
.meteo-rock-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius-md, 16px);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--card-shadow, 0 4px 16px rgba(0, 0, 0, 0.1));
  transition: all 0.25s ease;
}

.meteo-rock-widget.widget-collapsed {
  padding: 0.75rem 1.25rem;
}

.meteo-loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0;
  color: var(--text-muted);
}

.meteo-no-gps-state {
  background: rgba(125, 125, 125, 0.04);
  border: 1px dashed var(--border-card);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.no-gps-icon {
  font-size: 1.5rem;
}

.meteo-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.meteo-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  letter-spacing: 0.1px;
}

/* Semáforo de tacto limpio y mate (sin resplandores neón) */
.tacto-optimo {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #16a34a;
}

.tacto-bueno {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #22c55e;
}

.tacto-aceptable {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706;
}

.tacto-resbaladizo {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.tacto-mojado {
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

.tacto-frio {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #2563eb;
}

.meteo-sun-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(125, 125, 125, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
}

.meteo-gps-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-toggle-meteo {
  background: rgba(125, 125, 125, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-meteo:hover {
  background: rgba(125, 125, 125, 0.12);
  color: var(--text-main);
}

.meteo-tacto-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0.65rem 0 0.85rem;
  line-height: 1.4;
}

.meteo-main-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.85rem;
}

.meteo-temp-big-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(125, 125, 125, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

.meteo-big-icon {
  font-size: 2rem;
  line-height: 1;
}

.meteo-big-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.meteo-big-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.meteo-subcard {
  background: rgba(125, 125, 125, 0.04);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.55rem 0.45rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.subcard-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.subcard-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Pronóstico por horas */
.hourly-strip-wrapper {
  background: rgba(125, 125, 125, 0.04);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-card);
}

.hourly-strip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.45rem;
}

.hourly-strip {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  overflow-x: auto;
}

.hour-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.75rem;
  gap: 2px;
  min-width: 52px;
}

.hour-lbl {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.hour-ico {
  font-size: 1.1rem;
}

.hour-deg {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.8rem;
}

.hour-tacto {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.hour-rain {
  font-size: 0.65rem;
  color: var(--accent-primary, #0284c7);
  font-weight: 600;
}

/* Responsive Meteo */
@media (max-width: 768px) {
  .meteo-main-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .meteo-temp-big-card {
    grid-column: span 2;
  }

  .hourly-strip {
    justify-content: flex-start;
  }
}

/* Marcadores personalizados Leaflet transparentes sin borde residual */
.leaflet-div-icon,
.global-zone-marker,
.map-custom-marker {
  background: transparent !important;
  border: none !important;
}

/* =================================================== */
/* MODO ROCA OFFLINE & WIDGET DE SINCRONIZACIÓN        */
/* =================================================== */
.sync-widget-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.sync-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  color: var(--text-main, #f8fafc);
  transition: all 0.2s ease;
}

.sync-status-btn:hover {
  transform: translateY(-1px);
}

.sync-status-btn.is-online {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: #4ade80;
}

.sync-status-btn.is-online .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  display: inline-block;
}

.sync-status-btn.is-offline {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.sync-status-btn.is-offline .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  display: inline-block;
  animation: pulseSyncDot 1.8s infinite;
}

@keyframes pulseSyncDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.sync-badge-counter {
  background: #ea580c;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

/* Panel Desplegable Flotante */
.sync-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(410px, calc(100vw - 20px));
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  z-index: 1060;
  padding: 1.15rem;
  animation: fadeInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sync-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
}

.sync-header-icon {
  font-size: 1.5rem;
}

.sync-panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main, #f8fafc);
  font-family: var(--font-heading, sans-serif);
}

.sync-panel-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

.btn-close-sync {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.btn-close-sync:hover {
  color: #fff;
}

/* Fila Switch Simulador */
.sync-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
  gap: 0.75rem;
}

.sync-switch-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-main, #fff);
  margin-bottom: 2px;
}

.sync-switch-info p {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  margin: 0;
  line-height: 1.3;
}

/* Switch Estilo iOS / Moderno */
.rock-toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

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

.rock-toggle-slider {
  position: absolute;
  inset: 0;
  background: #334155;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.25s;
}

.rock-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.25s;
}

.rock-toggle-switch input:checked + .rock-toggle-slider {
  background: #ea580c;
}

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

/* Estado de la red */
.sync-status-pill {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  margin-bottom: 0.85rem;
}

.sync-status-pill.status-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.sync-status-pill.status-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.sync-message-alert {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
}

/* Sección de la cola de registros */
.sync-queue-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 0.85rem;
}

.queue-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
}

.queue-empty-box {
  padding: 0.9rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.queue-list-container {
  max-height: 170px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 2px;
}

.queue-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
}

.queue-item-card.is-pending {
  border-left: 3px solid #f59e0b;
}

.queue-item-card.is-synced {
  border-left: 3px solid #22c55e;
  opacity: 0.85;
}

.queue-item-type {
  font-size: 0.68rem;
  color: #fb923c;
  font-weight: 700;
  display: block;
  margin-bottom: 1px;
}

.queue-item-title {
  color: var(--text-main, #fff);
  font-size: 0.82rem;
  display: block;
}

.queue-item-desc {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  margin: 2px 0 0 0;
  line-height: 1.25;
}

.queue-badge-waiting {
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.7rem;
}

.queue-badge-synced {
  color: #4ade80;
  font-weight: 700;
  font-size: 0.7rem;
}

.queue-item-time {
  font-size: 0.65rem;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}

/* Botones de acción */
.sync-actions-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.btn-sync-action {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-sync-action.btn-simulate {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main, #f8fafc);
}

.btn-sync-action.btn-simulate:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-sync-action.btn-sync-now {
  background: var(--accent-primary, #ea580c);
  color: white;
}

.btn-sync-action.btn-sync-now:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-clear-queue {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.72rem;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
}

.btn-clear-queue:hover {
  color: #ef4444;
}

.sync-explanation-hint {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.35;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.65rem;
}

.sync-explanation-hint strong {
  color: var(--text-main, #fff);
}

/* Compatibilidad con el Modo Organizador Pro */
[data-theme="organizer"] .sync-status-btn {
  background: #2b3035 !important;
  border-color: #495057 !important;
  color: #e9ecef !important;
}

[data-theme="organizer"] .sync-dropdown-panel {
  background: #212529 !important;
  border-color: #495057 !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8) !important;
}

[data-theme="organizer"] .sync-switch-row,
[data-theme="organizer"] .sync-queue-section,
[data-theme="organizer"] .queue-item-card {
  background: #2b3035 !important;
  border-color: #3e444a !important;
}

[data-theme="organizer"] .btn-sync-action.btn-sync-now {
  background: #4a90e2 !important;
}

[data-theme="organizer"] .rock-toggle-switch input:checked + .rock-toggle-slider {
  background: #4a90e2 !important;
}

/* =================================================== */
/* CUADERNO DE ESCALADA: FOLIO A4 & EXPORTAR PDF       */
/* =================================================== */
.modal-dialog-pdf {
  max-width: 860px !important;
  width: 95% !important;
}

.modal-body-pdf {
  background: rgba(0, 0, 0, 0.35);
  max-height: 75vh;
  overflow-y: auto;
}

.a4-paper-sheet {
  background: #ffffff !important;
  color: #1e293b !important;
  border-radius: 6px;
  padding: 2rem 2.2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  max-width: 780px;
  margin: 0 auto;
}

.a4-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 0.85rem;
  margin-bottom: 1.15rem;
}

.a4-header-title {
  font-family: var(--font-heading, sans-serif);
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.a4-header-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 3px;
}

.a4-meta-box {
  text-align: right;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

.a4-meta-box strong {
  color: #0f172a;
}

.a4-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.a4-stat-val {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-heading, sans-serif);
  line-height: 1.2;
}

.a4-stat-val.c-orange { color: #ea580c; }
.a4-stat-val.c-green { color: #16a34a; }
.a4-stat-val.c-blue { color: #2563eb; }
.a4-stat-val.c-purple { color: #7c3aed; }

.a4-stat-lbl {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.a4-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
}

.a4-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 7px 9px;
  border-top: 1px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
}

.a4-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: middle;
}

.a4-table tr:nth-child(even) {
  background: #f8fafc;
}

.a4-badge-grado {
  background: #ffedd5;
  color: #c2410c;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  font-size: 0.78rem;
}

.a4-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94a3b8;
}

/* Modo Organizador Pro en Pantalla */
[data-theme="organizer"] .modal-dialog-pdf {
  border-color: #495057 !important;
}

[data-theme="organizer"] .modal-body-pdf {
  background: #1a1d20 !important;
}

/* =================================================== */
/* OPTIMIZACIÓN DEL MODAL PDF EN PANTALLAS MÓVILES     */
/* =================================================== */
@media (max-width: 768px) {
  .modal-dialog-pdf {
    width: 98% !important;
    max-width: 98% !important;
    margin: 0.5rem auto !important;
    border-radius: 12px !important;
  }

  .modal-header-pdf {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0.65rem 0.85rem !important;
    gap: 0.5rem !important;
  }

  .modal-header-pdf h4 {
    font-size: 1.05rem !important;
  }

  .w-100-mobile {
    width: 100% !important;
    display: flex !important;
  }

  /* Ajuste de filtros del PDF en móvil: Todos más compacto, Encadenadas y Proyectos con más espacio */
  .btn-group-pdf-filter {
    display: flex !important;
    width: 100% !important;
    gap: 2px !important;
  }

  .btn-group-pdf-filter button {
    font-size: 0.72rem !important;
    padding: 0.4rem 0.25rem !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  .btn-group-pdf-filter .btn-filter-todos {
    flex: 0 0 25% !important; /* Más estrecho para Todos() */
  }

  .btn-group-pdf-filter .btn-filter-encadenadas {
    flex: 1 1 38% !important; /* Más holgura para el texto largo */
  }

  .btn-group-pdf-filter .btn-filter-proyectos {
    flex: 1 1 37% !important; /* Más holgura */
  }

  /* Ajuste de botones en el footer del PDF */
  .btn-pdf-cerrar {
    flex: 0 0 auto !important;
    min-width: 65px !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.8rem !important;
  }

  .btn-pdf-guardar {
    flex: 1 1 auto !important;
    font-size: 0.82rem !important;
    padding: 0.4rem 0.65rem !important;
    white-space: nowrap !important;
  }

  .modal-body-pdf {
    padding: 0.4rem !important;
    max-height: 72vh !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .a4-paper-sheet {
    padding: 1rem 0.85rem !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    min-width: 540px; /* Ancho mínimo para mantener diseño proporcionado legible con scroll táctil suave */
  }

  .a4-header {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
    margin-bottom: 0.85rem !important;
    padding-bottom: 0.65rem !important;
  }

  .a4-header-title {
    font-size: 1.25rem !important;
  }

  .a4-meta-box {
    text-align: left !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem 1rem !important;
    font-size: 0.72rem !important;
    background: #f8fafc;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
  }

  .a4-stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    padding: 0.5rem !important;
    margin-bottom: 0.85rem !important;
  }

  .a4-stat-val {
    font-size: 1.1rem !important;
  }

  .a4-stat-lbl {
    font-size: 0.62rem !important;
  }

  .a4-table {
    font-size: 0.74rem !important;
  }

  .a4-table th, 
  .a4-table td {
    padding: 6px 7px !important;
  }

  .a4-footer {
    flex-direction: column !important;
    gap: 0.3rem !important;
    text-align: center !important;
    font-size: 0.65rem !important;
  }

  .modal-footer-pdf {
    padding: 0.65rem 0.85rem !important;
  }

  .flex-grow-mobile {
    flex-grow: 1 !important;
  }

  /* =================================================== */
  /* CROQUIS Y TOPOS EN MÓVIL                            */
  /* =================================================== */
  .topo-header-card .card-header-clean {
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }

  .topos-selector-track {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .topos-buttons-scroll {
    display: inline-flex !important;
    gap: 0.35rem !important;
  }

  .topo-viewer-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .topo-title-block {
    width: 100% !important;
  }

  .topo-title-block h3 {
    font-size: 1.05rem !important;
    display: flex !important;
    align-items: center !important;
    margin-bottom: 0 !important;
  }

  .topo-actions-toolbar {
    width: 100% !important;
    justify-content: flex-end !important;
  }

  .topo-actions-toolbar .btn-compact {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.78rem !important;
  }

  .topo-viewport-container {
    min-height: 280px !important;
    max-height: 60vh !important;
    padding: 4px !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-x pan-y !important;
  }

  /* Formulario de subida de foto en móvil */
  .topo-upload-card {
    padding: 0.75rem 0.65rem !important;
  }

  .topo-upload-card .form-label {
    font-size: 0.78rem !important;
  }

  .form-select-sm-mobile,
  .form-control-sm-mobile {
    font-size: 0.82rem !important;
    padding: 0.35rem 0.55rem !important;
    border-radius: 8px !important;
  }

  .w-100-mobile-btn {
    width: 100% !important;
    font-size: 0.85rem !important;
    padding: 0.45rem 0.75rem !important;
  }
}

/* =================================================== */
/* BUSCADOR GLOBAL RÁPIDO (LUPA)                       */
/* =================================================== */
.quick-search-wrapper {
  display: inline-flex;
  align-items: center;
}

.quick-search-btn {
  position: relative;
}

.quick-search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 1rem;
  animation: fadeInModal 0.2s ease-out;
}

.quick-search-modal {
  width: min(540px, 100%);
  background: var(--app-card-bg, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  margin-top: 5vh;
}

[data-theme="organizer"] .quick-search-modal {
  background: #212529 !important;
  border-color: #495057 !important;
}

.quick-search-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-search-input-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
}

.search-lens-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.quick-search-input {
  background: transparent;
  border: none;
  outline: none !important;
  color: var(--text-main, #f8fafc);
  font-size: 0.95rem;
  width: 100%;
}

.btn-clear-search,
.btn-close-search {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
}

.btn-clear-search:hover,
.btn-close-search:hover {
  color: #fff;
}

.quick-search-body {
  max-height: 55vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.quick-search-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted, #94a3b8);
}

.quick-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
}

.quick-search-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.item-icon-box {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.item-content {
  flex: 1;
  min-width: 0;
}

.item-title {
  color: var(--text-main, #fff);
  font-size: 0.92rem;
}

.item-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

.badge-grado-mini {
  background: #ffedd5;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.item-arrow {
  color: var(--text-muted, #64748b);
  font-size: 0.9rem;
  transition: transform 0.15s ease;
}

.quick-search-item:hover .item-arrow {
  color: var(--accent-primary, #ea580c);
  transform: translateX(3px);
}

.quick-search-hints {
  padding: 1.25rem 0.75rem;
  text-align: center;
}

.hint-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.5rem;
}

.hint-tags {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hint-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main, #e2e8f0);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}

.hint-tag:hover {
  background: var(--accent-primary, #ea580c);
  color: #fff;
  border-color: var(--accent-primary, #ea580c);
}

/* Reglas de Impresión Nativa (Ctrl+P / Guardar PDF) */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .app-header,
  .app-footer,
  nav,
  .nav-hub,
  .pc-side-bg,
  .proyectos-toolbar,
  .stats-grid,
  .proyectos-container > div:first-child,
  .modal-header-custom,
  .modal-footer-custom,
  .btn,
  button,
  .sync-widget-wrapper,
  .theme-buttons-group {
    display: none !important;
  }

  .modal-backdrop-pdf {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
  }

  .modal-dialog-pdf,
  .modal-body-pdf {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: visible !important;
    max-height: none !important;
  }

  .a4-paper-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  .a4-table tr {
    page-break-inside: avoid;
  }
}

/* =================================================== */
/* MINIJUEGO SECRETO: CLIC EN TÍTULO ESCALADA EN ROCA  */
/* =================================================== */
.header-brand-game-trigger {
  cursor: pointer !important;
  user-select: none;
  position: relative;
  transition: transform 0.2s ease;
}

.header-brand-game-trigger:hover {
  transform: translateY(-2px) scale(1.02);
}

.escalador-jump {
  animation: dynoJump 0.4s ease-out;
}

@keyframes dynoJump {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.25) rotate(-10deg); }
  100% { transform: translateY(0) scale(1); }
}

/* Backdrop del minijuego */
.climb-game-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.climb-game-modal {
  background: var(--bg-card, #0f172a);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(249, 115, 22, 0.2);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.climb-game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.game-header-icon {
  font-size: 1.6rem;
}

.climb-game-title {
  font-family: var(--font-heading, sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main, #f8fafc);
  margin: 0;
  line-height: 1.2;
}

.climb-game-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  display: block;
}

.btn-close-game {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0 4px;
}

.btn-close-game:hover {
  color: #fff;
}

/* Pared de Escalada */
.climb-wall-container {
  height: 270px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  margin-bottom: 0.85rem;
}

/* Presas de Escalada */
.climb-hold {
  position: absolute;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.climb-hold:hover {
  transform: scale(1.15);
}

.hold-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.2s;
}

.hold-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  white-space: nowrap;
}

.climb-hold.active-target .hold-bubble {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.25);
  animation: pulseHold 1s infinite alternate;
}

@keyframes pulseHold {
  from { transform: scale(1); box-shadow: 0 0 8px rgba(249, 115, 22, 0.5); }
  to { transform: scale(1.18); box-shadow: 0 0 18px rgba(249, 115, 22, 0.9); }
}

.climb-hold.reached .hold-bubble {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.3);
}

.climb-hold.reached .hold-name {
  color: #4ade80;
}

/* Ubicación de presas en la pared */
.hold-chain {
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
}

.hold-crux {
  top: 105px;
  left: 68%;
  transform: translateX(-50%);
}

.hold-start {
  bottom: 30px;
  left: 28%;
  transform: translateX(-50%);
}

/* Avatar del Escalador */
.climb-climber-avatar {
  position: absolute;
  width: 44px;
  height: 44px;
  transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  pointer-events: none;
}

.climber-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}

.climber-dust {
  position: absolute;
  bottom: -6px;
  right: -6px;
  font-size: 16px;
  animation: floatDust 0.6s ease-out;
}

@keyframes floatDust {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* Posiciones por paso */
.climb-climber-avatar.step-0 {
  bottom: 8px;
  left: 45%;
}

.climb-climber-avatar.step-1 {
  bottom: 25px;
  left: 28%;
  transform: scale(1.1);
}

.climb-climber-avatar.step-2 {
  top: 100px;
  left: 68%;
  transform: scale(1.15);
}

.climb-climber-avatar.step-3 {
  top: 12px;
  left: 50%;
  transform: scale(1.25) rotate(-6deg);
}

/* Pie del minijuego */
.climb-game-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
}

.climb-game-status-msg {
  font-size: 0.82rem;
  color: var(--text-main, #f8fafc);
  font-weight: 600;
  min-height: 24px;
  text-align: center;
}

.btn-skip-portal {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-skip-portal:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-primary, #f97316);
  border-color: var(--accent-primary, #f97316);
}

.badge-victory {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  animation: bounceBadge 0.6s infinite alternate;
}

@keyframes bounceBadge {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Compatibilidad con Piel Pro */
[data-theme="organizer"] .climb-game-modal {
  background: #212529 !important;
  border-color: #495057 !important;
}

[data-theme="organizer"] .climb-wall-container {
  background: linear-gradient(180deg, #2b3035 0%, #1e2124 100%) !important;
  border-color: #3e444a !important;
}

[data-theme="organizer"] .climb-hold.active-target .hold-bubble {
  border-color: #4a90e2 !important;
  background: rgba(74, 144, 226, 0.25) !important;
}

/* =================================================== */
/* SECCIÃ“N BOULDER & ROCÃ“DROMO                         */
/* =================================================== */
.boulder-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.boulder-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.boulder-card.border-encadenada {
  border-left: 4px solid #22c55e !important;
}

.boulder-card.border-proyecto {
  border-left: 4px solid #ea580c !important;
}

.badge-grado-font {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 3px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  letter-spacing: 0.5px;
}

.color-presa-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.badge-status-encadenada {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-status-proyecto {
  background: rgba(234, 88, 12, 0.15);
  color: #fb923c;
  border: 1px solid rgba(234, 88, 12, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.modal-dialog-boulder {
  max-width: 540px;
  width: 95%;
}

/* =================================================== */
/* AJUSTES MÓVILES PARA LA PÁGINA BOULDER Y ROCÓDROMO  */
/* =================================================== */
@media (max-width: 576px) {
  .boulder-header-card .card-header-clean {
    padding: 0.65rem 0.85rem !important;
  }

  .boulder-main-title {
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    gap: 0.35rem !important;
  }

  .boulder-subtitle {
    font-size: 0.72rem !important;
    line-height: 1.3 !important;
  }

  .btn-nuevo-bloque {
    font-size: 0.78rem !important;
    padding: 0.35rem 0.65rem !important;
    min-height: 33px !important;
    border-radius: 8px !important;
  }

  /* Tarjetas KPI compactas en móvil */
  .boulder-kpi-card {
    padding: 0.45rem 0.55rem !important;
    border-radius: 12px !important;
  }

  .boulder-kpi-icon {
    font-size: 1.15rem !important;
  }

  .boulder-kpi-value {
    font-size: 1.15rem !important;
    margin-top: 2px !important;
  }

  .boulder-kpi-label {
    font-size: 0.68rem !important;
  }

  /* Filtros y botones superiores */
  .boulder-filter-card {
    padding: 0.55rem 0.75rem !important;
  }

  .boulder-filter-btn-group .btn {
    font-size: 0.72rem !important;
    padding: 0.28rem 0.35rem !important;
    min-height: 32px !important;
    font-weight: 600 !important;
  }

  .boulder-filter-select {
    font-size: 0.74rem !important;
    padding: 0.28rem 0.45rem !important;
    min-height: 32px !important;
    border-radius: 8px !important;
  }

  /* Tarjetas de bloques en la lista */
  .boulder-card {
    padding: 0.65rem 0.75rem !important;
    border-radius: 12px !important;
  }

  .badge-grado-font {
    font-size: 0.82rem !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    letter-spacing: 0.2px !important;
  }

  .color-presa-dot {
    width: 12px !important;
    height: 12px !important;
  }

  .boulder-item-title {
    font-size: 0.9rem !important;
    max-width: 145px !important;
  }

  .boulder-item-subtitle {
    font-size: 0.7rem !important;
  }

  .badge-status-encadenada,
  .badge-status-proyecto {
    font-size: 0.65rem !important;
    padding: 2px 5px !important;
    border-radius: 5px !important;
  }

  .boulder-session-info {
    font-size: 0.72rem !important;
  }

  .boulder-action-btn {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.74rem !important;
    border-radius: 6px !important;
  }

  .boulder-item-notes {
    font-size: 0.7rem !important;
  }
}

/* =================================================== */
/* COMPONENTE FOTO-BETA (MARCADOR DE PRESAS EN BOULDER) */
/* =================================================== */
.modal-dialog-foto-beta {
  max-width: 620px;
  width: 95%;
  max-height: 94vh;
}

.foto-beta-empty-box {
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
}

.foto-beta-empty-icon {
  font-size: 2.5rem;
}

.foto-beta-viewport-wrapper {
  background: #080c14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: auto;
  text-align: center;
  max-height: 56vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
}

.foto-beta-canvas-container {
  position: relative;
  display: inline-block;
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

.foto-beta-img {
  max-width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  border-radius: 8px;
  pointer-events: none;
  display: block;
}

.presa-marker {
  position: absolute;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  animation: presaPulse 2s infinite alternate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Tamaños de Marcadores Foto-Beta */
.presa-marker,
.presa-marker.presa-size-m {
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  border-width: 3px;
}
.presa-marker .presa-marker-badge,
.presa-marker.presa-size-m .presa-marker-badge {
  width: 16px;
  height: 16px;
  font-size: 0.68rem;
}

.presa-marker.presa-size-s {
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-width: 2px;
}
.presa-marker.presa-size-s .presa-marker-badge {
  width: 11px;
  height: 11px;
  font-size: 0.52rem;
  font-weight: 700;
}

.presa-marker.presa-size-l {
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  border-width: 3.5px;
}
.presa-marker.presa-size-l .presa-marker-badge {
  width: 20px;
  height: 20px;
  font-size: 0.8rem;
}

.btn-size-opt {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  padding: 0.2rem 0.45rem !important;
  min-width: 26px;
}

@keyframes presaPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

.presa-marker:active,
.presa-marker.presa-dragging {
  cursor: grabbing !important;
  transform: scale(1.3) !important;
  z-index: 50 !important;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.8) !important;
  animation: none !important;
}

.presa-marker-badge {
  color: #fff;
  font-weight: 800;
  font-size: 0.68rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.foto-beta-toolbar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
}

.btn-presa-type {
  font-size: 0.75rem !important;
  padding: 0.28rem 0.45rem !important;
  font-weight: 600 !important;
}

.presa-color-picker {
  width: 32px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 1px !important;
  border-radius: 6px !important;
}

.btn-icon-action {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.8rem !important;
  min-height: 30px !important;
  border-radius: 6px !important;
}

/* Miniatura en tarjeta Boulder */
.boulder-thumb-box {
  position: relative;
  width: 100%;
  height: 105px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: #0b0f19;
}

.boulder-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.boulder-thumb-box:hover .boulder-thumb-img {
  transform: scale(1.04);
}

.boulder-thumb-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  display: flex;
  align-items: center;
  gap: 4px;
}

.boulder-thumb-count {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 576px) {
  .modal-dialog-foto-beta {
    width: 98% !important;
    max-height: 95vh !important;
    border-radius: 14px !important;
  }

  .foto-beta-viewport-wrapper {
    max-height: 50vh !important;
  }

  .foto-beta-img {
    max-height: 48vh !important;
  }

  .presa-marker,
  .presa-marker.presa-size-m {
    width: 22px !important;
    height: 22px !important;
    margin-left: -11px !important;
    margin-top: -11px !important;
    border-width: 2.5px !important;
  }
  .presa-marker .presa-marker-badge,
  .presa-marker.presa-size-m .presa-marker-badge {
    width: 13px !important;
    height: 13px !important;
    font-size: 0.62rem !important;
  }

  .presa-marker.presa-size-s {
    width: 15px !important;
    height: 15px !important;
    margin-left: -7.5px !important;
    margin-top: -7.5px !important;
    border-width: 1.8px !important;
  }
  .presa-marker.presa-size-s .presa-marker-badge {
    width: 9px !important;
    height: 9px !important;
    font-size: 0.48rem !important;
  }

  .presa-marker.presa-size-l {
    width: 28px !important;
    height: 28px !important;
    margin-left: -14px !important;
    margin-top: -14px !important;
    border-width: 3px !important;
  }
  .presa-marker.presa-size-l .presa-marker-badge {
    width: 16px !important;
    height: 16px !important;
    font-size: 0.72rem !important;
  }

  .boulder-thumb-box {
    height: 90px !important;
  }
}

/* ======================================================== */
/* SECCI�N ESTAD�STICAS & RENDIMIENTO UNIFICADA Y MODULAR   */
/* ======================================================== */
.stats-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
}

.stats-tabs-container {
  display: flex;
  justify-content: center;
}

.stats-tabs-track {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
  width: 100%;
  max-width: 650px;
}

.stats-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.stats-tab-btn.active {
  background: var(--accent-color, #0284c7);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.stats-tab-icon {
  font-size: 1.1rem;
}

.badge-tab-count {
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.stats-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  transition: transform 0.2s ease;
}

.stats-kpi-card:hover {
  transform: translateY(-2px);
}

.stats-kpi-icon {
  opacity: 0.85;
}

.stats-kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.climber-passport-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(234, 88, 12, 0.12) 100%), var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.passport-avatar {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.08);
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.font-grade-label {
  color: #f59e0b !important;
}

@media (max-width: 576px) {
  .stats-tab-btn {
    padding: 0.5rem 0.35rem;
    font-size: 0.75rem;
    flex-direction: column;
    gap: 2px;
  }
  .stats-tab-icon {
    font-size: 1rem;
  }
}


/* ======================================================== */
/* MENÚ DESPLEGABLE 'MÁS' PARA EL TOP NAV BAR               */
/* ======================================================== */
.nav-dropdown-wrapper {
  position: relative;
  display: inline-flex;
}

.nav-dropdown-btn {
  cursor: pointer;
  border: none;
}

.nav-arrow-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.nav-arrow-icon.open {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 250px;
  background: var(--bg-card, #131722);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  padding: 0.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.15s ease-out;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  color: var(--text-main) !important;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-primary, #38bdf8) !important;
  transform: translateX(3px);
}

.nav-dropdown-item.active {
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid rgba(2, 132, 199, 0.4);
  color: #38bdf8 !important;
  font-weight: 700;
}

.nav-dd-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.nav-dd-title {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
}

.nav-dd-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}