/* Fuente base — Inter (DeedToGo Brand) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =============================================================
   DeedToGo — Brand Design System
   Palette: Deep Navy #0D1B3D | Go Green #43B573 | Slate Gray #6B7280
   Typography: Inter (Google Fonts)
   ============================================================= */

/* ── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── A11Y BASE (Lote 9) ──────────────────────────────────────
   Anillo de foco visible SOLO para navegación por teclado
   (:focus-visible → no molesta al usuario de mouse). Los pocos
   controles que hacen `outline:none` reciben su propio compañero
   :focus-visible en su mismo archivo (specificity ≥ la regla que
   mata el outline). NO tocar los :focus-visible ya existentes. */
:focus-visible {
  outline: 2px solid var(--accent, #43B573);
  outline-offset: 2px;
}

/* Respeto de "reduce motion" del SO: neutraliza animaciones y
   transiciones sin romper el layout (sin display:none). El único
   scroll suave disparado por JS (choropleth Rama 1) se guarda
   aparte con window.matchMedia. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  /* ── Brand Palette (SSOT — Manual de Marca DeedToGo) ──
     Definición canónica global. NO inventar hexes fuera de aquí.
     Los --color-* / --fp-* son ALIAS de estos tokens (compat). */
  --brand-navy:        #0D1B3D;
  --brand-navy-dark:   #0A1530;
  --brand-navy-light:  #1A2B52;
  --brand-green:       #43B573;
  --brand-green-dark:  #3A9D64;
  --brand-green-soft:  #E8F5ED;
  /* a11y (C17): Go Green oscurecido para TEXTO y FONDOS con texto blanco. #43B573
     da ~2.6:1 sobre blanco (falla WCAG AA 4.5:1). #2E7A50 = 5.23:1 sobre blanco /
     4.68:1 sobre el azul del filtro R1 (#e8f4fd) → AA. #43B573 se reserva para uso
     decorativo (bordes, pines, fills SVG, focus rings). */
  --brand-green-strong: #2E7A50;
  --brand-green-hover: #4ABA7A;
  --brand-gray:        #6B7280;
  --brand-light:       #F4F7FB;
  --brand-white:       #FFFFFF;

  /* ── Semantic surfaces / ink (mapeados a brand) ── */
  --surface-0:     var(--brand-light);
  --surface-1:     var(--brand-white);
  --surface-2:     #F9FAFB;
  --surface-3:     #F3F4F6;
  --ink-1:         var(--brand-navy);
  --ink-2:         #374151;
  --ink-3:         var(--brand-gray);
  --ink-4:         #9CA3AF;
  --border:        #E5E7EB;
  --border-strong: #D1D5DB;

  /* ── Accent (Go Green) ── */
  --accent:        var(--brand-green);
  --accent-strong: var(--brand-green-dark);
  --accent-soft:   var(--brand-green-soft);
  --accent-2:      var(--brand-green-hover);

  /* ── Functional (semáforo de marca) ── */
  --success:       var(--brand-green);
  --success-soft:  var(--brand-green-soft);
  --warning:       #D97706;
  --warning-soft:  #FEF3C7;
  --danger:        #DC2626;
  --danger-soft:   #FEE2E2;

  /* ── CTA Naranja (Regla Naranja — solo CTAs transaccionales) ── */
  --color-cta:     #E67E22;

  /* ── Legacy aliases (→ brand SSOT; no agregar nuevos) ── */
  --color-navy:        var(--brand-navy);
  --color-navy-light:  var(--brand-navy-light);
  --color-navy-dark:   var(--brand-navy-dark);
  --color-green:       var(--brand-green);
  --color-gold:        var(--brand-green);   /* legacy mal nombrado: es VERDE, no dorado */
  --color-gold-light:  var(--brand-green-hover);
  --color-bg:          var(--surface-0);
  --color-surface:     var(--surface-1);
  --color-text:        var(--ink-1);
  --color-text-muted:  var(--ink-3);
  --color-error:       var(--danger);
  --color-success:     var(--success);
  --color-border:      var(--border);

  /* ── Typography (Inter only — brand mandate) ── */
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'Inter', system-ui, -apple-system, sans-serif;

  /* ── Escala tipográfica (SSOT) ─────────────────────────────────────────
     Derivada de Rama 1 / US Overview, que el owner aprobó como referencia
     visual (2026-07-28). Los valores NO son inventados: cada paso existe
     hoy en una regla viva de _atlas_styles.html.erb o _atlas_tokens.html.erb.
     Contrato: software/rules/ui/typography.md

     ⛔ US Overview NO se re-targetea contra estos tokens. Es la referencia:
     si un token deja de coincidir con lo que renderiza Rama 1, el token está
     mal, no Rama 1.

     ⚠️ Los tokens llevan SOLO el tamaño. Peso, tracking y line-height van
     explícitos en cada regla porque varían por rol con el mismo tamaño
     (ej. 12.5px es 600 en .rail-tab y 700 en .cdp__opp-addr). Al lado de
     cada token está la receta canónica y el selector de Rama 1 del que sale. */

  /* Display — numerales y títulos grandes. Tracking NEGATIVO obligatorio:
     es lo que le da a Rama 1 la densidad óptica que el resto no tenía. */
  --type-display:    31px;   /* 800 / -0.03em  / 1    · .atlas__kpis .kpi-value  */
  --type-h1:         26px;   /* 800 / -0.025em / 1.1  · .atlas__title            */
  --type-h2:         25px;   /* 700 / -0.022em / 1.2  · .atlas__ptitle           */
  --type-h3:         21px;   /* 800 / -0.02em  / 1    · .cdp__stat-value (base)  */
  --type-h4:         19px;   /* 800 / -0.015em / 1.1  · .cdp__name (base)        */

  /* UI — texto de interfaz. --type-ui es el caballo de batalla de Rama 1. */
  --type-lg:         15px;   /* 700 / normal   / 1.2  · .cdp__market-value       */
  --type-base:       14px;   /* 400 (600 énfasis, -0.005em) / 1.5 · body         */
  --type-md:         13px;   /* 600 / normal   / 1.4  · .cdp__follow             */
  --type-ui:         12.5px; /* 600 / normal   / 1.3  · .rail-tab, .kpi-label    */
  --type-sm:         12px;   /* 400 (600 label)/ 1.5  · .atlas__crumb            */

  /* Meta — texto de apoyo. */
  --type-xs:         11.5px; /* 400 / normal   / 1.5  · .atlas__legend           */
  --type-chip:       11px;   /* 600 / normal   / 1.5  · .count-pill              */
  --type-micro:      10.5px; /* 400 (700 pill) / 1.5  · .top-opp__specs          */

  /* Eyebrow — el ÚNICO patrón de microlabel: uppercase + tracking positivo.
     Los DOS pasos comparten tracking 0.1em: el tamaño baja, el tracking no.
     ⛔ No inventar variantes intermedias (0.04em / 0.05em / 0.06em / 0.08em /
     0.3px / 0.5px eran drift; se consolidan todas acá). */
  --type-eyebrow:    10px;   /* 700 / 0.1em / UPPERCASE · .cdp__opps-eyebrow  */
  --type-eyebrow-sm: 9.5px;  /* 700 / 0.1em / UPPERCASE · .atlas__state-label */

  /* ── Radii (escala SSOT) ── */
  --radius-sm: 6px;
  --radius:    10px;   /* = --radius-md (compat) */
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* ── Shadows (Deep Navy base — SSOT; resuelve colisión con research layout) ── */
  --shadow-sm:   0 1px 2px rgba(13, 27, 61, 0.04), 0 1px 1px rgba(13, 27, 61, 0.03);
  --shadow-md:   0 4px 14px rgba(13, 27, 61, 0.06), 0 2px 4px rgba(13, 27, 61, 0.04);
  --shadow-lg:   0 16px 40px rgba(13, 27, 61, 0.10), 0 6px 16px rgba(13, 27, 61, 0.06);
  --shadow-glow: 0 0 0 4px rgba(67, 181, 115, 0.15);

  /* ── Spacing ── */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 32px; --space-8: 48px;

  /* ── Page shell geometry (SSOT · la consumen los 3 layouts + el shell offline) ──
     Contrato: software/rules/ui/page_shell.md. Los literales de gutter / max-width en
     contenedores de página los bloquea script/page_shell_guard.rb.
     application.css la cargan research.html.erb, admin.html.erb, application.html.erb
     y pipeline/offline.html.erb → único sitio que alcanza a las 4 superficies.
     --rn-header-h vive en el 2º :root (:598) por historia; NO duplicar acá
     (precedente: ya se consume desde _ficha_styles y _pipeline_styles). */
  --rn-header-h-admin:  56px;   /* .admin-topbar (admin.css:22) */
  --rn-nav-h:           56px;   /* ALTO real de la bottom-nav: .mobile-nav no declara
                                   height; sale de .mobile-nav__item{min-height:56px}
                                   + border-top 1px. Valor documentado en
                                   pwa/responsive_per_rama.md. */
  --rn-nav-clearance:   64px;   /* HOLGURA de scroll bajo la nav (mobile.css:171 = 56+8).
                                   NO es el alto: son cantidades distintas. */

  --rn-gutter:          clamp(16px, 1.5vw + 4px, 40px);
  --rn-gutter-fixed:    24px;   /* = --space-6 · contextos de ancho FIJO (drawer de la Ficha) */

  /* DOS ARQUETIPOS DE PÁGINA, y sólo dos.

     1. SUPERFICIE DE TRABAJO (todo por lo que el usuario navega mientras
        trabaja: Atlas, Parcels, Pipeline, Hot Deals, Market Study, Reports,
        detalle de subasta). SIN tope: el gutter es la única constante, así que
        el borde izquierdo es idéntico en TODA pantalla y en TODO ancho de
        monitor. Es lo que el producto ya era — sus tres superficies más grandes
        (mapa, mapa y tablero) no se pueden capar sin desperdiciar monitor.

     2. FORMULARIO ENFOCADO (Settings, checkout): columna centrada. Es un
        destino, no parte del flujo de navegación, y una tarjeta de 860px
        huérfana a la izquierda de una página de 1440 se lee como un bug.
        Centrada se lee como una decisión. */
  --rn-form-max:        860px;
  --rn-measure-prose:   680px;  /* texto corrido dentro de una superficie */

  --rn-page-pad-top:    24px;   /* = --space-6 */
  --rn-page-pad-bottom: 48px;   /* = --space-8 */

  --transition: 0.18s ease;
}

html, body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-navy); text-decoration: none; }
a:hover { color: var(--color-gold); }

/* ── AUTH PAGES ────────────────────────────────────────────── */
.auth-page {
  display: flex;
  min-height: 100vh;
}

