:root {
  /* ─────────────────────────────────────────────────────────────────────────
     SISTEMA DE MARCA RE/MAX  (rojo + azul + blanco)
     El rojo es el acento primario; el azul, el secundario/estructural.
     Históricamente la app usaba --teal como acento único: lo repuntamos al rojo
     RE/MAX para que todas las referencias `var(--teal)` adopten la marca.
     ──────────────────────────────────────────────────────────────────────── */
  --rmx-red: #dc1c2e;        /* Rojo RE/MAX — primario, estado "venta", CTAs */
  --rmx-red-dark: #b3121f;   /* hover/pressed del rojo */
  --rmx-red-soft: #f04555;   /* rojo claro para realces */
  --rmx-blue: #003da5;       /* Azul RE/MAX — secundario, estado "alquiler" */
  --rmx-blue-dark: #002b73;
  --rmx-blue-soft: #1857c4;

  /* Estados de las captaciones (badges del catálogo) */
  --st-venta: var(--rmx-red);
  --st-alquiler: var(--rmx-blue);
  --st-anticretico: #0a8f6e;
  --st-captacion: #e08a00;

  --page-bg: #eef2f7;
  --ice-0: #ffffff;
  --ice-1: #f7f9fc;
  --ice-2: #eef2f7;
  --ice-3: #e2e8f1;
  --ink: #16263d;            /* navy tinta — texto principal */
  --ink-soft: #44566b;
  --ink-muted: #6b7c8f;
  /* Alias de compatibilidad: el código viejo referencia --teal / --teal-dark.
     Ahora apuntan al rojo de marca para no tener que tocar cada ocurrencia. */
  --teal: var(--rmx-red);
  --teal-dark: var(--rmx-red-dark);
  --line: rgba(20, 38, 61, 0.12);
  --shadow-soft: 0 14px 40px rgba(16, 27, 45, 0.10);
  --shadow-hover: 0 22px 56px rgba(16, 27, 45, 0.16);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-modal: 0 30px 80px rgba(16, 27, 45, 0.22);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --ring: 0 0 0 4px rgba(220, 28, 46, 0.16);
  /* Curvas de easing tokenizadas (mantienen las 3 curvas ya en uso) */
  --ease-out: cubic-bezier(.2, .8, .2, 1);      /* UI general: entra rápido, responde */
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);    /* movimiento en pantalla (stepper) */
  --ease-panel: cubic-bezier(.22, .61, .36, 1); /* paneles del wizard */
  --ease-out-premium: cubic-bezier(.22, 1, .36, 1); /* tarjetas/botones de Mercado */

  /* ─────────────────────────────────────────────────────────────────────────
     IntraPlus — capa "dashboard limpio" (SaaS)
     Fondos sólidos, superficies planas y sombras suaves. Reemplaza el look
     glassmorphism por un sistema de superficies opacas + borde sutil.
     ──────────────────────────────────────────────────────────────────────── */
  --bg: #f1f4f9;             /* fondo de la app (sólido) */
  --surface: #ffffff;        /* tarjetas / paneles */
  --surface-2: #f7f9fc;      /* superficies secundarias (inputs, chips) */
  --surface-3: #eef2f7;      /* realces / hovers suaves */
  --border: #e4e9f0;         /* borde neutro de superficies */
  --border-strong: #d3dbe6;
  --shadow-sm: 0 1px 2px rgba(16,27,45,.06), 0 2px 8px rgba(16,27,45,.05);
  --shadow-md: 0 4px 14px rgba(16,27,45,.08), 0 10px 30px rgba(16,27,45,.06);
  --shadow-lg: 0 12px 40px rgba(16,27,45,.14);
  --sidebar-w: 250px;
  --topbar-h: 62px;
  --radius-card: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  /* overflow-x: clip (no "hidden"): "hidden" forzaría overflow-y:auto y convertiría al
     body en contenedor de scroll, rompiendo el position:sticky del mapa. */
  overflow-x: clip;
  color: var(--ink);
  line-height: 1.5;
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color-scheme: light;
}

body.app-locked { overflow: hidden; }

.app-lockable { transition: opacity .22s ease, transform .22s ease, filter .22s ease; }
body.app-locked .app-lockable { opacity: 0; pointer-events: none; user-select: none; filter: blur(8px); transform: translateY(8px); }
.container { width: min(1220px, calc(100% - 40px)); margin: 0 auto; }

.login-gate {
  position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(220,28,46,.06), transparent 60%),
    radial-gradient(900px 600px at 100% 110%, rgba(0,61,165,.06), transparent 60%),
    var(--bg);
}
.login-shell { width: min(460px, 100%); }
.login-card {
  position: relative; overflow: hidden; padding: 34px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
/* Cinta de marca RE/MAX en el borde superior de la tarjeta de login */
.login-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--rmx-red) 0 50%, var(--rmx-blue) 50% 100%);
}
/* Estructura base de los pseudo-elementos de acento (el bevel glass se retira;
   .summary::before y .card::after conservan su acento de marca más abajo). */