.auth-page__brand {
  display: none;
  flex: 1;
  /* A8 (full) — desktop brand panel unified to green (was navy gradient). */
  background: linear-gradient(145deg, #0A1530 0%, #0D1B3D 55%, #1A2B52 100%);
  padding: 3rem;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-page__brand::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(67, 181, 115, 0.10);   /* Brand green glow */
}

.brand-logo { line-height: 0; }
.brand-logo svg { height: 44px; width: auto; display: block; }

.brand-tagline {
  color: rgba(255,255,255,.85);
  /* 1.75rem (28px) → hero del panel de marca = --type-h1 */
  font-size: var(--type-h1);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-top: auto;
}

.brand-tagline small {
  display: block;
  /* 1rem (16px) → prosa secundaria bajo el hero = --type-base */
  font-size: var(--type-base);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: rgba(255,255,255,.55);
  margin-top: 0.75rem;
}

.auth-page__form-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 2rem 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}

.auth-card__logo {
  display: inline-block;
  margin-bottom: 1.5rem;
  line-height: 0;
}
.auth-card__logo svg { height: 30px; width: auto; display: block; }

.auth-card__title {
  /* 1.5rem (24px) → título de página del formulario = --type-h2 */
  font-size: var(--type-h2);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: var(--color-navy);
  margin-bottom: 0.35rem;
}

.auth-card__subtitle {
  /* 0.875rem (14px) → prosa = --type-base */
  font-size: var(--type-base);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* ── FORM ELEMENTS ─────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  /* 0.8125rem (13px) → label de formulario = --type-ui; 0.01em era drift → normal */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: var(--color-navy);
  margin-bottom: 0.4rem;
}

/* Control nativo: se emite tamaño + peso + tracking, NO line-height (en un
   <input> el line-height cambia la ALTURA de la caja = layout, no tipografía). */
.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font);
  /* 0.9375rem (15px) → texto de control = --type-base */
  font-size: var(--type-base);
  font-weight: 400;
  letter-spacing: normal;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: #43B573;
  box-shadow: 0 0 0 3px rgba(67, 181, 115, 0.15);
  background: #fff;
}
.form-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font);
  /* 0.9375rem (15px) → rol BOTÓN = --type-ui (el caballo de batalla del sistema) */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: #43B573;
  color: #fff;
  width: 100%;
  padding: 0.85rem;
  /* 1rem (16px) → CTA prominente: un escalón sobre .btn = --type-base con énfasis */
  font-size: var(--type-base);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.btn--primary:hover {
  background: #3A9D64;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

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

.btn--ghost {
  background: transparent;
  color: var(--color-navy);
  border: 1.5px solid var(--color-border);
}

.btn--ghost:hover { border-color: var(--color-navy); background: var(--color-bg); }

/* ── "or" divider + Continue with Google ──────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #8a8f98;
  /* 0.8125rem (13px) → prosa secundaria = --type-sm. OJO: .auth-divider está
     declarado DOS veces en este archivo (ver ~:500); ambas usan esta receta. */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  margin: 1.25rem 0;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.auth-divider span { padding: 0 0.75rem; }

/* button_to envuelve el <button> en un <form>: que no agregue margen propio. */
form.button_to { margin: 0; }

.btn--google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid var(--color-border);
  /* 0.95rem (15.2px) → botón = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
}
.btn--google:hover {
  background: #f7f8f8;
  border-color: #c6c9cc;
  box-shadow: var(--shadow-md);
  color: #3c4043;
}
.btn--google__icon { flex-shrink: 0; }

/* ── PLAN SELECTOR ─────────────────────────────────────────── */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.plan-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  position: relative;
}

.plan-card:hover { border-color: var(--color-navy-light); }

.plan-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.plan-card.selected {
  border-color: var(--color-navy);
  background: rgba(13, 27, 61, 0.04);
}

.plan-card.selected .plan-name { color: var(--color-navy); }

/* 0.875rem/1rem/0.7rem → nombre = texto de fila (--type-md), precio = valor en
   tarjeta (--type-lg), sufijo "/mo" = caption (--type-xs). */
.plan-name { font-size: var(--type-md); font-weight: 600; letter-spacing: normal; line-height: 1.4; color: var(--color-text); margin-bottom: 0.2rem; }
.plan-price { font-size: var(--type-lg); font-weight: 700; letter-spacing: normal; line-height: 1.2; color: var(--color-gold); }
.plan-price small { font-size: var(--type-xs); font-weight: 400; letter-spacing: normal; line-height: 1.5; color: var(--color-text-muted); }
.plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-gold);
  color: var(--color-navy-dark);
  /* 0.6875rem (11px) → badge = --type-chip */
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.5;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── TRIAL NOTICE ──────────────────────────────────────────── */
.trial-notice {
  background: linear-gradient(135deg, rgba(13, 27, 61, 0.06), rgba(67, 181, 115, 0.08));
  border: 1px solid rgba(67, 181, 115, 0.3);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  /* 0.8125rem (13px) → prosa secundaria = --type-sm */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  color: var(--color-text);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.trial-notice strong { color: var(--color-navy); }

/* ── DIVIDER ───────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--color-text-muted);
  /* 2ª declaración de .auth-divider (dup) — MISMA receta que la de ~:390 */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ── FLASH MESSAGES ──────────────────────────────────────────
   ⚠️ .flash está declarado DOS veces en este archivo (acá como toast fijo y
   ~:1500 como caja inline) y una TERCERA en layouts/research.html.erb.
   Las tres comparten ahora la MISMA receta: --type-base / 400 / normal / 1.5. */
.flash {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-size: var(--type-base);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.flash--notice { background: var(--color-navy); color: #fff; }
.flash--alert  { background: var(--color-error); color: #fff; }
/* Glifo "×": solo se tokeniza el TAMAÑO (1.2rem = 19.2px → --type-h4 = 19px).
   No se emite peso/tracking: es un carácter, no un título. */
.flash__close  { background: none; border: none; color: inherit; cursor: pointer; font-size: var(--type-h4); line-height: 1; margin-left: auto; padding: 0; }

/* ── AUTH FOOTER ───────────────────────────────────────────── */
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  /* 0.8125rem (13px) → prosa secundaria = --type-sm */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.auth-footer a { color: var(--color-navy); font-weight: 600; }
.auth-footer a:hover { color: var(--color-gold); }

/* ── AUTH ALERTS (password reset / form errors) ───────────── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  /* 0.8125rem (13px) → prosa secundaria = --type-sm */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  animation: slideDown 0.25s ease;
}

.auth-alert--error {
  background: rgba(229, 62, 62, 0.08);
  border: 1px solid rgba(229, 62, 62, 0.25);
  color: var(--color-error);
}

.auth-alert--success {
  background: rgba(56, 161, 105, 0.08);
  border: 1px solid rgba(56, 161, 105, 0.25);
  color: var(--brand-green-strong); /* a11y (C17): texto verde legible sobre fondo claro */
}

/* ── STEP INDICATOR ────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

/* 0.8rem (12.8px) → label = --type-sm en peso 400 (el 600 lo pone .step.active,
   así que la distinción activo/inactivo se conserva). */
.step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.step__num {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  /* 0.7rem (11.2px) → numeral en pill = --type-chip */
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.5;
}

.step.active .step__num { background: var(--color-navy); color: #fff; }
.step.active { color: var(--color-navy); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--color-border); }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (min-width: 900px) {
  .auth-page__brand { display: flex; }
  .auth-page__form-wrap { padding: 3rem; }
}

@media (max-width: 520px) {
  .auth-card { padding: 2rem 1.5rem; }
  .form-row { grid-template-columns: 1fr; }

  /* A5 — keep the 3 plans as a compact segmented row instead of 3 stacked cards
     (~700px) that pushed the form far below the fold. Tighter padding + type so
     they fit at 360–390px. Radios / form value / JS highlight are untouched. */
  .plan-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
  .plan-card { padding: 0.7rem 0.3rem; }
  /* Escalón móvil: SIEMPRE un paso por DEBAJO del desktop (md→ui, lg→md,
     xs→micro, chip→micro). Nunca puede quedar más grande que el escritorio. */
  .plan-name { font-size: var(--type-ui); line-height: 1.3; }
  .plan-price { font-size: var(--type-md); line-height: 1.4; }
  .plan-price small { font-size: var(--type-micro); }
  .plan-badge { font-size: var(--type-micro); padding: 0.1rem 0.35rem; top: -8px; }
}

/* QW8 (mobile) — anchor auth card higher (kill dead vertical space) +
   raise input/placeholder contrast against the white card. Additive only. */
@media (max-width: 768px) {
  .auth-page__form-wrap { justify-content: flex-start; padding-top: 2.25rem; }
  .form-input { border-color: #D1D5DB; }
  .form-input::placeholder { color: var(--color-text-muted); opacity: .85; }
}

/* ═══════════════════════════════════════════════════════════════
   RESEARCH MODULE — Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── EXTRA TOKENS ────────────────────────────────────────────── */
:root {
  --color-primary:       #0D1B3D;
  --color-primary-hover: #1A2B52;
  --color-accent:        #43B573;
  --color-accent-light:  #E8F5ED;
  --color-success:       #43B573;
  --color-warning:       #D97706;
  --color-danger:        #DC2626;
  --color-info:          #43B573;

  /* CTA Monetario (Regla Naranja) */
  --color-cta:            #E67E22;
  --color-cta-hover:      #D35400;   /* F0-fino LOTE8: unificado al hover de marca (era #F39C12; el research layout ya usaba #D35400). Único consumidor .btn-order-report está sin uso. */
  --color-cta-dark:       #D35400;
  --color-cta-shadow:     rgba(211, 84, 0, 0.3);

  /* Zonas de la Ficha de Propiedad */
  --color-zone-crm:       #F4F7FB;
  --color-zone-data:      #FFFFFF;
  --color-zone-visual:    transparent;

  /* CRM Tag States */
  --color-tag-target:     #43B573;
  --color-tag-diligence:  #D97706;  /* warning amber (revisión) — NO el naranja CTA #E67E22 */
  --color-tag-ready:      #3A9D64;
  --color-tag-dismissed:  #6B7280;
  --color-tag-won:        #3A9D64;
  --color-tag-lost:       #DC2626;

  /* Pines del Mapa diferenciados */
  --color-pin-default:    #0D1B3D;
  --color-pin-crm-saved:  #43B573;
  --color-pin-report-bought: #3A9D64;

  /* Overlay / Glassmorphism selectivo */
  --overlay-blur:         blur(12px) saturate(0.6);
  --overlay-bg:           rgba(0, 0, 0, 0.2);

  /* Transiciones estándar */
  --transition-fast:      150ms ease;
  --transition-normal:    300ms ease-in-out;
  --transition-drawer:    400ms cubic-bezier(0.16, 1, 0.3, 1);

  --rn-header-h:         66px; /* altura real renderizada de .app-header (padding 28 + contenido 36 + borde 1 ≈ 65; 66 deja 1px de holgura) */
  
  /* Inter only: estos alias apuntan al token de familia, no a una lista literal. */
  --font-money:   var(--font-sans);
  --font-numeric: var(--font-sans);
}

/* ── LAYOUT ──────────────────────────────────────────────────── */
.research-layout { display: flex; flex-direction: column; min-height: 100vh; background: var(--color-bg, #F8F9FA); }
.rn-main { flex: 1; overflow: auto; }

/* ── HEADER / NAV ────────────────────────────────────────────── */
.rn-header {
  height: var(--rn-header-h);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.rn-header__left { display: flex; align-items: center; gap: 2rem; }
.rn-header__right { display: flex; align-items: center; gap: 1rem; }

.rn-logo {
  /* 1.15rem (18.4px) → wordmark del header = --type-h4 (-0.02em era drift) */
  font-size: var(--type-h4);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.rn-logo span { color: #43B573; }

.rn-nav { display: flex; gap: 0.25rem; }
.rn-nav__link {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  /* 0.875rem (14px) → pestaña de navegación = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: all 0.15s;
}
.rn-nav__link:hover, .rn-nav__link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.rn-plan-badge {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  /* uppercase + tracking → patrón EYEBROW. 0.05em era drift → 0.1em */
  font-size: var(--type-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
}

.rn-user-menu { position: relative; }
.rn-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  color: #fff;
  font-family: var(--font);
  /* 0.875rem (14px) → botón = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  transition: background 0.15s;
}
.rn-user-btn:hover { background: rgba(255,255,255,.18); }

.rn-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #43B573;
  color: var(--color-primary);
  /* 0.75rem (12px) → iniciales en pill = --type-chip */
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rn-username { font-weight: 500; }

.rn-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  min-width: 180px;
  overflow: hidden;
  border: 1px solid var(--color-border, #E5E7EB);
}
.rn-dropdown.open { display: block; }
.rn-dropdown__item {
  display: block;
  padding: 0.65rem 1rem;
  /* 0.875rem (14px) → fila de menú = --type-md */
  font-size: var(--type-md);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.4;
  color: var(--color-text, #212529);
  text-decoration: none;
  transition: background 0.12s;
}
.rn-dropdown__item:hover { background: var(--color-accent-light); color: var(--color-primary); }
.rn-dropdown__item--danger { color: var(--color-danger) !important; }
.rn-dropdown__divider { height: 1px; background: var(--color-border, #E5E7EB); margin: 0.25rem 0; }

/* ── PAGE SHELL ─────────────────────────────────────────────── */
.rn-page { display: flex; height: calc(100vh - var(--rn-header-h)); overflow: hidden; }
.rn-sidebar {
  width: 260px;
  min-width: 220px;
  background: #fff;
  border-right: 1px solid var(--color-border, #E5E7EB);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}
/* ── PAGE COLUMN ─────────────────────────────────────────────────────────────
   Contenedor canónico de página. `flex:1` y `overflow-y:auto` del rule viejo se
   ELIMINAN porque eran inertes, no por gusto: <body> no lleva clase
   (research.html.erb) y .research-layout (:605 — el único display:flex candidato)
   NO se usa en ninguna vista. Sin ancestro flex ni altura acotada, `flex:1` no
   hacía nada y `overflow-y:auto` no creaba scroller (scrollea el documento). */
/* Arquetipo 1 — superficie de trabajo. Sin tope: el gutter es la constante. */
.rn-content {
  padding-inline: var(--rn-gutter);
  padding-block: var(--rn-page-pad-top) var(--rn-page-pad-bottom);
}

/* Arquetipo 2 — formulario enfocado. Columna centrada. */
.rn-content--form {
  max-width: var(--rn-form-max);
  margin-inline: auto;
}

/* Texto corrido dentro de una superficie de trabajo (no es un arquetipo de
   página: acota el renglón sin mover el borde de la página). */
.rn-prose { max-width: var(--rn-measure-prose); }

/* ── PAGE HEADER ─────────────────────────────────────────────────────────────
   Un solo set de valores. Antes cada vista de Rama 3 lo redeclaraba idéntico
   (settings/show.html.erb, purchased_reports/index.html.erb). Los 28px/800/-0.02em
   son los valores YA EN PRODUCCIÓN de esas dos vistas. */
.rn-page-header {
  display: flex;
  align-items: flex-start;      /* era center: el título es más alto que las acciones */
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 28px;          /* 1.75rem — valor de las 2 vistas */
}
.rn-page-header__text    { min-width: 0; }   /* OBLIGATORIO: sin este wrapper,
   space-between separa el h1 del subtítulo a extremos opuestos de la fila. */
.rn-page-header__actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
/* 28px/-0.02em eran drift → título de página = --type-h2 (25/700/-0.022em/1.2).
   NO necesita escalón móvil propio: 25px es el mismo valor que Rama 1 usa en
   .atlas__ptitle sin override, y ya baja 3px respecto del 28px anterior (que
   tampoco tenía media query). Solo la variante --bar escala en móvil. */
.rn-page-title {
  font-family: var(--font-sans);
  font-size: var(--type-h2);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: var(--ink-1);
  margin: 0 0 4px;
}
/* Variante para títulos dentro de una barra de comando densa (Pipeline) en vez de
   un bloque .rn-page-header. SOLO cambia el escalón de tamaño: familia, peso,
   tracking y color siguen siendo los canónicos.
   20px → --type-h4 (19px): es el token de "título de panel/modal" y además es
   1px MÁS CHICO que el valor anterior, así que no puede empujar el wrap de la
   toolbar (fila flex-wrap con grupo derecho en margin-left:auto). */
.rn-page-title--bar {
  font-size: var(--type-h4);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
}
@media (max-width: 768px) {
  /* 18px no estaba en la escala; el paso inmediato inferior a h4 es --type-lg. */
  .rn-page-title--bar { font-size: var(--type-lg); line-height: 1.2; }
}
.rn-page-subtitle {
  /* 13.5px era drift → prosa secundaria = --type-sm */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0;
}

/* ── VIEW TOGGLE ─────────────────────────────────────────────── */
.view-toggle {
  display: inline-flex;
  border: 1.5px solid var(--color-border, #E5E7EB);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle__btn {
  padding: 0.45rem 0.9rem;
  /* 0.8125rem (13px) → botón = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  cursor: pointer;
  border: none;
  background: #fff;
  color: var(--color-text-muted, #6B7280);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.view-toggle__btn.active {
  background: var(--color-primary);
  color: #fff;
}
.view-toggle__btn:hover:not(.active) { background: var(--color-accent-light); color: var(--color-primary); }

/* ── DATA TABLE ─────────────────────────────────────────────── */
.data-table-wrap {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--color-border, #E5E7EB);
  overflow: hidden;
}
/* 0.875rem (14px) → tabla = --type-md. NO se emite el font-weight 600 de la
   receta EN EL CONTENEDOR a propósito: heredaría a cada <td> y engrosaría toda
   la tabla (cambio de contenido, no de normalización). El 600 vive en el <th>. */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-md);
  letter-spacing: normal;
  line-height: 1.4;
}
.data-table th {
  background: #F1F3F4;
  padding: 0.75rem 1rem;
  text-align: left;
  /* 0.8125rem (13px) → encabezado de columna = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: var(--color-text, #212529);
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
  color: var(--color-text, #212529);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--color-accent-light); }
.data-table .cell-link {
  color: var(--brand-green-strong); /* a11y (C17): link verde legible (era 2.6:1) */
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.data-table .cell-link:hover { text-decoration: underline; }
.data-table-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted, #6B7280);
  /* 0.9375rem (15px) → prosa de estado vacío = --type-base */
  font-size: var(--type-base);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  /* 0.75rem (12px) → badge = --type-chip */
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-upcoming { background: #FFF3CD; color: #856404; }
.badge-active   { background: #D4EDDA; color: #155724; }
.badge-completed { background: #F1F3F4; color: #495057; }
.badge-success  { background: #D4EDDA; color: #155724; }
.badge-warning  { background: #FFF3CD; color: #856404; }
.badge-danger   { background: #F8D7DA; color: #721C24; }
.badge-info     { background: #D1ECF1; color: #0C5460; }
.badge-pending  { background: #FFF3CD; color: #856404; }
.badge-ordered  { background: #D1ECF1; color: #0C5460; }
.badge-generated { background: #D4EDDA; color: #155724; }
.badge-failed   { background: #F8D7DA; color: #721C24; }

/* ── FILTER SIDEBAR ─────────────────────────────────────────── */
.filter-sidebar { padding: 1rem; }
.filter-sidebar__title {
  /* uppercase + tracking → EYEBROW. 0.08em era drift → 0.1em */
  font-size: var(--type-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--color-text-muted, #6B7280);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.filter-group { margin-bottom: 1.1rem; }
.filter-label {
  display: block;
  /* 0.8rem (12.8px) → label = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: var(--color-text, #212529);
  margin-bottom: 0.35rem;
}
/* Controles nativos: tamaño + peso + tracking, SIN line-height (cambiaría la
   altura de la caja del control = layout). */
.filter-select, .filter-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1.5px solid var(--color-border, #E5E7EB);
  border-radius: 6px;
  font-family: var(--font);
  /* 0.8125rem (13px) → texto de control = --type-sm (peso 400: es texto que el
     usuario tipea, no un label) */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  color: var(--color-text, #212529);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.filter-select:focus, .filter-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,.08);
}
.filter-select:focus-visible, .filter-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-btn-apply {
  width: 100%;
  padding: 0.55rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  /* 0.875rem (14px) → botón = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}
.filter-btn-apply:hover { background: var(--color-primary-hover); }
.filter-btn-clear {
  width: 100%;
  padding: 0.45rem;
  background: transparent;
  color: var(--color-text-muted, #6B7280);
  border: 1px solid var(--color-border, #E5E7EB);
  border-radius: 6px;
  /* 0.8rem (12.8px) → botón = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  cursor: pointer;
  margin-top: 0.35rem;
  transition: all 0.15s;
}
.filter-btn-clear:hover { color: var(--color-danger); border-color: var(--color-danger); }

/* ── BUTTONS ─────────────────────────────────────────────────── */
/* .btn-sm system — canonical block lives ~300 lines below (search ".btn-sm {").
   F4/LOTE8 dedup: this earlier duplicate was FULLY overridden by that later block
   (superset, wins by source order), so it was dead code and has been removed.
   `.btn-sm-danger` was relocated to the canonical block. */

/* ── MAP CONTAINER ───────────────────────────────────────────── */
.map-container {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border, #E5E7EB);
}

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(-12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal--wide { max-width: 950px; }
.modal__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}
/* 1.1rem (17.6px) → título de modal = --type-h4; subtítulo = prosa 2ª (--type-sm) */
.modal__title { font-size: var(--type-h4); font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; color: var(--color-primary); margin: 0; }
.modal__subtitle { font-size: var(--type-sm); font-weight: 400; letter-spacing: normal; line-height: 1.5; color: var(--color-text-muted, #6B7280); margin: 0.2rem 0 0; }
.modal__close {
  background: none;
  border: none;
  /* Glifo "×": solo el tamaño se tokeniza (1.4rem = 22.4px → --type-h3) */
  font-size: var(--type-h3);
  color: var(--color-text-muted, #6B7280);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.modal__close:hover { color: var(--color-danger); }
.modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border, #E5E7EB);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ── ACCORDION ───────────────────────────────────────────────── */
.accordion { border: 1px solid var(--color-border, #E5E7EB); border-radius: 8px; overflow: hidden; margin-bottom: 0.75rem; }
.accordion__trigger {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--color-bg, #F8F9FA);
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--font);
  /* .accordion__trigger está declarado DOS veces (acá y ~:1330). Receta ÚNICA:
     título clickeable de panel = --type-base con énfasis. */
  font-size: var(--type-base);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.5;
  color: var(--color-primary);
  text-align: left;
  transition: background 0.15s;
}
.accordion__trigger:hover { background: var(--color-accent-light); }
/* Chevron: glifo, solo tamaño. También duplicado ~:1345 con la MISMA receta. */
.accordion__icon { transition: transform 0.2s ease; font-size: var(--type-sm); }
.accordion.is-open .accordion__icon { transform: rotate(180deg); }
.accordion__body {
  display: none;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border, #E5E7EB);
}
.accordion.is-open .accordion__body { display: block; }

/* ── DETAIL GRID ─────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}
/* .detail-item__label / __value están declarados DOS veces (acá y ~:1310).
   Receta ÚNICA: label = EYEBROW (0.06em y 0.05em eran drift → 0.1em);
   value = valor en tarjeta = --type-lg. */
.detail-item__label {
  font-size: var(--type-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  color: var(--color-text-muted, #6B7280);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.detail-item__value {
  font-size: var(--type-lg);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
  color: var(--color-text, #212529);
}

/* ── PROGRESS BARS ───────────────────────────────────────────── */
.progress-bar-wrap { margin-bottom: 1.25rem; }
.progress-bar-label {
  display: flex;
  justify-content: space-between;
  /* 0.8125rem (13px) → fila label+valor = --type-sm en 400 (los <span> hijos
     ponen su propio peso; forzar 600 acá engrosaría el valor de la derecha). */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  margin-bottom: 0.35rem;
}
.progress-bar-label span:first-child { font-weight: 500; color: var(--color-text, #212529); }
.progress-bar-label span:last-child { color: var(--color-text-muted, #6B7280); }
.progress-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--color-border, #E5E7EB);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.progress-bar-fill.green  { background: var(--color-success); }
.progress-bar-fill.yellow { background: var(--color-warning); }
.progress-bar-fill.red    { background: var(--color-danger); }

/* ── TABS ────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border, #E5E7EB);
  margin-bottom: 1.5rem;
}
.tab-nav__btn {
  padding: 0.75rem 1.25rem;
  /* 0.875rem (14px) → PESTAÑA = --type-ui. La activa se distingue por color +
     borde inferior (igual que .rail-tab en Rama 1), no por peso. */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: var(--color-text-muted, #6B7280);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  font-family: var(--font);
}
.tab-nav__btn:hover { color: var(--color-primary); }
.tab-nav__btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* QW3/A3 (mobile) — tab bar scrolls horizontally with a peek instead of
   clipping the last tab ("Payment" in Settings, report tabs in Report Center). */
@media (max-width: 768px) {
  .tab-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab-nav__btn { flex: 0 0 auto; white-space: nowrap; padding-inline: 1rem; }
}

/* ── PAGINATION ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--color-border, #E5E7EB);
  /* 0.8125rem (13px) → prosa secundaria = --type-sm */
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--color-text-muted, #6B7280);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.pagination__btns { display: flex; gap: 0.4rem; }
.pagination__btn {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--color-border, #E5E7EB);
  background: #fff;
  /* 0.8125rem (13px) → botón = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  cursor: pointer;
  color: var(--color-text, #212529);
  transition: all 0.12s;
}
.pagination__btn:hover { background: var(--color-accent-light); border-color: var(--color-accent); }
.pagination__btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination__btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── STAT CARDS ──────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--color-border, #E5E7EB);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
/* label = EYEBROW (0.06em era drift → 0.1em) · value = numeral de panel (--type-h3)
   · sub = prosa secundaria (--type-sm) */
.stat-card__label { font-size: var(--type-eyebrow); font-weight: 700; letter-spacing: 0.1em; line-height: 1.5; color: var(--color-text-muted, #6B7280); text-transform: uppercase; margin-bottom: 0.35rem; }
.stat-card__value { font-size: var(--type-h3); font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: var(--color-primary); }
.stat-card__sub   { font-size: var(--type-sm); font-weight: 400; letter-spacing: normal; line-height: 1.5; color: var(--color-text-muted, #6B7280); margin-top: 0.2rem; }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}
/* El icono NO es texto: es un glifo decorativo, queda fuera de la escala
   tipográfica (3rem → 48px literal: mismo píxel, sin el rem paralelo de 16px). */
.empty-state__icon { font-size: 48px; line-height: 1; margin-bottom: 1rem; }
.empty-state__title { font-size: var(--type-lg); font-weight: 700; letter-spacing: normal; line-height: 1.2; color: var(--color-primary); margin-bottom: 0.5rem; }
.empty-state__desc { font-size: var(--type-base); font-weight: 400; letter-spacing: normal; line-height: 1.5; color: var(--color-text-muted, #6B7280); max-width: 360px; margin-bottom: 1.5rem; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .rn-sidebar { display: none; }
  .rn-nav { display: none; }
  .rn-username { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 3 — Parcels Module additions
   ═══════════════════════════════════════════════════════════════ */

/* ── DETAIL GRID (inside parcel modal) ───────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.detail-item {
  background: #F8F9FA;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
/* DUPLICADO de ~:1155 — consolidado en la MISMA receta (label = EYEBROW,
   value = --type-lg). 0.05em era drift → 0.1em. */
.detail-item__label {
  font-size: var(--type-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  color: var(--color-text-muted, #6B7280);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.detail-item__value {
  font-size: var(--type-lg);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
  color: var(--color-primary);
}

/* ── ACCORDION ───────────────────────────────────────────────── */
.accordion + .accordion { border-top: 1px solid var(--color-border, #E5E7EB); }
.accordion__trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  background: none;
  border: none;
  font-family: var(--font);
  /* DUPLICADO de ~:1130 — MISMA receta (--type-base con énfasis). */
  font-size: var(--type-base);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.5;
  color: var(--color-primary);
  cursor: pointer;
  text-align: left;
}
.accordion__trigger:hover { color: var(--color-accent); }
.accordion__icon {
  /* DUPLICADO de ~:1147 — glifo, mismo tamaño */
  font-size: var(--type-sm);
  transition: transform 0.2s;
}
.accordion .accordion__body {
  display: none;
  padding-bottom: 1rem;
}
.accordion.is-open .accordion__body { display: block; }
.accordion.is-open .accordion__icon { transform: rotate(180deg); }

/* ── BTN-SM variants ─────────────────────────────────────────── */
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  /* 0.8125rem (13px) → botón = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  font-family: var(--font);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-sm-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-sm-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.btn-sm-outline {
  background: #fff;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-sm-outline:hover { background: var(--color-accent-light); color: var(--color-accent); border-color: var(--color-accent); }
.btn-sm-success {
  background: var(--brand-green-strong); /* a11y (C17): 5.23:1 con texto blanco */
  color: #fff;
  border-color: var(--brand-green-strong);
}
.btn-sm-success:hover { background: #218838; border-color: #218838; color: #fff; }
.btn-sm-danger { background: var(--color-danger); color: #fff; }
/* Canonical CTA (Regla Naranja) — var, NUNCA el literal #E67E22. Base para shared/_button (variant: cta). */
.btn-sm-cta { background: var(--color-cta); color: #fff; }
.btn-sm-cta:hover { background: var(--color-cta-dark); }

/* ── MODAL wide variant ──────────────────────────────────────── */
.modal--wide { max-width: 860px; }

/* ── AUCTION VISIBLE SCOPE (stub) ────────────────────────────── */
/* Auction.visible is defined in the model; no UI-only CSS needed */

/* ── STAT-ROW (row of stat cards) ────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════
   SPRINT 4+5 — Reports & Settings additions
   ═══════════════════════════════════════════════════════════════ */

/* ── SETTINGS CARD ───────────────────────────────────────────── */
.settings-card {
  background: #fff;
  border: 1px solid var(--color-border, #E5E7EB);
  border-radius: 12px;
  overflow: hidden;
}
.settings-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
  background: #FAFAFA;
}
.settings-card__title {
  /* 0.9375rem (15px) → título de tarjeta = --type-lg */
  font-size: var(--type-lg);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
  color: var(--color-primary);
  margin: 0;
}
.settings-card__body {
  padding: 1.25rem;
}
.settings-card__footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--color-border, #E5E7EB);
  background: #FAFAFA;
}

/* ── USAGE METERS ────────────────────────────────────────────── */
.usage-meter { margin-bottom: 1rem; }
.usage-meter:last-child { margin-bottom: 0; }
.usage-meter__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}
.usage-meter__label {
  /* 0.875rem (14px) → label = --type-ui */
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: var(--color-text, #212529);
}
.usage-meter__count {
  /* 0.85rem (13.6px) → valor de fila = --type-md */
  font-size: var(--type-md);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.4;
}
.usage-meter__bar {
  height: 8px;
  background: #E9ECEF;
  border-radius: 99px;
  overflow: hidden;
}
.usage-meter__fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ── PLAN SUMMARY GRID ──────────────────────────────────────── */
.plan-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}
.plan-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.plan-summary-item__label {
  /* EYEBROW (0.05em era drift → 0.1em) */
  font-size: var(--type-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  color: var(--color-text-muted, #6B7280);
  text-transform: uppercase;
}
.plan-summary-item__value {
  /* 1rem (16px) → valor en tarjeta = --type-lg */
  font-size: var(--type-lg);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
  color: var(--color-primary);
}

/* ── REPORT TYPE BADGES ──────────────────────────────────────── */
/* .report-type-badge está declarado DOS veces (acá y ~:1600). Receta ÚNICA:
   badge = --type-chip; 0.03em / 0.02em eran drift → 0.1em (la 2ª es uppercase). */
.report-type-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.5;
}
.report-type-avm            { background: #DBEAFE; color: #1E40AF; }
.report-type-property_scope { background: #EDF1EE; color: #3B5C4F; }
.report-type-title_search   { background: #FEF3C7; color: #92400E; }

/* ── REPORT STATUS BADGES ────────────────────────────────────── */
.badge-report-pending   { background: #FEF3C7; color: #92400E; }
.badge-report-ordered   { background: #DBEAFE; color: #1E40AF; }
.badge-report-generated { background: #D1FAE5; color: #064E3B; }
.badge-report-failed    { background: #FEE2E2; color: #991B1B; }

/* ── FLASH MESSAGES ────────────────────────────────────────────
   2ª declaración de .flash (dup de ~:510). MISMA receta que aquella y que la
   3ª, que vive en layouts/research.html.erb. */
.flash {
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  font-size: var(--type-base);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
}
.flash-success { background: #D1FAE5; color: #064E3B; border: 1px solid #A7F3D0; }
.flash-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.flash-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

/* ── BADGE COUNT (tab indicators) ────────────────────────────── */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--color-primary);
  color: #fff;
  /* .badge-count está declarado DOS veces (acá y ~:1625). Receta ÚNICA:
     count pill = --type-chip. */
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.5;
  margin-left: 0.35rem;
}
.tab-nav__btn.active .badge-count { background: var(--color-accent); }

/* ── CARD DISPLAY (payment method) ──────────────────────────── */
.card-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #F8F9FA;
  border-radius: 10px;
  border: 1px solid var(--color-border, #E5E7EB);
}
/* Glifo decorativo (no texto) → fuera de la escala: 2rem = 32px literal. */
.card-display__icon { font-size: 32px; line-height: 1; }
.card-display__info { flex: 1; }
.card-display__brand { font-weight: 700; color: var(--color-primary); }

.badge-upcoming  { background: #E8F5ED; color: #1A5276; }
.badge-active    { background: #D1FAE5; color: #064E3B; }
.badge-completed { background: #F3F4F6; color: #374151; }
.badge-canceled  { background: #FEE2E2; color: #991B1B; }
.badge-inactive  { background: #F3F4F6; color: #6B7280; }
.badge-past_due  { background: #FEF3C7; color: #92400E; }
.badge-trial     { background: #EDF1EE; color: #3B5C4F; }

/* ═══════════════════════════════════════════════════════════════
   REPORTS MODULE
   ═══════════════════════════════════════════════════════════════ */

/* ── Report Status Badges ────────────────────────────────────── */
.badge-report-pending   { background: #FEF3C7; color: #92400E; }
.badge-report-ordered   { background: #DBEAFE; color: #1E40AF; }
.badge-report-generated { background: #D1FAE5; color: #065F46; }
.badge-report-failed    { background: #FEE2E2; color: #991B1B; }

/* ── Report Type Badges ──────────────────────────────────────── */
/* DUPLICADO de ~:1495 — MISMA receta (--type-chip / 600 / 0.1em / 1.5). */
.report-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.5;
  white-space: nowrap;
  text-transform: uppercase;
}
.report-type-avm            { background: #E8F5ED; color: #1A5276; }
.report-type-property_scope { background: #EDF1EE; color: #3B5C4F; }
.report-type-title_search   { background: #FEF3C7; color: #92400E; }

/* ── Prior Sale Badges ───────────────────────────────────────── */
.badge-sold   { background: #D1FAE5; color: #065F46; }
.badge-unsold { background: #FEE2E2; color: #991B1B; }

/* ── Tab badge count ─────────────────────────────────────────── */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 12px;
  /* DUPLICADO de ~:1535 — MISMA receta (--type-chip / 600 / normal / 1.5). */
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.5;
  margin-left: 0.3rem;
}
.tab-nav__btn.active .badge-count {
  background: #fff;
  color: var(--color-primary);
}

/* ── Credit Summary Bar ──────────────────────────────────────── */
.credit-summary-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: #fff;
  border: 1px solid var(--color-border, #E5E7EB);
  border-radius: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.credit-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* 0.8125rem (13px) → fila = --type-md */
  font-size: var(--type-md);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.4;
}
.credit-label {
  font-weight: 700;
  color: var(--color-primary);
  min-width: 38px;
}
.credit-track {
  width: 80px;
  height: 6px;
  background: #E9ECEF;
  border-radius: 3px;
  overflow: hidden;
}
.credit-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.credit-fill--avm   { background: #1A5276; }
.credit-fill--scope { background: #3B5C4F; }
.credit-fill--title { background: #92400E; }
/* 0.75rem (12px) → prosa secundaria = --type-sm */
.credit-count {
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--color-text-muted);
  min-width: 60px;
}
.credit-reset {
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-left: auto;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .credit-reset { margin-left: 0; width: 100%; }
}

/* ── Error Modal (usado desde JS, reemplaza alert()) ─────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.modal-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 480px;
  animation: modalIn 0.18s ease;
}
.modal-box--sm { max-width: 380px; }
.modal-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.modal-box__body  { padding: 1rem 1.25rem; }
.modal-box__footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--color-border, #E5E7EB);
  display: flex;
  justify-content: flex-end;
}
.modal-close {
  background: none;
  border: none;
  /* Glifo "×": solo el tamaño (1.3rem = 20.8px → --type-h3) */
  font-size: var(--type-h3);
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--color-danger); }

/* =============================================================
   MASTER DESIGN PLAN UI CLASSES
   ============================================================= */

/* ── PROPERTY DETAIL OVERLAY (Floating Card) ────────────────── */
.property-detail-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: min(90vw, 1200px);
  height: 90vh;
  z-index: 1000;
  background: var(--color-surface, #fff);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25),
              0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 300ms ease,
              visibility 300ms ease;
  overflow: hidden;
}

.property-detail-overlay.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.map-backdrop-blur {
  position: fixed;
  inset: 0;
  backdrop-filter: var(--overlay-blur, blur(12px) saturate(0.6));
  background: var(--overlay-bg, rgba(0, 0, 0, 0.35));
  z-index: 999;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1),
              visibility 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.map-backdrop-blur.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}



/* ── MONEY TYPOGRAPHY ──────────────────────────────────────── */
/* 2rem/2.25rem/1.5rem → numeral grande = --type-display, con su escalón --type-h3.
   ⚠️ CANDIDATO A BORRADO (no eliminado en esta pasada): referencia
   `--color-text-primary`, un token que NO existe en ningún :root de la app, lo
   que sugiere que el bloque quedó huérfano del prototipo Master Design Plan. */
.money-value {
  font-family: var(--font-money);
  font-size: var(--type-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-text-primary);
}
.property-opening-bid .money-value { font-size: var(--type-display); }
.property-assessed-value .money-value { font-size: var(--type-h3); letter-spacing: -0.02em; }



/* ── FILTER MATCH COUNT ────────────────────────────────────── */
.filter-match-count {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-numeric);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  transition: color 200ms;
}
.filter-match-count--updated { animation: count-pulse 400ms ease; }
@keyframes count-pulse {
  0%   { color: var(--color-accent); transform: scale(1); }
  50%  { color: var(--color-warning); transform: scale(1.1); }
  100% { color: var(--color-accent); transform: scale(1); }
}

/* ── CTA DE REPORTE (REGLA NARANJA) ────────────────────────── */
.btn-order-report {
  background: linear-gradient(135deg, var(--color-cta), var(--color-cta-dark));
  color: #FFFFFF;
  font-family: var(--font);
  /* 15px → --type-lg; 0.02em era drift en un botón NO uppercase → normal */
  font-size: var(--type-lg);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.2;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--color-cta-shadow);
  transition: all 200ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-order-report:hover {
  background: linear-gradient(135deg, var(--color-cta-hover), var(--color-cta));
  box-shadow: 0 6px 20px rgba(211, 84, 0, 0.4);
  transform: translateY(-1px);
}
.btn-order-report--ordered {
  background: transparent;
  color: var(--color-info);
  border: 1px solid var(--color-info);
  box-shadow: none;
}
.btn-order-report--generated {
  background: var(--color-success);
  box-shadow: 0 4px 14px rgba(40, 167, 69, 0.3);
}

/* ── MINI CRM CHIPS ────────────────────────────────────────── */
.crm-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  border: 1.5px solid transparent;
}
.crm-tag-chip--inactive {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  opacity: 0.6;
}
.crm-tag-chip--target {
  background: rgba(46, 134, 193, 0.15);
  color: var(--color-tag-target);
  border-color: var(--color-tag-target);
  opacity: 1;
}
.crm-tag-chip--due-diligence {
  background: rgba(243, 156, 18, 0.15);
  color: var(--color-tag-diligence);
  border-color: var(--color-tag-diligence);
  opacity: 1;
}
.crm-tag-chip--ready-to-bid {
  background: rgba(39, 174, 96, 0.15);
  color: var(--color-tag-ready);
  border-color: var(--color-tag-ready);
  opacity: 1;
}
.crm-tag-chip--dismissed {
  background: rgba(108, 117, 125, 0.15);
  color: var(--color-tag-dismissed);
  border-color: var(--color-tag-dismissed);
  opacity: 1;
}
.crm-tag-chip--won {
  background: rgba(30, 132, 73, 0.15);
  color: var(--color-tag-won);
  border-color: var(--color-tag-won);
  opacity: 1;
}
.crm-tag-chip--lost {
  background: rgba(146, 43, 33, 0.15);
  color: var(--color-tag-lost);
  border-color: var(--color-tag-lost);
  opacity: 1;
}

/* ── ANIMACIONES MAP PINS Y CRM ────────────────────────────── */
.map-pin--selected { animation: pin-anchor-pulse 600ms ease-out; }
@keyframes pin-anchor-pulse {
  0%   { transform: scale(1);   filter: brightness(1); }
  40%  { transform: scale(1.6); filter: brightness(1.5); }
  100% { transform: scale(1.2); filter: brightness(1.2); }
}

.map-pin--refocus { animation: pin-refocus 400ms ease-out; }
@keyframes pin-refocus {
  0%   { transform: scale(1.4); filter: brightness(1.6); }
  100% { transform: scale(1);   filter: brightness(1); }
}

.save-to-crm-icon { cursor: pointer; transition: transform 150ms ease; }
.save-to-crm-icon:hover { transform: scale(1.15); }
.save-to-crm-icon--flying { animation: fly-to-crm 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes fly-to-crm {
  0%   { opacity: 1; transform: scale(1) translate(0, 0); }
  60%  { opacity: 0.8; transform: scale(0.5) translate(-60px, -40px); }
  100% { opacity: 0; transform: scale(0.3) translate(-120px, -80px); }
}

/* ── CRM STAGE SELECTOR (replaces tag chips) ─────────────────── */
.crm-stage-selector {
  position: relative;
  margin-bottom: 14px;
}
/* Shorthand `font:` ELIMINADO: reseteaba letter-spacing y line-height en silencio
   (la causa raíz del drift). Microlabel uppercase → EYEBROW; 0.06em → 0.1em. */
.crm-stage-label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--type-eyebrow);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.5;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.crm-stage-current {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface-1);
  cursor: pointer;
  /* shorthand `font:` eliminado → 13px = --type-md */
  font-family: var(--font-sans);
  font-size: var(--type-md);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.4;
  color: var(--ink-1);
  transition: all 200ms;
}
.crm-stage-current:hover { border-color: var(--accent); }
.crm-stage-current.loading { opacity: 0.6; pointer-events: none; }
.crm-stage-name { flex: 1; text-align: left; }
.crm-stage-badge {
  /* shorthand `font:` eliminado → badge = --type-chip */
  font-family: var(--font-sans);
  font-size: var(--type-chip);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.5;
  color: var(--success);
  background: var(--success-soft);
  padding: 2px 7px;
  border-radius: 6px;
}
.crm-stage-chevron {
  color: var(--ink-3);
  font-size: 12px;
  transition: transform 200ms;
}

/* Dropdown */
.crm-stage-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.12);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  animation: crmDropIn 150ms ease;
}
@keyframes crmDropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.crm-stage-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: 7px;
  cursor: pointer;
  /* shorthand `font:` eliminado → fila de menú = --type-md
     (el 700 de .crm-stage-option.active sigue distinguiendo la opción activa) */
  font-family: var(--font-sans);
  font-size: var(--type-md);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.4;
  color: var(--ink-1);
  transition: background 150ms;
  text-align: left;
}
.crm-stage-option:hover { background: var(--accent-soft, #E8F5ED); }
.crm-stage-option.active {
  background: var(--accent-soft, #E8F5ED);
  font-weight: 700;
}
.crm-stage-check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}
.crm-stage-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}
.crm-stage-option--create {
  color: var(--accent);
  font-weight: 600;
}

/* Color por stage (2026-07-01): el pill activo y cada opción muestran el color del
   stage (PipelineStage#color) como spine izquierdo. La var llega en runtime desde BD
   (style inline en el partial) → sin hex literal en el source. Scoped al CRM de la
   Ficha. Fallback: sin color → borde neutro / transparente. */
#ficha-crm .crm-stage-current { border-left: 4px solid var(--stage-color, var(--border)); }
#ficha-crm .crm-stage-option { border-left: 3px solid var(--stage-color, transparent); border-radius: 0 7px 7px 0; }
#ficha-crm .crm-stage-option--create { border-left-color: transparent; }

/* Inline Create Stage */
.crm-create-stage-inline {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  margin-top: 8px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
  animation: crmDropIn 150ms ease;
}
.crm-create-stage-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  /* shorthand `font:` eliminado. Control nativo → tamaño + peso + tracking,
     SIN line-height (cambiaría la altura de la caja). 13px → --type-sm/400. */
  font-family: var(--font-sans);
  font-size: var(--type-sm);
  font-weight: 400;
  letter-spacing: normal;
  color: var(--ink-1);
  background: var(--surface-1);
  outline: none;
}
.crm-create-stage-input:focus { border-color: var(--accent); }
.crm-create-stage-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.crm-create-stage-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}
.crm-create-stage-btn {
  flex: 1;
  padding: 7px 12px;
  background: var(--brand-green-strong); /* a11y (C17): texto blanco sobre verde AA */
  color: #fff;
  border: none;
  border-radius: 6px;
  /* shorthand `font:` eliminado → botón = --type-ui */
  font-family: var(--font-sans);
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  cursor: pointer;
  transition: background 150ms;
}
.crm-create-stage-btn:hover { filter: brightness(0.92); }
.crm-create-stage-cancel {
  padding: 7px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  /* shorthand `font:` eliminado → botón = --type-ui */
  font-family: var(--font-sans);
  font-size: var(--type-ui);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.3;
  color: var(--ink-2);
  cursor: pointer;
}
.crm-create-stage-cancel:hover { background: var(--surface-2); }

/* Notes lock hint */
.crm-notes-lock-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  margin-top: 6px;
  background: #FEF9E7;
  border: 1px solid #F9E79F;
  border-radius: 6px;
  /* shorthand `font:` eliminado → caption/hint = --type-xs */
  font-family: var(--font-sans);
  font-size: var(--type-xs);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
  color: #B7950B;
}
.crm-save-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* =============================================================
   RAMA 1: AUCTIONS MODULE — Component Styles
   Migrated from approved prototype: rama1-auctions-test.html
   ============================================================= */

/* ─── Rama 1 Design Tokens (supplement production tokens) ────────────── */
:root {
  --r1-color-primary:       #0D1B3D;
  --r1-color-primary-hover: #2A4F82;
  --r1-color-accent:        #43B573;
  --r1-color-accent-light:  #E8F5ED;
  --r1-color-text-primary:  #212529;
  --r1-color-text-secondary:#6B7280;
  --r1-color-text-muted:    #ADB5BD;
  --r1-color-danger:        #DC3545;
  /* Inter only: última lista de familias LITERAL de la app (llevaba
     -apple-system / BlinkMacSystemFont / 'Segoe UI') → token de familia.
     Con Inter precargada el render es idéntico. */
  --r1-font-ui:             var(--font-sans);
  --r1-font-money:          var(--font-sans);
  --r1-font-numeric:        var(--font-sans);
  /* rem → token. Conversión EXACTA, cero delta visual:
     0.75rem = 12px = --type-sm · 0.875rem = 14px = --type-base */
  --r1-text-xs:             var(--type-sm);
  --r1-text-sm:             var(--type-base);
  --r1-transition-fast:     150ms ease;
  --r1-transition-normal:   300ms ease-in-out;
  --r1-radius-sm:           4px;
  --r1-radius-md:           6px;
  --r1-radius-lg:           8px;
}

/* ─── SUB-NAVIGATION TABS ─────────────────────────────────────────────── */
.r1-sub-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  padding: 0 24px;
  background: var(--color-surface);
}
.r1-sub-tab {
  padding: 12px 22px;
  font-weight: 600;
  color: var(--r1-color-text-secondary);
  font-size: var(--r1-text-sm);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  transition: all var(--r1-transition-fast);
}
.r1-sub-tab:hover { color: var(--r1-color-primary); }
.r1-sub-tab.active {
  color: var(--r1-color-primary);
  border-bottom-color: var(--r1-color-primary);
  font-weight: 700;
}

/* ─── FILTER BAR ──────────────────────────────────────────────────────── */
.r1-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.r1-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.r1-filter-spacer { flex: 1; }

.r1-filter-select {
  appearance: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--r1-color-text-secondary);
  font-family: var(--r1-font-ui);
  font-size: var(--r1-text-xs);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r1-radius-md);
  cursor: pointer;
  height: 32px;
  transition: all var(--r1-transition-fast);
}
.r1-filter-select:hover { background: #f8f9fa; }
.r1-filter-select.has-value { background: #e8f4fd; border-color: var(--r1-color-accent); color: var(--brand-green-strong); font-weight: 600; } /* a11y (C17): texto 4.68:1 sobre #e8f4fd; el border decorativo mantiene el verde de marca */

.r1-filter-date-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.r1-filter-date {
  appearance: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--r1-color-text-secondary);
  font-family: var(--r1-font-ui);
  font-size: var(--r1-text-xs);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r1-radius-md);
  cursor: pointer;
  height: 32px;
  width: 135px;
}
.r1-filter-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--r1-color-text-muted);
  cursor: pointer;
  padding: 0 4px;
  font-size: 10px;
}
.r1-filter-clear:hover { color: var(--r1-color-danger); }

/* ─── VIEW TOGGLE BUTTONS ─────────────────────────────────────────────── */
.r1-view-btn-group {
  display: flex;
  gap: 2px;
  background: #f8f9fa;
  border-radius: var(--r1-radius-md);
  padding: 2px;
  position: relative;
}
.r1-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--r1-radius-sm);
  cursor: pointer;
  color: var(--r1-color-text-secondary);
  transition: all var(--r1-transition-fast);
}
.r1-view-btn:hover { background: #e9ecef; }
.r1-view-btn.active { background: var(--r1-color-primary); color: #fff; }

/* ─── VIEW PANELS ─────────────────────────────────────────────────────── */
.r1-main-content { padding: 16px 24px; }
.r1-view-panel { display: none; animation: r1FadeIn 0.3s ease; }
.r1-view-panel.active { display: block; }
@keyframes r1FadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── CHOROPLETH MAP ──────────────────────────────────────────────────── */
.r1-map-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-lg);
  padding: 24px;
}
.r1-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.r1-map-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--r1-color-text-primary);
}
.r1-map-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--r1-color-text-secondary);
}
.r1-legend-item { display: flex; align-items: center; gap: 5px; }
.r1-legend-dot { width: 10px; height: 10px; border-radius: 3px; }

.r1-map-svg-wrap {
  display: flex;
  justify-content: center;
  background: #1B2A3D;
  border-radius: 6px;
  padding: 16px 8px;
}

/* SVG state paths */
.r1-state-path {
  stroke: #2C3E54;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.2s ease, filter 0.2s ease;
}
.r1-state-path:hover { filter: brightness(0.85); stroke-width: 1.5; }
.r1-state-path.no-auction    { fill: #FFFFFF; }
.r1-state-path.has-auction   { fill: #43B573; }

/* Florida: dark border to distinguish from background */
.r1-state-path[data-state="FL"] {
  stroke: #1A252F;
  stroke-width: 2;
}



/* State popup tooltip */
.r1-state-popup {
  position: fixed;
  background: var(--r1-color-primary);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r1-radius-lg);
  font-size: var(--r1-text-xs);
  z-index: 999;
  display: none;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 220px;
  max-width: 320px;
}
.r1-state-popup h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.r1-popup-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.8);
}
.r1-popup-row strong { text-align: right; }
.r1-popup-divider {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 8px 0;
}
.r1-popup-venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.r1-popup-venue-badge.online { background: rgba(3,105,161,0.3); color: #7DD3FC; }
.r1-popup-venue-badge.in-person { background: rgba(126,34,206,0.3); color: #D8B4FE; }
.r1-popup-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.r1-popup-county-list {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  margin-bottom: 6px;
}
.r1-popup-county-list span {
  display: inline-block;
  background: rgba(126,34,206,0.25);
  color: #D8B4FE;
  padding: 1px 6px;
  border-radius: 3px;
  margin: 1px 2px;
  font-size: 10px;
  font-weight: 500;
}
.r1-popup-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #7DD3FC;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 4px;
}
.r1-popup-link:hover { color: #BAE6FD; text-decoration: underline; }
.r1-popup-cta {
  margin-top: 10px;
  display: block;
  text-align: center;
  padding: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r1-radius-md);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  pointer-events: auto;
}
.r1-popup-cta:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* ─── SUMMARY STATS ROW ──────────────────────────────────────────────── */
.r1-stats-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.r1-stat-card {
  flex: 1;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 18px;
}
.r1-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--r1-color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.r1-stat-value {
  font-size: 28px;
  font-family: var(--r1-font-money);
  color: var(--r1-color-primary);
}
.r1-stat-sub {
  font-size: 10px;
  color: var(--r1-color-text-secondary);
  margin-top: 3px;
  opacity: 0.75;
}
/* Primary stat card — hero metric (Próximas propiedades a subastar) */
.r1-stat-card--primary {
  background: linear-gradient(135deg, #0D1B3D 0%, #2A4F82 100%);
  border-color: transparent;
  flex: 1.4;
}
.r1-stat-card--primary .r1-stat-label {
  color: rgba(255,255,255,0.7);
}
.r1-stat-card--primary .r1-stat-value {
  color: #fff;
  font-size: 32px;
  font-weight: 800;
}
.r1-stat-card--primary .r1-stat-sub {
  color: rgba(255,255,255,0.55);
}
.r1-table-count-sub {
  font-size: 11px;
  color: var(--r1-color-text-secondary);
  margin-left: 4px;
  font-style: italic;
  opacity: 0.7;
}

/* ─── CALENDAR VIEW ───────────────────────────────────────────────────── */
.r1-calendar-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-lg);
  padding: 20px;
}
.r1-calendar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.r1-cal-nav-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--r1-color-text-secondary);
}
.r1-cal-nav-btn:hover { background: #f8f9fa; }
.r1-cal-today-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  padding: 4px 14px;
  font-size: var(--r1-text-xs);
  font-weight: 600;
  border-radius: var(--r1-radius-sm);
  cursor: pointer;
  color: var(--r1-color-text-primary);
}
.r1-cal-today-btn:hover { background: #f8f9fa; }
.r1-cal-month-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--r1-color-text-primary);
  margin-right: auto;
}
.r1-cal-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--r1-color-text-secondary);
  margin-right: 12px;
}
.r1-cal-legend-item { display: flex; align-items: center; gap: 4px; }
.r1-cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.r1-cal-view-toggle { display: flex; gap: 2px; }
.r1-cal-view-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r1-radius-sm);
  cursor: pointer;
  color: var(--r1-color-text-secondary);
}
.r1-cal-view-btn.active { background: var(--r1-color-primary); color: #fff; }

.r1-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-md);
  overflow: hidden;
}
.r1-cal-day-header {
  background: #f8f9fa;
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--r1-color-text-secondary);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.r1-cal-cell {
  position: relative;
  min-height: 100px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: default;
  background: #fff;
}
.r1-cal-cell:nth-child(7n) { border-right: none; }
.r1-cal-cell.other-month { background: #fafafa; }
.r1-cal-cell.other-month .r1-cal-day-num { color: var(--r1-color-text-muted); }
.r1-cal-cell.today { background: #eff6ff; }
.r1-cal-cell.today .r1-cal-day-num {
  background: var(--r1-color-accent);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.r1-cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--r1-color-text-primary);
  margin-bottom: 4px;
}
.r1-cal-event {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.r1-cal-event:hover { filter: brightness(0.9); }
.r1-cal-event.type-deed { background: #D1FAE5; color: #15803D; }
.r1-cal-event-more {
  font-size: 9px;
  color: var(--r1-color-text-muted);
  font-weight: 600;
  padding: 2px 5px;
}

/* ─── DATA TABLE ──────────────────────────────────────────────────────── */
.r1-table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-lg);
  overflow: hidden;
}
.r1-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
}
.r1-table-count {
  font-size: var(--r1-text-xs);
  color: var(--r1-color-text-secondary);
}
.r1-table-wrap { overflow-x: auto; }

.r1-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--r1-text-xs);
}
.r1-table-wrap thead th {
  background: #f8f9fa;
  padding: 10px 14px;
  font-weight: 600;
  text-align: left;
  color: var(--r1-color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.r1-th-inner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.r1-th-inner:hover { color: var(--r1-color-primary); }
.r1-sort-icon { color: var(--r1-color-text-muted); }
.r1-sort-icon.active { color: var(--r1-color-accent); }

.r1-table-wrap tbody tr {
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--r1-transition-fast);
}
.r1-table-wrap tbody tr:hover { background: #f8f9fa; }
.r1-table-wrap tbody td {
  padding: 10px 14px;
  color: var(--r1-color-text-primary);
  font-weight: 500;
}

.r1-td-jurisdiction { font-weight: 700; color: var(--r1-color-primary); }
.r1-td-state { font-weight: 600; color: var(--r1-color-text-secondary); }
.r1-td-date {
  font-family: var(--r1-font-numeric);
  font-size: 12px;
  color: var(--r1-color-text-secondary);
}
.r1-td-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.r1-badge-deed { background: #D1FAE5; color: #15803D; }
.r1-badge-online { background: #DBEAFE; color: #1E40AF; }
.r1-badge-inperson { background: #FEF3C7; color: #92400E; }
.r1-badge-hybrid { background: #EDF1EE; color: #3B5C4F; }

.r1-parcels-count {
  font-family: var(--r1-font-numeric);
  font-weight: 700;
  color: var(--r1-color-primary);
}
.r1-agg-amount {
  font-family: var(--r1-font-money);
  font-weight: 400;
  color: var(--r1-color-primary);
  white-space: nowrap;
}

/* ─── PAGINATION ──────────────────────────────────────────────────────── */
.r1-pagination-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 12px;
}
.r1-pagination-info {
  font-size: var(--r1-text-xs);
  color: var(--r1-color-text-secondary);
}
.r1-pagination-btns { display: flex; gap: 4px; }
.r1-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--r1-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--r1-color-text-secondary);
  text-decoration: none;
  transition: all var(--r1-transition-fast);
}
.r1-page-btn:hover { background: #f8f9fa; color: var(--r1-color-primary); }
.r1-page-btn.active { background: var(--r1-color-primary); color: #fff; border-color: var(--r1-color-primary); }
.r1-page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ─── CUSTOM DROPDOWN FILTERS ─────────────────────────────────────────── */
.r1-custom-dropdown {
  position: relative;
  display: inline-block;
}
.r1-custom-dropdown-btn {
  appearance: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--r1-color-text-secondary);
  font-family: var(--r1-font-ui);
  font-size: var(--r1-text-xs);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r1-radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  transition: all var(--r1-transition-fast);
}
.r1-custom-dropdown-btn:hover { background: #f8f9fa; }
.r1-custom-dropdown-btn.open { background: #e9ecef; }

.r1-custom-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 250px;
  margin-top: 4px;
  border-radius: var(--r1-radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid var(--color-border);
  z-index: 1000;
}
.r1-custom-dropdown-menu.show { display: block; }
.r1-custom-dropdown-search {
  padding: 10px;
  border-bottom: 1px solid var(--color-border);
}
.r1-custom-dropdown-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-sm);
  font-size: var(--r1-text-xs);
  font-family: var(--r1-font-ui);
  outline: none;
  color: var(--r1-color-text-primary);
}
.r1-custom-dropdown-search input:focus { border-color: var(--r1-color-accent); }
.r1-custom-dropdown-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.r1-custom-dropdown-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 4px 0;
}
.r1-custom-dropdown-item {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--r1-color-primary);
}
.r1-custom-dropdown-item:hover { background: #f8f9fa; }
.r1-custom-dropdown-item input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; }
.r1-custom-dropdown-item .r1-badge {
  margin-left: auto;
  background: var(--r1-color-accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

/* ─── SETTINGS POPUP ─────────────────────────────────────────────────── */
.r1-btn-active-red { background: #D9534F !important; color: #fff !important; }
.r1-settings-popup {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: auto;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 16px;
  width: 380px;
  z-index: 1000;
  cursor: default;
}
.r1-settings-popup.show { display: block; }
.r1-settings-popup h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--r1-color-text-primary);
  margin-top: 0;
  margin-bottom: 12px;
}
.r1-settings-list { display: flex; flex-direction: column; gap: 2px; }
.r1-settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--r1-color-text-primary);
}
.r1-settings-row .r1-row-label { flex: 1; }
.r1-settings-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 600;
}
.r1-settings-row input[type="radio"],
.r1-settings-row input[type="checkbox"] { cursor: pointer; }
.r1-settings-row .r1-drag-icon {
  color: var(--r1-color-text-muted);
  cursor: grab;
  margin-left: 6px;
}
.r1-btn-save-popup {
  background: #3A82C3;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--r1-transition-fast);
}
.r1-btn-save-popup:hover { background: #1E4E8C; }

/* ─── SAVE SEARCH POPUP ──────────────────────────────────────────────── */
.r1-btn-active-blue { background: #3A82C3 !important; color: #fff !important; }
.r1-save-popup {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--r1-radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 16px;
  width: 350px;
  z-index: 1000;
  cursor: default;
  text-align: left;
}
.r1-save-popup.show { display: block; }
.r1-save-popup h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--r1-color-text-primary);
  margin-top: 0;
  margin-bottom: 12px;
}
.r1-save-form-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.r1-save-form-row input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--r1-font-ui);
  font-size: 13px;
  color: var(--r1-color-text-secondary);
}
.r1-save-form-row button {
  background: #3A82C3;
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--r1-transition-fast);
}
.r1-save-form-row button:hover { background: #1E4E8C; }
.r1-save-popup-divider {
  border-top: 1px solid var(--color-border);
  margin: 16px 0;
}
.r1-saved-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 8px 12px;
  background: #fdfdfd;
}
.r1-saved-search-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--r1-color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.r1-saved-search-badge {
  background: #777;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 12px;
}
.r1-saved-search-actions { display: flex; }
.r1-saved-search-actions button {
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  cursor: pointer;
}
.r1-saved-search-actions button.r1-btn-edit {
  background: #5CB85C;
  border-radius: 4px 0 0 4px;
}
.r1-saved-search-actions button.r1-btn-edit:hover { background: #4cae4c; }
.r1-saved-search-actions button.r1-btn-delete {
  background: #D9534F;
  border-radius: 0 4px 4px 0;
}
.r1-saved-search-actions button.r1-btn-delete:hover { background: #c9302c; }

/* ─── PRESET CHIP ─────────────────────────────────────────────────────── */
.r1-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  background: var(--r1-color-accent-light);
  border: 1px solid rgba(46,134,193,0.3);
  border-radius: 20px;
  font-size: var(--r1-text-xs);
  font-weight: 500;
  color: var(--r1-color-accent);
  cursor: pointer;
}
.r1-preset-chip:hover { background: #D6EAF8; }

@media (max-width: 768px) {
  .r1-filter-bar { flex-wrap: wrap; padding: 8px 12px; }
  .r1-main-content { padding: 12px; }
  .r1-cal-cell { min-height: 70px; }
  .r1-stats-row { flex-direction: column; }
}

/* =============================================================
   RAMA 2: GEOGRAPHIC SEARCH MODULE — Component Styles
   Migrated from approved prototype: rama2-internal-flow.html
   Two-phase flow: Phase 1 (Geographic Overview) → Phase 2 (County Detail)
   ============================================================= */

/* ─── Rama 2 Design Tokens ───────────────────────────────────────────── */
:root {
  --r2-pin-bg:         #0D1B3D;
  --r2-pin-border:     #43B573;
  --r2-pin-text:       #FFFFFF;
  --r2-sidebar-width:  380px;
  --r2-transition:     400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── R2 APP SHELL ───────────────────────────────────────────────────── */
.r2-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--rn-header-h, 56px));
  overflow: hidden;
  position: relative;
}
.r2-map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.r2-map-container #r2-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ─── COUNTY PIN (DivIcon) ───────────────────────────────────────────── */
.r2-county-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--r2-pin-bg);
  border: 3px solid var(--r2-pin-border);
  color: var(--r2-pin-text);
  font-family: var(--font-sans);   /* Inter only: familia literal → token */
  font-weight: 700;
  text-align: center;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(46, 134, 193, 0.2);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  position: relative;
}
.r2-county-pin:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(46, 134, 193, 0.3);
  z-index: 1000 !important;
}
/* Rampa acoplada a la GEOMETRIA del pin, no a la escala de texto: el numeral crece
   con el diametro del circulo. Los tres primeros escalones caen exactos sobre tokens;
   el 17px del --xl es el unico peldano sin token (entre --type-lg 15 y --type-h4 19) y
   se deja en px a proposito para no romper la progresion +2 de la rampa. */
.r2-county-pin--sm { width: 36px; height: 36px; font-size: var(--type-chip); }
.r2-county-pin--md { width: 44px; height: 44px; font-size: var(--type-md); }
.r2-county-pin--lg { width: 54px; height: 54px; font-size: var(--type-lg); }
.r2-county-pin--xl { width: 64px; height: 64px; font-size: 17px; }

/* ─── COUNTY PIN — tarjeta de información en hover ────────────────────────
   Reemplaza al InfoWindow con botón "View Properties →": ahora el PIN es el
   botón (un clic entra al condado), así que el hover ya no necesita ofrecer una
   acción — solo informar. Sin botones, sin cierre, sin robarle el clic al pin.
   En móvil no hay hover: ese dato vive en la barra de contexto de la Fase 2. */
.r2-county-pin__label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  display: block;
  min-width: 148px;
  background: var(--r2-pin-bg);
  color: #fff;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: var(--type-chip);
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease, transform 140ms ease;
  box-shadow: 0 6px 20px rgba(13, 27, 61, 0.34);
  z-index: 1001;
}
/* Punta del globo */
.r2-county-pin__label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--r2-pin-bg);
}
.r2-county-pin:hover .r2-county-pin__label,
.r2-county-pin:focus-visible .r2-county-pin__label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.r2-county-pin__label-title {
  display: block;
  font-size: var(--type-sm);
  font-weight: 800;
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.r2-county-pin__label-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}
.r2-county-pin__label-row strong {
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.r2-county-pin:focus-visible {
  outline: 3px solid var(--r2-pin-border);
  outline-offset: 3px;
}

/* Coreografía de salida: al entrar a un condado, el pin elegido crece y el resto
   se apaga escalonado por su distancia EN PANTALLA (--r2-exit lo setea el JS).
   No es "desaparecieron todos": es el país replegándose hacia el condado. */
.r2-county-pin.is-committing {
  transform: scale(1.32);
  box-shadow: 0 8px 26px rgba(13, 27, 61, 0.5), 0 0 0 6px rgba(67, 181, 115, 0.35);
  z-index: 1002 !important;
}
.r2-county-pin.is-dismissing {
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 220ms ease var(--r2-exit, 0ms),
              transform 220ms cubic-bezier(.4, 0, 1, 1) var(--r2-exit, 0ms);
}
.r2-county-pin.is-dismissing .r2-county-pin__label { opacity: 0; }

/* ─── EVENTS SELECTOR BUTTON (overlay on map) ────────────────────────── */
.r2-events-btn {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: var(--r2-pin-bg);
  color: #fff;
  border: 2px solid var(--r2-pin-border);
  border-radius: 50px;
  font-family: var(--font-sans);   /* Inter only: familia literal → token */
  font-size: var(--type-ui);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  transition: all 200ms ease;
  text-decoration: none;
}
.r2-events-btn:hover {
  background: #2A4F82;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%) translateY(-2px);
  color: #fff;
}
.r2-events-btn .r2-events-badge {
  background: #0D1B3D;
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: var(--type-chip);
  font-weight: 800;
}

/* ─── PHASE 2: SIDEBAR ───────────────────────────────────────────────── */
.r2-phase2-sidebar {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--r2-sidebar-width);
  height: 100%;
  background: #fff;
  border-right: 1px solid var(--color-border, #E5E7EB);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--r2-transition);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}
.r2-phase2-sidebar.is-open {
  transform: translateX(0);
}

/* Sidebar header */
.r2-sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  background: #FAFBFC;
}
.r2-sidebar-header__info h3 {
  font-size: var(--type-lg);
  font-weight: 700;
  line-height: 1.2;
  color: #0D1B3D;
  margin: 0 0 2px;
}
.r2-sidebar-header__info span {
  font-size: var(--type-sm);
  color: #6B7280;
}
.r2-sidebar-back {
  background: none;
  border: none;
  color: #6B7280;
  cursor: pointer;
  /* Caja del glifo de la flecha, no un rol de texto: se congela en px. */
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 150ms ease;
}
.r2-sidebar-back:hover { background: #f0f0f0; color: #0D1B3D; }

/* Sidebar search */
.r2-sidebar-search {
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border, #E5E7EB);
  flex-shrink: 0;
}
.r2-sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--color-border, #E5E7EB);
  border-radius: 8px;
  font-size: var(--type-md);
  font-family: var(--font-sans);   /* Inter only: familia literal → token */
  outline: none;
  box-sizing: border-box;
  transition: border-color 150ms ease;
}
.r2-sidebar-search input:focus { border-color: #43B573; }
.r2-sidebar-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Sidebar list */
.r2-sidebar-list {
  flex: 1;
  overflow-y: auto;
}
.r2-parcel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #F0F0F0;
  cursor: pointer;
  transition: background 100ms ease;
}
.r2-parcel-row:hover { background: #F8FBFF; }
.r2-parcel-row__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #E8F5ED;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Caja del glifo del icono de fila, no un rol de texto: se congela en px. */
  font-size: 16px;
  flex-shrink: 0;
}
.r2-parcel-row__info {
  flex: 1;
  min-width: 0;
}
.r2-parcel-row__address {
  font-size: var(--type-md);
  font-weight: 600;
  color: #0D1B3D;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r2-parcel-row__meta {
  font-size: var(--type-chip);
  color: #6B7280;
  margin-top: 2px;
}
.r2-parcel-row__bid {
  font-family: var(--font-sans);   /* Inter only: familia literal → token */
  /* Money Typography (ui/typography.md §3.6): 800 + tabular-nums. El 400 anterior
     dejaba la puja mas liviana que la direccion que tiene al lado (600), invirtiendo
     la jerarquia de la fila. */
  font-size: var(--type-lg);
  color: #0D1B3D;
  font-weight: 800;
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Sidebar footer / pagination */
.r2-sidebar-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--color-border, #E5E7EB);
  font-size: var(--type-sm);
  color: #6B7280;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: #FAFBFC;
}

/* ─── MAP POPUP (Google Maps InfoWindow) ──────────────────────────────── */
.r2-popup {
  font-family: var(--font-sans);   /* Inter only: familia literal → token */
  min-width: 220px;
  max-width: 300px;
  padding: 4px 2px;
  line-height: 1.5;
}
/* Misma receta que el override de la InfoWindow apilada (.r2-popup--stack h4 en
   research/parcels/index.html.erb). Estaba en 14px crudo sin tracking mientras su
   variante ya iba tokenizada: el MISMO encabezado renderizaba distinto según si la
   InfoWindow tenía una parcela o varias. */
.r2-popup h4 {
  font-size: var(--type-base);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #0D1B3D;
  margin: 0 0 8px;
  line-height: 1.5;
}
.r2-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--type-sm);
  color: #6B7280;
  margin-bottom: 4px;
  gap: 12px;
}
.r2-popup-row strong {
  color: #0D1B3D;
  text-align: right;
}
.r2-popup-cta {
  display: block;
  margin-top: 12px;
  padding: 9px 16px;
  background: #0D1B3D;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  font-size: var(--type-ui);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms ease, transform 150ms ease;
  border: none;
  width: 100%;
}
.r2-popup-cta:hover { background: #2A4F82; color: #fff; transform: translateY(-1px); }

/* ─── PHASE TRANSITIONS ──────────────────────────────────────────────── */
.r2-phase1-active .r2-phase2-sidebar { transform: translateX(-100%); }
.r2-phase2-active .r2-phase2-sidebar { transform: translateX(0); }

/* Map repositions when sidebar opens */
.r2-phase2-active .r2-map-container #r2-map {
  transition: padding-left var(--r2-transition);
}

/* ─── LOADING OVERLAY ────────────────────────────────────────────────── */
.r2-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 249, 250, 0.9);
  z-index: 700;
  flex-direction: column;
  gap: 12px;
  font-size: var(--type-base);
  color: #6B7280;
}
.r2-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E5E7EB;
  border-top-color: #0D1B3D;
  border-radius: 50%;
  animation: r2spin 0.7s linear infinite;
}
@keyframes r2spin { to { transform: rotate(360deg); } }

/* ─── GOOGLE MAPS INFOWINDOW OVERRIDES ───────────────────────────────── */
.gm-style .gm-style-iw-c {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding-bottom: 0;
  max-width: 320px;
}
.gm-style .gm-style-iw-d { padding: 14px 16px 8px; overflow: auto !important; }
.gm-style .gm-style-iw-t::after {
  background: linear-gradient(45deg, #fff 50%, transparent 51%, transparent);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .r2-phase2-sidebar {
    width: 100%;
    height: 50%;
    top: auto;
    bottom: 0;
    left: 0;
    transform: translateY(100%);
    border-right: none;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }
  .r2-phase2-sidebar.is-open { transform: translateY(0); }
  .r2-events-btn { font-size: var(--type-ui); padding: 10px 22px; bottom: 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ICON SYSTEM — DeedToGo brand UI icons (F0, 2026-07-11)
   SSOT: software/rules/ui/icon_system.md · Helper: app/helpers/icon_helper.rb
   Color SIEMPRE via currentColor + tokens --brand-* (cero hex nuevo).
   Sin variante, el icono HEREDA el color del texto (navy claro / blanco en navy).
   ═══════════════════════════════════════════════════════════════════════ */
.icon {
  display: inline-block;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.icon--green   { color: var(--brand-green); }
.icon--success { color: var(--success); }
.icon--muted   { color: var(--brand-gray); }
.icon--warning { color: var(--warning); }
.icon--danger  { color: var(--danger); }
.icon--cta     { color: var(--color-cta); }
.icon--on-navy { color: var(--brand-white); }
.icon--solid   { fill: currentColor; stroke: none; }