.card::before, .summary::before {
  content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none;
  background: none;
}
.login-brand { position: relative; display: inline-flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.login-mark {
  width: 46px; height: 46px; border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(232,243,245,.82)), radial-gradient(circle at 65% 25%, rgba(220,28,46,.32), transparent 42%);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 9px 9px 24px rgba(98,126,140,.14), -10px -10px 24px rgba(255,255,255,.9);
}
.login-brand strong, .brand-copy strong { display: block; color: var(--ink); font-size: 15px; letter-spacing: -.01em; }
.login-brand span, .brand-copy span { display: block; color: var(--ink-muted); font-size: 12px; }
.login-card h1 { position: relative; margin: 0; color: var(--ink); font-size: clamp(30px, 4vw, 40px); line-height: 1; letter-spacing: -.05em; }
.login-card p { position: relative; margin: 12px 0 0; color: var(--ink-soft); }
.login-form { position: relative; display: grid; gap: 12px; margin-top: 24px; }
.login-form label { display: grid; gap: 8px; }
.login-form label span { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.login-form input, .login-form button { width: 100%; }
.login-form button { margin-top: 4px; min-height: 50px; }
.login-error { min-height: 20px; margin: 0; color: #c63d45; font-size: 13px; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════════════
   SHELL — Sidebar fija + área principal + topbar delgado (dashboard limpio)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; z-index: 40;
  width: var(--sidebar-w); height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  transition: transform .28s var(--ease-out);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.sidebar-brand .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 4px 8px; border-radius: 11px; background: #fff; border: 1px solid var(--border);
}
.sidebar-brand .brand-logo { display: block; height: 30px; width: auto; }
.brand-copy { display: grid; gap: 1px; min-width: 0; }
.brand-copy strong { display: block; color: var(--ink); font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.brand-copy span { display: block; color: var(--ink-muted); font-size: 11px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 3px; align-content: start; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 44px; padding: 10px 12px; border: 0; border-radius: 11px; cursor: pointer;
  background: transparent; color: var(--ink-soft); text-align: left;
  font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  transition: background .16s var(--ease-out), color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--surface-3); color: var(--ink); box-shadow: none; transform: none; }
.sidebar-link.active { background: rgba(220,28,46,.10); color: var(--rmx-red); box-shadow: inset 3px 0 0 var(--rmx-red); }
.sidebar-link:active { transform: none; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px; min-width: 0; }
.sidebar-user-avatar {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800;
  background: linear-gradient(145deg, var(--rmx-red), var(--rmx-red-dark));
}
.sidebar-user-info { min-width: 0; display: grid; gap: 1px; }
.sidebar-user-info strong { color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { color: var(--ink-muted); font-size: 11px; }
.sidebar-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--ink-soft); font-size: 13px; font-weight: 700;
}
.sidebar-logout:hover { border-color: rgba(220,28,46,.4); color: var(--rmx-red); background: #fff; transform: none; box-shadow: none; }
.sidebar-logout svg { width: 17px; height: 17px; }

/* Overlay para cerrar la sidebar en mobile */
.sidebar-overlay { position: fixed; inset: 0; z-index: 39; background: rgba(16,27,45,.42); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
body.nav-open .sidebar-overlay { opacity: 1; visibility: visible; }

/* ── Área principal + topbar delgado ─────────────────────────────────────── */
.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .28s var(--ease-out); }
.app-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 clamp(16px, 3vw, 32px);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.app-topbar-title { margin: 0; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.nav-toggle {
  display: inline-flex; width: 42px; height: 42px; min-height: 42px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--ink);
  align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-toggle:hover { background: var(--surface-3); transform: none; box-shadow: none; border-color: var(--border-strong); }
.nav-toggle svg { width: 20px; height: 20px; }

/* Ocultar el sidebar en desktop para ganar espacio (toggle desde el topbar) */
body.sidebar-hidden .sidebar { transform: translateX(-100%); }
body.sidebar-hidden .app-main { margin-left: 0; }

/* ── Page header uniforme por vista ──────────────────────────────────────── */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 4px 0 22px; }
.page-header h2 { margin: 0; color: var(--ink); font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.page-header p { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; max-width: 72ch; }
.page-header-counter {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 96px; padding: 10px 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.page-header-counter strong { font-size: 26px; font-weight: 800; color: var(--rmx-red); font-variant-numeric: tabular-nums; line-height: 1.1; }
.page-header-counter span { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ═══════════════════════════════════════════════════════════════════════════
   VISTA INICIO — portada institucional
   ═══════════════════════════════════════════════════════════════════════════ */
.inicio-hero {
  position: relative; overflow: hidden;
  padding: clamp(28px, 4vw, 44px); margin-bottom: 26px;
  border-radius: var(--radius-card); border: 1px solid var(--border);
  background:
    radial-gradient(680px 320px at 100% -20%, rgba(220,28,46,.10), transparent 60%),
    radial-gradient(560px 320px at -10% 120%, rgba(0,61,165,.10), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.inicio-hero::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--rmx-red) 0 50%, var(--rmx-blue) 50% 100%);
}
.inicio-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.inicio-hero h1 { margin: 16px 0 0; color: var(--ink); font-size: clamp(32px, 5vw, 52px); line-height: 1.02; letter-spacing: -.05em; }
.inicio-hero h1 b { color: var(--rmx-red); }
.inicio-hero p { margin: 14px 0 0; max-width: 64ch; color: var(--ink-soft); font-size: 15px; }
.inicio-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.inicio-cta {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 11px 20px;
  border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 800; text-decoration: none;
  background: linear-gradient(145deg, var(--rmx-red), var(--rmx-red-dark)); color: #fff;
  box-shadow: 0 10px 22px rgba(220,28,46,.24);
  transition: transform .16s var(--ease-out), box-shadow .24s var(--ease-out), background .24s var(--ease-out);
}
.inicio-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(220,28,46,.3); background: linear-gradient(145deg, var(--rmx-red-soft), var(--rmx-red)); }
.inicio-cta--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.inicio-cta--ghost:hover { background: #fff; border-color: rgba(220,28,46,.4); color: var(--rmx-red); box-shadow: var(--shadow-sm); }

/* Encabezado de subsección dentro de Inicio */
.inicio-block { margin: 30px 0 14px; }
.inicio-block h3 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.inicio-block p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }

/* Bloque "Sobre RE/MAX Plus": texto + puntos clave */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: stretch; }
.about-card {
  padding: 24px; border-radius: var(--radius-card); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.about-card h4 { margin: 0 0 10px; color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.about-card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.about-card p:last-child { margin-bottom: 0; }
.about-card--placeholder { border-style: dashed; }
.about-note { display: block; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-muted); font-size: 12px; }

.about-stats { display: grid; gap: 12px; align-content: start; }
.about-stat {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
}
.about-stat-ico {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
  background: rgba(220,28,46,.10); color: var(--rmx-red);
}
.about-stat b { display: block; color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.about-stat span { display: block; margin-top: 3px; color: var(--ink-muted); font-size: 12px; font-weight: 600; }

/* Puntos de valor de la agencia */
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.value-card { padding: 20px; border-radius: var(--radius-card); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.value-card-ico {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 12px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 19px;
  background: rgba(0,61,165,.10); color: var(--rmx-blue);
}
.value-card h4 { margin: 0 0 6px; color: var(--ink); font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.value-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }

/* Accesos rápidos a las secciones */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.quick-card {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 20px; border-radius: var(--radius-card); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left;
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s var(--ease-out);
}
.quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(220,28,46,.28); }
.quick-card-ico {
  width: 46px; height: 46px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(220,28,46,.10); color: var(--rmx-red);
}
.quick-card-ico svg { width: 24px; height: 24px; }
.quick-card strong { color: var(--ink); font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.quick-card span { color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.quick-card-go { margin-top: auto; color: var(--rmx-red); font-size: 13px; font-weight: 800; }

.app-view.is-hidden { display: none; }
/* Transición de entrada al cambiar de vista (se re-dispara vía reflow en setActiveView) */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-view.view-anim { animation: viewIn .34s var(--ease-out) both; }
.app-shell { position: relative; z-index: 1; padding: 26px 0 60px; }

.filters, .properties-filters {
  position: relative; isolation: isolate; display: grid; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ice-0);
  box-shadow: var(--shadow-soft);
}
.filters { margin-top: 24px; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 18px; }
.properties-filters { margin-top: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 16px; }
.filters > *, .properties-filters > * { width: 100%; }

input, select, button {
  min-height: 46px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 11px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
  transition: border-color .24s var(--ease-out), box-shadow .24s var(--ease-out), transform .16s var(--ease-out), background .24s var(--ease-out), color .24s var(--ease-out);
  appearance: none;
}
input::placeholder { color: rgba(79,101,120,.66); }
select {
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 4px), calc(100% - 12px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
select:focus, select:hover {
  background-image: linear-gradient(45deg, transparent 50%, var(--teal) 50%), linear-gradient(135deg, var(--teal) 50%, transparent 50%);
}
input:hover, select:hover, button:hover { border-color: rgba(220,28,46,.42); box-shadow: var(--shadow-sm); background: #fff; }
input:focus, select:focus { outline: none; border-color: rgba(220,28,46,.62); box-shadow: var(--ring); background: #fff; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: none; border-color: rgba(220,28,46,.62); box-shadow: var(--ring); background: #fff; }
button:focus:not(:focus-visible) { box-shadow: none; }
button { cursor: pointer; font-weight: 800; }
button:disabled, button[disabled] {
  opacity: .5; cursor: not-allowed; transform: none !important;
  box-shadow: none; filter: saturate(.85);
}
button:disabled:hover, button[disabled]:hover { transform: none; box-shadow: none; border-color: rgba(124,151,164,.26); background: rgba(255,255,255,.68); }
/* CTAs primarios RE/MAX: rojo de marca */
.login-form button, .pdfLink, .modal-link {
  border-color: transparent; background: linear-gradient(145deg, var(--rmx-red), var(--rmx-red-dark)); color: #ffffff;
  box-shadow: 0 12px 26px rgba(220,28,46,.28), inset 0 1px 0 rgba(255,255,255,.18);
}
.login-form button:hover, .pdfLink:hover, .modal-link:hover {
  transform: translateY(-2px); border-color: transparent; background: linear-gradient(145deg, var(--rmx-red-soft), var(--rmx-red));
  box-shadow: 0 18px 34px rgba(220,28,46,.34);
}
/* Botones "Limpiar filtros": secundario neutro (acción de menor jerarquía) */
#clearBtn, #propClearBtn {
  border-color: rgba(20,38,61,.16); background: #ffffff; color: var(--ink);
  box-shadow: 0 6px 16px rgba(16,27,45,.08);
}
#clearBtn:hover, #propClearBtn:hover {
  transform: translateY(-2px); border-color: rgba(220,28,46,.5); color: var(--rmx-red);
  background: #fff; box-shadow: 0 12px 24px rgba(16,27,45,.1);
}

/* Press feedback — la UI confirma que "escuchó" el click */
button:active { transform: scale(.97); }
#clearBtn:active, #propClearBtn:active, .login-form button:active,
.pdfLink:active, .modal-link:active, #fctWordBtn:active { transform: translateY(-1px) scale(.97); }
.pagination-btn:active, .chip:active { transform: translateY(-1px) scale(.97); }
.modal-close:active { transform: rotate(90deg) scale(.92); }

.summary {
  position: relative; overflow: hidden; margin: 18px 0; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--ice-1); color: var(--ink-soft);
  box-shadow: 0 4px 14px rgba(16,27,45,.05);
  font-weight: 700; letter-spacing: .005em;
}
/* Acento RE/MAX a la izquierda del resumen */
.summary::before { background: var(--rmx-red); inset: 0 auto 0 0; width: 4px; border-radius: 14px 0 0 14px; }

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; }
.card {
  position: relative; overflow: hidden; display: grid; gap: 14px; min-height: 330px; padding: 22px;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  background:
    radial-gradient(320px 220px at 100% 0%, rgba(220,28,46,.05), transparent 60%),
    var(--ice-0);
  box-shadow: var(--shadow-soft); cursor: pointer; transform: translateY(0);
  transition: transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s cubic-bezier(.2,.8,.2,1), border-color .32s ease, background .32s ease;
}
/* Cinta de acento RE/MAX en el borde superior de la tarjeta de proyecto */
.card::before { background: linear-gradient(135deg, rgba(220,28,46,.04), transparent 60%); }
.card::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--rmx-red), var(--rmx-blue));
  transform: scaleX(0); transform-origin: left; opacity: .9;
  transition: transform .4s var(--ease-out); pointer-events: none;
}
.card:hover::after { transform: scaleX(1); }
.card:hover { transform: translateY(-4px); border-color: rgba(220,28,46,.28); box-shadow: var(--shadow-hover); }
.card:active { transform: translateY(-2px); }
.card h2 { position: relative; z-index: 1; margin: 0; padding-bottom: 13px; color: var(--ink); font-size: 22px; line-height: 1.15; letter-spacing: -.04em; }
.card h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 76px; height: 3px; border-radius: 999px; background: linear-gradient(90deg, var(--teal), rgba(220,28,46,0)); }
.grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card p { position: relative; z-index: 1; margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.grid p, .contact p, .sourceRow, .modal-grid p, .modal-full { padding: 11px 13px; border-radius: 12px; background: var(--ice-1); border: 1px solid var(--line); }
.contact { position: relative; z-index: 1; display: grid; gap: 9px; }
.sourceRow { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdfLink { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 14px; border-radius: 16px; text-decoration: none; font-size: 13px; font-weight: 800; transition: transform .16s var(--ease-out), box-shadow .24s var(--ease-out), background .24s var(--ease-out), border-color .24s var(--ease-out); }
.pdfMissing { display: none; color: var(--ink-muted); font-size: 13px; font-weight: 700; }
.card strong, .prop-card strong, .modal-content strong { color: var(--ink); font-weight: 800; }
.empty-state { min-height: auto; text-align: center; color: var(--ink-soft); }

.properties-shell {
  /* overflow visible: un ancestro con overflow:hidden rompería el position:sticky del mapa */
  position: relative; overflow: visible; margin-top: 8px; padding: 26px;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.properties-head, .properties-filters, .properties-pagination, .properties-cards { position: relative; z-index: 1; }
.properties-head h2 { margin: 0; color: var(--ink); font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.05em; line-height: 1.02; }
.properties-head p { margin: 10px 0 0; color: var(--ink-soft); }
.properties-filters input, .properties-filters select, .properties-filters button { min-height: 46px; }
.properties-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; margin-top: 18px; align-items: stretch; }

/* ── Tarjeta de propiedad (estilo portal inmobiliario) ──────────────────────
   Cuadrícula simétrica: todas las tarjetas comparten alto gracias a
   grid-template-rows: auto 1fr (foto fija + cuerpo flexible).               */
.prop-card {
  position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr;
  border: 1px solid var(--line); border-radius: 18px; padding: 0;
  background: var(--ice-0);
  box-shadow: 0 6px 20px rgba(16,27,45,.07);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s var(--ease-out);
  cursor: pointer;
}
.prop-card:hover { transform: translateY(-5px); border-color: rgba(220,28,46,.28); box-shadow: 0 18px 40px rgba(16,27,45,.16); }
.prop-card:focus-visible { outline: 2px solid var(--rmx-red); outline-offset: 2px; }

.prop-card-media {
  position: relative; width: 100%; aspect-ratio: 16 / 11; overflow: hidden;
  background: linear-gradient(145deg, var(--ice-2), var(--ice-3));
}
.prop-card-image { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .5s var(--ease-out); }
.prop-card:hover .prop-card-image { transform: scale(1.06); }
/* Velo inferior para legibilidad de los badges sobre la foto */
.prop-card-media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(16,27,45,.18) 0%, transparent 26%); }
.prop-card-media-empty { display: grid; place-items: center; }
.prop-media-empty-label { color: var(--ink-muted); font-size: 13px; font-weight: 800; letter-spacing: .02em; }

/* Badge de estado (esquina sup. izq.) — color por categoría */
.prop-badge {
  position: absolute; z-index: 2; top: 12px; left: 12px;
  padding: 6px 12px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 6px 16px rgba(16,27,45,.22);
}
.prop-badge--venta       { background: var(--st-venta); }
.prop-badge--alquiler    { background: var(--st-alquiler); }
.prop-badge--anticretico { background: var(--st-anticretico); }
.prop-badge--captacion   { background: var(--st-captacion); }
/* Chip de tipo de inmueble (esquina sup. der.) */
.prop-type-chip {
  position: absolute; z-index: 2; top: 12px; right: 12px;
  max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; color: var(--ink);
  background: rgba(255,255,255,.92); box-shadow: 0 4px 12px rgba(16,27,45,.16);
}

.prop-card-body { display: flex; flex-direction: column; gap: 8px; padding: 15px 16px 16px; min-width: 0; }
.prop-price { color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.prop-loc { display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.prop-loc-pin { width: 15px; height: 15px; flex-shrink: 0; color: var(--rmx-red); }
.prop-loc span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.prop-tag { padding: 4px 10px; border-radius: 8px; background: var(--ice-2); border: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
/* Pie con avatar de iniciales del agente; se ancla abajo (margin-top:auto) */
.prop-agent { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.prop-agent-avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, var(--rmx-blue), var(--rmx-blue-dark));
}
.prop-agent-name { min-width: 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-drive-link {
  align-self: flex-end; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ice-1);
  color: var(--rmx-blue); font-size: 11px; font-weight: 800;
  text-decoration: none; line-height: 1; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.prop-drive-link:hover {
  background: var(--rmx-blue); border-color: var(--rmx-blue); color: #fff;
  box-shadow: 0 5px 12px rgba(0,61,165,.22);
}
.prop-drive-link:focus-visible { outline: 2px solid var(--rmx-blue); outline-offset: 2px; }
.prop-card-empty { cursor: default; color: var(--ink-muted); text-align: center; padding: 24px; grid-template-rows: none; }
.properties-map { width: 100%; height: 420px; border-radius: 22px; border: 1px solid rgba(255,255,255,.7); box-shadow: inset 0 1px 0 rgba(255,255,255,.72); overflow: hidden; z-index: 0; }
.property-pin { background: none; border: none; cursor: pointer; filter: drop-shadow(0 2px 3px rgba(38,54,72,.35)); transition: transform .15s ease; }
.property-pin svg { width: 28px; height: 40px; display: block; }
.property-pin:hover { transform: scale(1.12); }
.prop-card-highlight { outline: 3px solid var(--teal); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(220,28,46,.18); animation: propCardPulse 1.1s ease-in-out 2; }
@keyframes propCardPulse { 0%,100% { box-shadow: 0 0 0 6px rgba(220,28,46,.18); } 50% { box-shadow: 0 0 0 12px rgba(220,28,46,.05); } }
.properties-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.pagination-btn, .pagination-ellipsis { min-width: 40px; height: 38px; border-radius: 14px; border: 1px solid rgba(124,151,164,.2); background: rgba(255,255,255,.62); color: var(--ink); font-size: 13px; font-weight: 800; }
.pagination-btn { cursor: pointer; transition: transform .16s var(--ease-out), border-color .22s var(--ease-out), background .22s var(--ease-out), box-shadow .22s var(--ease-out); }
.pagination-btn:hover { transform: translateY(-1px); border-color: rgba(220,28,46,.34); box-shadow: 0 10px 22px rgba(38,54,72,.09); }
.pagination-btn.is-active { background: linear-gradient(145deg, var(--rmx-red), var(--rmx-red-dark)); border-color: transparent; color: #ffffff; box-shadow: 0 8px 18px rgba(220,28,46,.28); }
.pagination-btn.is-disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.pagination-ellipsis { display: inline-flex; align-items: center; justify-content: center; cursor: default; border-style: dashed; color: var(--ink-muted); }

.modal { position: fixed; inset: 0; z-index: 9999; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(16,27,45,.5); }
.modal-content {
  position: relative; overflow: auto; width: min(1060px, calc(100% - 24px)); max-height: calc(100vh - 48px); margin: 24px auto; padding: 26px;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modalRise .24s cubic-bezier(.2,.8,.2,1) both;
}
.modal.open .modal-backdrop { animation: backdropFade .22s ease both; }
/* z-index alto: el título (#propModalTitle/#modalTitle) tiene z-index:1 y, sin esto,
   tapaba el botón de cerrar interceptando el clic. Debe quedar por encima de todo el modal. */
.modal-close { position: absolute; z-index: 6; top: 18px; right: 18px; width: 42px; height: 42px; min-height: 42px; border-radius: 50%; padding: 0; background: rgba(255,255,255,.72); border: 1px solid rgba(124,151,164,.24); color: var(--ink); box-shadow: 0 10px 20px rgba(38,54,72,.1); }
.modal-close:hover { transform: rotate(90deg); border-color: rgba(220,28,46,.38); background: rgba(255,255,255,.9); }
.modal-content h3, .modal-content #modalSubtitle, .modal-content #propModalSubtitle, .modal-grid, .modal-full, .modal-link, .property-gallery, .detail-title, .detail-search, .detail-chips, .detail-wrap { position: relative; z-index: 1; }
.modal-content h3 { margin: 0; padding-right: 58px; color: var(--ink); font-size: clamp(26px, 3vw, 38px); line-height: 1.02; letter-spacing: -.05em; }
.modal-content #modalSubtitle { margin: 10px 0 20px; color: var(--ink-soft); }
.modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.modal-full { margin-bottom: 10px; }
.modal-link { margin: 8px 0 18px; }

.property-gallery { position: relative; z-index: 1; margin: 4px 0 16px; }
.property-gallery-main { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; border: 1px solid rgba(255,255,255,.7); background: linear-gradient(145deg, rgba(244,251,251,.92), rgba(215,232,236,.62)); box-shadow: inset 0 1px 0 rgba(255,255,255,.72); }
.property-gallery-image { width: 100%; height: 100%; display: block; object-fit: cover; }
/* z-index:2 para garantizar que las flechas queden siempre por encima de la imagen
   de la galería y sean clicables de forma fiable. */
.gallery-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; min-height: 42px; border-radius: 50%; padding: 0; background: rgba(255,255,255,.78); border: 1px solid rgba(124,151,164,.24); color: var(--ink); box-shadow: 0 10px 20px rgba(38,54,72,.1); font-size: 16px; }
.gallery-nav:hover { background: rgba(255,255,255,.94); border-color: rgba(220,28,46,.38); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.property-gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gallery-thumb { padding: 0; width: 64px; height: 48px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; opacity: .68; transition: opacity .2s ease, border-color .2s ease; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { opacity: 1; border-color: var(--teal); }
.detail-title { margin: 12px 0 12px; color: var(--ink); font-size: 17px; letter-spacing: -.01em; }
.detail-search { width: 100%; margin: 0 0 12px; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip { min-height: 38px; padding: 8px 13px; border-radius: 999px; border: 1px solid rgba(124,151,164,.22); background: rgba(255,255,255,.62); color: var(--ink-soft); font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .16s var(--ease-out), border-color .22s var(--ease-out), box-shadow .22s var(--ease-out), background .22s var(--ease-out), color .22s var(--ease-out); }
.chip:hover { transform: translateY(-1px); border-color: rgba(220,28,46,.42); box-shadow: 0 10px 20px rgba(38,54,72,.08); }
.chip.active { background: linear-gradient(145deg, var(--teal), var(--teal-dark)); border-color: rgba(220,28,46,.64); color: #ffffff; box-shadow: 0 12px 24px rgba(220,28,46,.18); }
.detail-wrap { overflow: hidden; border: 1px solid rgba(255,255,255,.7); border-radius: 22px; background: rgba(255,255,255,.58); box-shadow: inset 0 1px 0 rgba(255,255,255,.72); }
.detail-table-scroll { overflow: auto; }
.detail-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.detail-table th, .detail-table td { padding: 13px 13px; text-align: left; font-size: 13px; border-bottom: 1px solid rgba(124,151,164,.16); }
.detail-table th { position: sticky; top: 0; z-index: 1; color: var(--ink); background: var(--surface-3); font-weight: 800; }
.detail-table td { color: var(--ink-soft); }
.detail-empty { margin: 0; padding: 16px; color: var(--ink-soft); }

.reveal { opacity: 0; transform: translateY(18px); filter: blur(4px); transition: opacity .52s var(--ease-out), transform .52s var(--ease-out), filter .52s var(--ease-out); }
.reveal.in-view { opacity: 1; transform: translateY(0); filter: blur(0); }
.card.reveal.in-view:hover { transform: translateY(-4px); }
@keyframes modalRise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes backdropFade { from { opacity: 0; } to { opacity: 1; } }

/* Stagger de entrada para tarjetas de Propiedades (solo primera carga) */
@keyframes propCardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.properties-cards.stagger-in .prop-card {
  animation: propCardIn .42s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

/* En táctil, un tap no debe dejar la tarjeta "elevada" de forma permanente */
@media (hover: none) {
  .card:hover, .prop-card:hover { transform: none; box-shadow: var(--shadow-soft), var(--shadow-inset); }
  .card.reveal.in-view:hover { transform: translateY(0); }
  .prop-card:hover .prop-card-image { transform: none; }
  /* En táctil, el hover persiste tras el tap: neutralizamos los lifts para no dejar
     botones/chips/links "elevados" permanentemente. */
  #clearBtn:hover, #propClearBtn:hover, #fctWordBtn:hover, .pdfLink:hover, .modal-link:hover,
  .chip:hover, .pagination-btn:hover, .hero-pill:hover { transform: none; }
}

/* Sidebar off-canvas en pantallas medianas/pequeñas */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .nav-toggle { display: inline-flex; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1040px) {
  .filters, .properties-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .properties-shell { padding: 18px; }
  .reveal, .reveal.in-view { opacity: 1; transform: none; filter: none; }
  .filters, .properties-filters { grid-template-columns: 1fr; }
  .results, .properties-cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { width: min(1220px, calc(100% - 20px)); }
  .app-shell { padding-top: 20px; }
  input, select, button { font-size: 16px; }
  .filters, .properties-filters { padding: 14px; gap: 10px; border-radius: 22px; }
  .summary { padding: 12px 14px; font-size: 13px; }
  .card { min-height: auto; padding: 17px; border-radius: 24px; }
  .grid, .modal-grid { grid-template-columns: 1fr; }
  .modal-content { width: calc(100% - 16px); max-height: calc(100vh - 24px); margin: 12px auto; padding: 18px; border-radius: 24px; }
  .modal-close { top: 12px; right: 12px; width: 38px; height: 38px; min-height: 38px; }
  .detail-table { min-width: 700px; }
}
/* ── Panel de Agentes (sección interna) ─────────────────────────────────── */
.agents-shell {
  position: relative; overflow: hidden; margin-top: 8px; padding: 26px;
  border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--ice-0);
  box-shadow: var(--shadow-soft);
}
.agents-head h2 { margin: 0; color: var(--ink); font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.05em; line-height: 1.02; }
.agents-head p { margin: 10px 0 0; color: var(--ink-soft); max-width: 70ch; }
.agents-filters { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-top: 18px; }
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; margin-top: 4px; align-items: start; }

.agent-card {
  display: flex; flex-direction: column; gap: 14px; padding: 18px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--ice-0);
  box-shadow: 0 6px 20px rgba(16,27,45,.07);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s var(--ease-out);
}
.agent-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(16,27,45,.13); border-color: rgba(0,61,165,.22); }
.agent-card-empty { align-items: center; color: var(--ink-muted); text-align: center; padding: 28px; }

.agent-card-head { display: flex; align-items: center; gap: 12px; }
.agent-avatar {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(145deg, var(--rmx-blue), var(--rmx-blue-dark));
  box-shadow: 0 8px 18px rgba(0,61,165,.26);
}
.agent-id { min-width: 0; }
.agent-name { display: block; color: var(--ink); font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-zone { display: block; margin-top: 2px; color: var(--rmx-red); font-size: 12px; font-weight: 800; }
.agent-drive-link {
  flex-shrink: 0; margin-left: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ice-1);
  color: var(--rmx-blue); font-size: 12px; font-weight: 800;
  text-decoration: none; line-height: 1; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.agent-drive-link:hover {
  background: var(--rmx-blue); border-color: var(--rmx-blue); color: #fff;
  box-shadow: 0 6px 14px rgba(0,61,165,.22);
}
.agent-drive-link:focus-visible { outline: 2px solid var(--rmx-blue); outline-offset: 2px; }

.agent-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.agent-stat { padding: 10px 8px; border-radius: 12px; background: var(--ice-1); border: 1px solid var(--line); text-align: center; }
.agent-stat b { display: block; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.agent-stat span { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

.agent-props { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.agent-prop {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
  padding: 8px; border-radius: 12px; background: var(--ice-1); border: 1px solid var(--line);
}
.agent-prop-badge { padding: 4px 9px; border-radius: 999px; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.agent-prop-main {
  min-height: 0; padding: 2px 4px; border: 0; background: none; box-shadow: none; text-align: left; cursor: pointer;
  display: grid; gap: 2px; min-width: 0;
}
.agent-prop-main:hover { background: none; box-shadow: none; transform: none; }
.agent-prop-mls { color: var(--ink); font-size: 12px; font-weight: 800; }
.agent-prop-meta { color: var(--ink-soft); font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-prop-main:hover .agent-prop-mls { color: var(--rmx-red); }
.agent-prop-status {
  min-height: 34px; padding: 6px 26px 6px 10px; border-radius: 9px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--line); background-color: #fff;
  background-position: calc(100% - 9px) calc(50% - 2px), calc(100% - 4px) calc(50% - 2px);
}
/* Color del select según el estado de seguimiento */
.agent-prop-status.is-contactado     { border-color: rgba(0,61,165,.5);  color: var(--rmx-blue); }
.agent-prop-status.is-en-seguimiento { border-color: rgba(224,138,0,.6); color: #b56e00; }
.agent-prop-status.is-visita-agendada{ border-color: rgba(24,87,196,.6); color: var(--rmx-blue-soft); }
.agent-prop-status.is-cerrado        { border-color: rgba(10,143,110,.6);color: #0a8f6e; }

@media (max-width: 760px) {
  .agents-shell { padding: 18px; }
  .agents-filters { grid-template-columns: 1fr; }
  .agents-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard de métricas ──────────────────────────────────────────────── */

.dash-root { margin-top: 28px; }

.dash-hd { margin-bottom: 28px; }
.dash-tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.78);
  background: rgba(255,255,255,.58); color: var(--ink-soft);
  box-shadow: 0 8px 20px rgba(38,54,72,.07);
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.dash-tag::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 0 3px rgba(220,28,46,.18);
  animation: dashPulse 2.4s ease-in-out infinite;
}
@keyframes dashPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220,28,46,.18); }
  50%       { box-shadow: 0 0 0 6px rgba(220,28,46,.08); }
}
.dash-h2 {
  margin: 14px 0 0; color: var(--ink);
  font-size: clamp(24px, 3.5vw, 36px); line-height: 1; letter-spacing: -.05em;
}
.dash-sub { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; max-width: 62ch; }

/* Hero de valor gestionado */
.dash-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: center;
  padding: 26px 28px; margin-bottom: 22px;
  border-radius: var(--radius-card); border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease;
}
.dash-hero.in-chart { opacity: 1; transform: translateY(0); }
.dash-hero:hover { box-shadow: var(--shadow-hover), var(--shadow-inset); }
.dash-hero-eyebrow {
  display: block; color: var(--ink-muted); font-size: 11px; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase;
}
.dash-hero-val {
  display: block; margin: 8px 0 6px;
  font-size: clamp(40px, 6vw, 60px); line-height: .96; letter-spacing: -.05em;
  font-weight: 800; color: var(--ink);
  background: linear-gradient(120deg, var(--rmx-red), var(--rmx-blue) 60%, var(--rmx-blue-soft));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.dash-hero-note { display: block; color: var(--ink-soft); font-size: 13px; }
.dash-hero-split {
  display: flex; gap: 4px; height: 12px; margin-top: 18px;
  border-radius: 999px; overflow: hidden; background: rgba(124,151,164,.14);
}
.hs-seg { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1.1s cubic-bezier(.2,.8,.2,1) .25s; }
.dash-hero.in-chart .hs-seg { width: var(--w); }
.hs-inv { background: linear-gradient(90deg, var(--rmx-blue), var(--rmx-blue-soft)); }
.hs-prop { background: linear-gradient(90deg, var(--rmx-red), var(--rmx-red-soft)); }
.dash-hero-pills { display: grid; gap: 12px; }
.hero-pill {
  position: relative; padding: 16px 18px;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto;
  column-gap: 10px; align-items: center;
  border-radius: 20px; border: 1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.hero-pill:hover { transform: translateX(4px); }
.hp-dot { width: 11px; height: 11px; border-radius: 4px; }
.hp-lbl { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.hp-val { grid-column: 3; grid-row: 1; font-size: 22px; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
.hp-sub { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; font-size: 12px; color: var(--ink-muted); }

/* Etiquetas de grupo */
.dash-group-label {
  display: flex; align-items: center; gap: 14px; margin: 30px 2px 16px;
}
.dash-group-label span {
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); white-space: nowrap;
}
.dash-group-label::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* KPI counters */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 14px; margin-bottom: 8px;
}
.dash-kpi {
  position: relative; overflow: hidden; padding: 20px 18px 18px;
  border-radius: var(--radius-card); border: 1px solid var(--border);
  background:
    radial-gradient(260px 180px at 100% 0%, rgba(var(--kc-rgb),.06), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease;
}
.dash-kpi:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.dash-kpi-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; font-size: 22px;
  background: var(--surface-2); border: 1px solid var(--border);
  margin-bottom: 14px;
}
.dash-kpi-num {
  display: block; font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1; letter-spacing: -.06em; color: var(--ink);
  font-weight: 800; font-variant-numeric: tabular-nums;
}
.hp-val, .rank-val, .db-count, .dash-hero-val { font-variant-numeric: tabular-nums; }
.dash-kpi-lbl {
  display: block; margin-top: 6px;
  color: var(--ink-muted); font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.dash-kpi-accent {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--kc), transparent);
  border-radius: 0 0 0 26px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s cubic-bezier(.2,.8,.2,1) .15s;
}
.dash-kpi:hover .dash-kpi-accent,
.dash-kpis.counted .dash-kpi-accent { transform: scaleX(1); }

/* Chart grid */
.dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}
.dash-card {
  position: relative; overflow: hidden; padding: 22px;
  border-radius: var(--radius-card); border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .32s cubic-bezier(.2,.8,.2,1), box-shadow .32s ease;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dash-card-ttl {
  margin: 0 0 18px; color: var(--ink);
  font-size: 15px; font-weight: 800; letter-spacing: -.02em;
}
.dash-card-ttl::before {
  content: ""; display: inline-block; width: 10px; height: 10px;
  border-radius: 4px; background: var(--teal); margin-right: 8px;
  vertical-align: middle;
}

/* Donut */
.dash-donut-row {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.dash-donut-fig {
  position: relative; flex-shrink: 0;
}
.dash-donut-fig svg { display: block; }

.donut-arc {
  opacity: 0;
  transition: opacity .5s ease;
}
.dash-card.in-chart .donut-arc { opacity: 1; }

.dash-donut-ctr {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.dash-donut-ctr strong {
  font-size: 20px; font-weight: 800; line-height: 1; color: var(--ink); letter-spacing: -.04em;
}
.dash-donut-ctr span { font-size: 11px; color: var(--ink-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* Legend */
.dash-legend { display: grid; gap: 10px; flex: 1; min-width: 130px; }
.dl-row { display: flex; align-items: center; gap: 8px; }
.dl-dot { flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; }
.dl-lbl { flex: 1; font-size: 12px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-val { font-size: 12px; color: var(--ink); font-weight: 800; white-space: nowrap; }
.dl-val em { font-style: normal; color: var(--ink-muted); font-weight: 600; }

/* Bar chart */
.dash-bars { display: grid; gap: 12px; }
.db-row { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 10px; }
.db-lbl { font-size: 12px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.db-track {
  height: 10px; border-radius: 999px;
  background: rgba(124,151,164,.14);
  overflow: hidden;
}
.db-fill {
  height: 100%; border-radius: 999px;
  width: 0;
  transition: width .9s cubic-bezier(.2,.8,.2,1);
}
.dash-card.in-chart .db-fill { width: var(--pct); transition-delay: calc(var(--i, 0) * .07s); }
.db-count { font-size: 12px; color: var(--ink); font-weight: 800; }

/* Ranking de agentes */
.dash-card-wide { grid-column: 1 / -1; }
.dash-rank { display: grid; gap: 12px; }
.rank-row {
  display: grid; grid-template-columns: 20px 38px 1fr auto;
  align-items: center; gap: 12px;
  opacity: 0; transform: translateX(-10px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--i, 0) * .08s);
}
.dash-card.in-chart .rank-row { opacity: 1; transform: translateX(0); }
.rank-pos { font-size: 13px; font-weight: 800; color: var(--ink-muted); text-align: center; }
.rank-avatar {
  width: 38px; height: 38px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  background: var(--ac);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ac) 38%, transparent);
}
.rank-body { display: grid; gap: 7px; min-width: 0; }
.rank-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { height: 8px; border-radius: 999px; background: rgba(124,151,164,.14); overflow: hidden; }
.rank-fill { height: 100%; width: 0; border-radius: 999px; transition: width .9s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * .08s + .1s); }
.dash-card.in-chart .rank-fill { width: var(--pct); }
.rank-val { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.rank-val em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-muted); }

/* Responsive dashboard */
@media (max-width: 1040px) {
  .dash-kpis { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .dash-charts { grid-template-columns: 1fr; }
  .dash-hero { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 760px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .dash-charts { gap: 12px; }
  .dash-card { padding: 18px; }
  .dash-hero { padding: 22px; }
  .dash-donut-row { flex-direction: column; align-items: flex-start; }
  .db-row { grid-template-columns: 88px 1fr 34px; }
  .rank-row { grid-template-columns: 18px 34px 1fr auto; gap: 10px; }
}
@media (max-width: 480px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-hero-val { font-size: 40px; }
}

/* ── /Dashboard ─────────────────────────────────────────────────────────── */

/* ── Formulario de Captación (FCT-24001) ───────────────────────────────── */

.fct-shell {
  position: relative; overflow: hidden; margin-top: 8px; padding: 26px;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.fct-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; }
.fct-head-logo { width: 140px; height: auto; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(0,0,0,.10)); }
.fct-head h2 { margin: 0; color: var(--ink); font-size: clamp(22px, 2.8vw, 32px); letter-spacing: -.05em; line-height: 1.02; }
.fct-head p { margin: 8px 0 0; color: var(--ink-soft); }

.fct-layout {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; margin-top: 20px; align-items: start;
}
.fct-form { display: grid; gap: 18px; }

/* ── Stepper (indicador de progreso) ─────────────────────────────────────── */
.fct-stepper { position: relative; z-index: 1; margin-top: 18px; }
.fct-stepper-list {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  margin: 0 0 12px; padding: 0; list-style: none;
}
.fct-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 4px 2px; color: var(--ink-muted); text-align: center; cursor: default;
  user-select: none; transition: color .2s ease;
}
.fct-step.is-clickable { cursor: pointer; }
.fct-step-num {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid rgba(124,151,164,.34); background: rgba(255,255,255,.62);
  color: var(--ink-soft); font-size: 13px; font-weight: 800; line-height: 1;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.fct-step-label { font-size: 11px; font-weight: 700; letter-spacing: .01em; }
.fct-step.is-clickable:hover .fct-step-num { border-color: rgba(220,28,46,.5); transform: translateY(-1px); }
.fct-step.is-done { color: var(--ink-soft); }
.fct-step.is-done .fct-step-num {
  border-color: rgba(220,28,46,.55); background: rgba(220,28,46,.12); color: var(--teal);
}
.fct-step.is-active { color: var(--ink); }
.fct-step.is-active .fct-step-num {
  border-color: transparent; color: #fff;
  background: linear-gradient(145deg, var(--teal, #dc1c2e), #b3121f);
  box-shadow: 0 8px 18px rgba(220,28,46,.28), inset 0 1px 0 rgba(255,255,255,.25);
}
.fct-step-track {
  position: relative; height: 6px; border-radius: 999px; overflow: hidden;
  background: rgba(124,151,164,.2);
}
.fct-step-progress {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal, #dc1c2e), #b3121f);
  transition: width .35s var(--ease-in-out);
}
.fct-step-count { margin: 8px 0 0; color: var(--ink-muted); font-size: 12px; font-weight: 700; }

/* ── Paneles de paso (uno visible a la vez) ──────────────────────────────── */
.fct-step-panel { display: none; }
.fct-step-panel.is-active { display: block; animation: fctStepIn .32s var(--ease-panel); }
@keyframes fctStepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Navegación del wizard ───────────────────────────────────────────────── */
.fct-step-nav { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fct-step-nav [hidden] { display: none !important; }
.fct-nav-btn { min-width: 140px; }
.fct-nav-next { margin-left: auto; }
.fct-step-error {
  position: relative; z-index: 1; margin: 0 0 2px; padding: 10px 14px;
  border: 1px solid rgba(214,69,69,.32); border-radius: 14px;
  background: rgba(214,69,69,.08); color: #c0392b; font-size: 13px; font-weight: 700;
}
.fct-field.is-invalid input,
.fct-field.is-invalid textarea {
  border-color: rgba(214,69,69,.7); background: rgba(214,69,69,.05);
  box-shadow: 0 0 0 3px rgba(214,69,69,.12);
}
.fct-field.is-invalid span { color: #c0392b; }
.fct-radio-group.is-invalid legend { color: #c0392b; }
.fct-radio-group.is-invalid { box-shadow: 0 0 0 3px rgba(214,69,69,.1); border-radius: 12px; }

.fct-card h3 {
  margin: 0 0 14px; padding-bottom: 10px; color: var(--ink); font-size: 16px; letter-spacing: -.01em;
  border-bottom: 1px solid var(--line);
}
.fct-card { min-height: 0; cursor: default; }
.fct-card:hover { transform: none; box-shadow: var(--shadow-soft), var(--shadow-inset); }
.fct-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fct-field { display: grid; gap: 6px; }
.fct-field span { color: var(--ink-soft); font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.fct-field-wide { grid-column: 1 / -1; }
.fct-field textarea {
  min-height: 90px; padding: 12px 15px; border: 1px solid rgba(124,151,164,.26); border-radius: 18px;
  background: rgba(255,255,255,.68); color: var(--ink); font: inherit; font-size: 14px; resize: vertical;
}
.fct-field textarea:focus { outline: none; border-color: rgba(220,28,46,.62); box-shadow: var(--ring); background: rgba(255,255,255,.92); }

.fct-radio-group {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin: 0 0 14px; padding: 0; border: 0;
}
.fct-radio-group legend { width: 100%; margin-bottom: 8px; padding: 0; color: var(--ink-soft); font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.fct-radio, .fct-check {
  display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer;
}
.fct-radio input, .fct-check input[type="checkbox"] {
  width: auto; min-height: auto; padding: 0; accent-color: var(--teal, #dc1c2e); cursor: pointer;
}

/* Chips píldora: la opción seleccionada se resalta en teal */
.fct-radio,
.fct-check:not(.fct-check-otros) {
  padding: 8px 14px; border: 1.5px solid rgba(124,151,164,.3); border-radius: 999px;
  background: rgba(255,255,255,.55); transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
.fct-radio:hover,
.fct-check:not(.fct-check-otros):hover {
  border-color: rgba(220,28,46,.45); background: rgba(255,255,255,.8);
}
.fct-radio:has(input:checked),
.fct-check:not(.fct-check-otros):has(input:checked) {
  border-color: rgba(220,28,46,.6); background: rgba(220,28,46,.14);
  color: var(--ink); font-weight: 700;
  box-shadow: 0 6px 16px rgba(220,28,46,.16), inset 0 1px 0 rgba(255,255,255,.4);
}

.fct-checks { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.fct-check-otros { flex-wrap: wrap; flex-basis: 100%; }
.fct-otros-input { flex: 1; min-width: 160px; }

.fct-actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; }
.fct-actions button { min-width: 160px; }
#fctWordBtn {
  border-color: rgba(38,54,72,.18); background: linear-gradient(145deg, #263648, #3b4c5f); color: #ffffff;
  box-shadow: 0 16px 30px rgba(38,54,72,.18), inset 0 1px 0 rgba(255,255,255,.14);
}
#fctWordBtn:hover { transform: translateY(-2px); border-color: rgba(220,28,46,.45); background: linear-gradient(145deg, #1f3041, #263648); box-shadow: 0 20px 36px rgba(38,54,72,.22), 0 0 0 4px rgba(220,28,46,.1); }

.fct-preview-wrap { position: sticky; top: 110px; align-self: start; }
.fct-preview {
  cursor: default; min-height: auto; padding: 28px; aspect-ratio: 210 / 297; overflow-y: auto;
  position: relative;
  background:
    linear-gradient(150deg, rgba(255,255,255,.92), rgba(255,255,255,.78)),
    radial-gradient(320px 220px at 92% 8%, rgba(220,28,46,.09), transparent 62%),
    radial-gradient(280px 210px at 0% 0%, rgba(215,232,236,.64), transparent 60%);
}
.fct-preview::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: url("IMG_LOGO/remax-balloon.png") center center / 55% no-repeat;
  opacity: .045;
  filter: saturate(0.35) brightness(1.3);
}
.fct-preview:hover { transform: none; }
.fct-doc-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--ink); }
.fct-doc-logo { width: 64px; height: auto; flex-shrink: 0; }
.fct-doc-head-text { display: grid; gap: 4px; }
.fct-doc-code { color: var(--ink-muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fct-doc-title { margin: 0; color: var(--ink); font-size: clamp(15px, 1.8vw, 19px); line-height: 1.2; letter-spacing: -.01em; text-transform: uppercase; }

.fct-doc-columns { display: grid; grid-template-columns: 1.9fr 1fr; gap: 0 18px; align-items: start; }
.fct-doc-side { border-left: 1px solid var(--line); padding-left: 18px; }

.fct-doc-section { margin-bottom: 16px; }
.fct-doc-section h3 {
  margin: 0 0 10px; padding-bottom: 6px; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.fct-doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
.fct-doc-grid p, .fct-doc-obs { margin: 0; padding: 4px 0; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.fct-doc-grid .fct-doc-wide { grid-column: 1 / -1; }
.fct-doc-checks { display: grid; gap: 5px; margin-bottom: 8px; }
.fct-doc-row { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; }
.fct-doc-row-otros { padding-top: 4px; }
.fct-checkbox-glyph { font-size: 15px; line-height: 1; color: var(--teal); }
.fct-empty { color: var(--ink-muted); font-style: italic; }

.fct-doc-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0; }
.fct-doc-opts-label { color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .01em; }
.fct-doc-opt { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 13px; }

.fct-doc-firma { text-align: center; margin-top: 22px; }
.fct-doc-firma-img { display: block; max-width: 170px; max-height: 70px; width: auto; height: auto; margin: 0 auto -10px; object-fit: contain; }
.fct-doc-firma-line { border-top: 1px solid var(--ink); width: 80%; margin: 28px auto 6px; }
.fct-doc-firma-label { margin: 0; color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.fct-doc-firma-name { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }

@media (max-width: 1040px) {
  .fct-layout { grid-template-columns: 1fr; }
  .fct-preview-wrap { position: static; }
  .fct-preview { aspect-ratio: auto; }
}
@media (max-width: 760px) {
  .fct-shell { padding: 18px; }
  .fct-grid { grid-template-columns: 1fr; }
  .fct-doc-columns { grid-template-columns: 1fr; }
  .fct-doc-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
  /* Stepper compacto: solo números + contador "Paso X de 5" */
  .fct-step-label { display: none; }
  .fct-step-num { width: 26px; height: 26px; font-size: 12px; }
  .fct-stepper-list { gap: 4px; }
  .fct-nav-btn { min-width: 0; flex: 1; }
  .fct-step-nav .fct-actions { width: 100%; }
  .fct-step-nav .fct-actions button { flex: 1; min-width: 0; }
}

@media print {
  body * { visibility: hidden; }
  #fctPreview, #fctPreview * { visibility: visible; }
  #fctPreview {
    position: absolute; inset: 0; width: 100%; height: auto; aspect-ratio: auto; margin: 0; padding: 0;
    border: 0; box-shadow: none; background: #fff; backdrop-filter: none;
  }
  #fctPreview::after, #fctPreview::before { display: none; }
  @page { size: A4; margin: 1.5cm; }
}

/* ── /Formulario de Captación ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal.in-view, .modal-content, .card, .prop-card { filter: none; transform: none; }
  .donut-arc { opacity: 1; }
  .db-fill, .rank-fill { width: var(--pct); }
  .hs-seg { width: var(--w); }
  .dash-kpi-accent { transform: scaleX(1); }
  .dash-hero, .rank-row { opacity: 1; transform: none; }
  .mkt-card { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MERCADO — Vista multi-inmobiliaria + ACM
   ═══════════════════════════════════════════════════════════════════════════ */

.mkt-shell { position: relative; }

.mkt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.mkt-head-text h2 { margin: 0 0 4px; font-size: 1.65rem; font-weight: 800; color: var(--ink); }
.mkt-head-text p  { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.mkt-head-counter {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 100px; padding: 14px 20px; border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.mkt-counter-num {
  font-size: 2rem; font-weight: 800; color: var(--rmx-red);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.mkt-counter-label { font-size: .75rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .04em; }

.mkt-filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
  padding: 18px; border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.mkt-filters input,
.mkt-filters select {
  padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--ice-3);
  font-size: .875rem; font-family: inherit; color: var(--ink);
  background: var(--ice-0);
  transition: border-color 200ms var(--ease-out-premium), box-shadow 200ms var(--ease-out-premium);
}
.mkt-filters input:focus,
.mkt-filters select:focus {
  outline: none; border-color: var(--rmx-red); box-shadow: var(--ring);
}
.mkt-filters button {
  padding: 10px 16px; border-radius: 8px; border: none; cursor: pointer;
  font-weight: 600; font-size: .875rem; font-family: inherit;
  background: var(--rmx-red); color: #fff;
  transition: transform 160ms var(--ease-out-premium), background 200ms ease;
}
.mkt-filters button:hover { background: var(--rmx-red-dark); }
.mkt-filters button:active { transform: scale(0.97); }


/* Panel flotante de análisis de zona */
.mkt-zone-panel {
  position: absolute; bottom: 16px; left: 16px; z-index: 1000;
  background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 14px 18px; min-width: 260px; max-width: 360px;
  border: 1px solid var(--border);
}
.mkt-zone-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mkt-zone-header h4 { margin: 0; font-size: .92rem; font-weight: 700; color: var(--ink); }
.mkt-zone-header button {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(220,28,46,.1); color: var(--rmx-red); font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.mkt-zone-header button:hover { background: var(--rmx-red); color: #fff; }
.mkt-zone-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mkt-zone-stat {
  text-align: center; padding: 6px 4px;
  background: var(--ice-1); border-radius: 10px;
}
.mkt-zone-stat-value { font-size: 1.05rem; font-weight: 800; color: var(--ink); display: block; }
.mkt-zone-stat-value small { font-size: .65rem; font-weight: 600; color: var(--ink-muted); }
.mkt-zone-stat-label { font-size: .65rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; display: block; }
.mkt-map {
  height: 420px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.06);
}

/* Pin personalizado */
.mkt-pin { background: none; border: none; }

/* ACM */
.mkt-acm-wrap { margin-bottom: 28px; }
.mkt-acm-wrap h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; color: var(--ink); }
.mkt-acm-panel {
  padding: 20px; border-radius: 16px;
  background: linear-gradient(135deg, #fff 0%, var(--ice-1) 100%);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.mkt-acm-empty { margin: 0; color: var(--ink-muted); font-size: .9rem; text-align: center; padding: 20px 0; }
.mkt-acm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px;
  margin-bottom: 16px;
}
.mkt-acm-metric {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 14px 10px; border-radius: 12px;
  background: rgba(255,255,255,.9); border: 1px solid var(--ice-3);
}
.mkt-acm-value {
  font-size: 1.35rem; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.mkt-acm-value small { font-size: .7rem; font-weight: 600; color: var(--ink-muted); }
.mkt-acm-label { font-size: .72rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }
.mkt-acm-toggle {
  display: block; margin: 0 auto; padding: 8px 20px; border-radius: 8px;
  border: 1.5px solid var(--rmx-blue); background: transparent; color: var(--rmx-blue);
  font-weight: 600; font-size: .82rem; cursor: pointer; font-family: inherit;
  transition: transform 160ms var(--ease-out-premium), background 200ms ease, color 200ms ease;
}
.mkt-acm-toggle:hover { background: var(--rmx-blue); color: #fff; }
.mkt-acm-toggle:active { transform: scale(0.97); }
.mkt-acm-detail { margin-top: 16px; overflow-x: auto; }
/* Entrada suave al mostrar el detalle de comparables (toggle de [hidden]) */
@keyframes acmDetailIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mkt-acm-detail:not([hidden]) { animation: acmDetailIn .38s var(--ease-out) both; }
/* Escalonado solo en las primeras filas (la tabla puede tener miles): evita animar
   miles de <tr> a la vez. El resto aparece con el fundido del contenedor. */
.mkt-acm-detail:not([hidden]) .mkt-acm-table tbody tr:nth-child(-n+25) {
  opacity: 0; animation: acmDetailIn .42s var(--ease-out) forwards;
  animation-delay: calc(var(--row, 0) * 40ms + 60ms);
}
.mkt-acm-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.mkt-acm-table th {
  text-align: left; padding: 8px 10px; font-weight: 700; color: var(--ink);
  border-bottom: 2px solid var(--ice-3); white-space: nowrap;
}
.mkt-acm-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--ice-2); color: var(--ink-soft);
}
.mkt-acm-table tr:hover td { background: var(--ice-1); }

/* Tarjetas */
.mkt-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
  margin: 20px 0;
}

.mkt-card {
  background: var(--ice-0); border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
  transition: transform 200ms var(--ease-out-premium), box-shadow 200ms var(--ease-out-premium);
  animation: mktCardIn 300ms var(--ease-out-premium) backwards;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes mktCardIn {
  from { opacity: 0; transform: translateY(8px); }
}

@media (hover: hover) and (pointer: fine) {
  .mkt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1), 0 16px 40px rgba(0,0,0,.1);
  }
  .mkt-card:hover .mkt-card-image { transform: scale(1.03); }
}
.mkt-card:active { transform: scale(0.97); }
.mkt-card:focus-visible { outline: 2px solid var(--rmx-red); outline-offset: 2px; }

.mkt-card-empty {
  grid-column: 1 / -1; text-align: center; padding: 40px 20px;
  color: var(--ink-muted); font-size: .95rem;
}

/* Media */
.mkt-card-media {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  background: var(--ice-2);
}
.mkt-card-media-empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ice-2), var(--ice-3));
}
.mkt-card-image {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 300ms var(--ease-out-premium);
}
.mkt-inmob-badge {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 700; letter-spacing: .02em;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* Body */
.mkt-card-body { padding: 14px 16px 16px; }
.mkt-price { font-size: 1.2rem; font-weight: 800; color: var(--ink); margin-bottom: 2px; }
.mkt-specs { margin: 0 0 4px; font-size: .82rem; color: var(--ink-muted); font-weight: 500; }
.mkt-loc {
  display: flex; align-items: center; gap: 4px;
  margin: 0 0 6px; font-size: .82rem; color: var(--ink-soft);
}
.mkt-loc .prop-loc-pin { width: 14px; height: 14px; flex-shrink: 0; color: var(--rmx-red); }
.mkt-desc { margin: 0 0 8px; font-size: .78rem; color: var(--ink-muted); line-height: 1.45; }

/* Agente */
.mkt-agent {
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px; border-top: 1px solid var(--ice-2);
}
.mkt-agent-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--rmx-blue); color: #fff;
  font-size: .72rem; font-weight: 700;
}
.mkt-agent-info { display: flex; flex-direction: column; min-width: 0; }
.mkt-agent-name {
  font-size: .82rem; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mkt-agent-company { font-size: .7rem; font-weight: 600; }
.mkt-agent-contacts {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.mkt-agent-contact {
  font-size: .72rem; color: var(--rmx-blue); text-decoration: none;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(0,61,165,.06);
  transition: background 200ms ease, color 200ms ease;
}
.mkt-agent-contact:hover { background: var(--rmx-blue); color: #fff; }

/* Responsive */
@media (max-width: 768px) {
  .mkt-head { flex-direction: column; align-items: flex-start; }
  .mkt-filters { grid-template-columns: 1fr 1fr; }
  .mkt-map { height: 280px; }
  .mkt-cards { grid-template-columns: 1fr; }
  .mkt-acm-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .mkt-filters { grid-template-columns: 1fr; }
  .mkt-acm-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULTS + MAP — tarjetas (izq.) + mapa grande sticky (der.)
   Estilo portal inmobiliario. Se usa en Propiedades (#propMap) y Mercado (#mktMap).
   ═══════════════════════════════════════════════════════════════════════════ */
.results-map {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 54%); gap: 18px;
  align-items: start; margin-top: 6px;
}
.results-map-list { min-width: 0; }
/* Tarjetas más compactas al vivir en la columna izquierda */
.results-map-list .properties-cards,
.results-map-list .mkt-cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 0; }

/* El mapa queda fijo (sticky) y alto mientras se scrollean las tarjetas */
.results-map-aside {
  position: sticky; top: calc(var(--topbar-h) + 14px);
  height: calc(100vh - var(--topbar-h) - 30px); min-height: 460px;
}
.results-map-aside .properties-map,
.results-map-aside .mkt-map {
  width: 100%; height: 100%; margin: 0; border-radius: var(--radius-card);
}

@media (max-width: 1040px) {
  /* En pantallas medianas el mapa pasa arriba, a lo ancho, y deja de ser sticky */
  .results-map { grid-template-columns: 1fr; }
  .results-map-aside { position: static; height: 400px; min-height: 0; order: -1; margin-bottom: 6px; }
}
