/* ════════════════════════════════════════════════════════════════
   LANGUAGE SELECTOR (i18n)
   ════════════════════════════════════════════════════════════════ */
.i18n-selector {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99999;
  font-family: 'Inter', system-ui, sans-serif;
}
.i18n-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(8, 28, 36, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.i18n-toggle:hover {
  background: rgba(8, 28, 36, 0.92);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.i18n-flag { font-size: 1.1rem; line-height: 1; }
.i18n-code { letter-spacing: 0.04em; }
.i18n-chevron {
  transition: transform 0.2s;
  opacity: 0.6;
}
.i18n-dropdown.is-open ~ .i18n-toggle .i18n-chevron,
.i18n-selector:has(.i18n-dropdown.is-open) .i18n-chevron {
  transform: rotate(180deg);
}
.i18n-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: rgba(8, 28, 36, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.18s, visibility 0.18s, transform 0.18s;
}
.i18n-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.i18n-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
.i18n-option:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.i18n-option.is-active {
  color: #5DFDCB;
  font-weight: 600;
}
.i18n-option.is-active::after {
  content: '✓';
  margin-left: auto;
  font-size: 0.75rem;
}
.i18n-opt-flag { font-size: 1.15rem; line-height: 1; }
.i18n-opt-label { flex: 1; }

@media (max-width: 600px) {
  .i18n-selector { top: 10px; right: 10px; }
  .i18n-toggle { padding: 6px 10px; font-size: 0.78rem; }
  .i18n-code { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   SIDE PANEL (Panel lateral para formularios rápidos)
   ════════════════════════════════════════════════════════════════ */
.side-panel-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8,28,36,0.55);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  transition: background 0.2s;
}

.side-panel-overlay[hidden] {
  display: none !important;
}
.side-panel-card {
  width: 740px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  border-radius: 0 0 0 var(--radius);
  display: flex;
  flex-direction: column;
  animation: slideInPanel 0.22s cubic-bezier(.4,1.4,.6,1) 1;
}
@keyframes slideInPanel {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 10px 28px;
  border-bottom: 1px solid var(--border);
}
.side-panel-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
}
.side-panel-close {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.18s;
}
.side-panel-close:hover {
  color: var(--green);
}
.side-panel-form {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 28px 28px;
}
/* ════════════════════════════════════════════════════════════════
   TU HUELLA — Web App Styles
   Paleta: #081C24 bg-deep | #11C5C6 accent | #49E57A green
   Inspirado en el diseño Flutter original
   ════════════════════════════════════════════════════════════════ */

:root {
  --bg-deep:     #081C24;
  --bg-mid:      #0D2F3D;
  --bg-card:     #0F2E3C;
  --bg-elevated: #163649;
  --accent:      #11C5C6;
  --accent-dark: #0EA8A9;
  --green:       #49E57A;
  --text:        #E0F0F2;
  --text-muted:  rgba(224,240,242,0.55);
  --border:      rgba(17,197,198,0.18);
  --shadow:      0 12px 40px rgba(0,0,0,0.45);
  --radius:      14px;
  --radius-sm:   9px;
  --tr:          0.22s ease;
  --bg:          #081C24;
  --surface:     #0F2E3C;
  --surface-hover: #163649;
  --primary:     #11C5C6;
  --danger:      #e85050;
  --text-secondary: rgba(224,240,242,0.7);
  --radius-card: 16px;
}

[data-theme="light"] {
  --bg-deep:     #F5F7F8;
  --bg-mid:      #E8EEEF;
  --bg-card:     #FFFFFF;
  --bg-elevated: #F0F5F5;
  --text:        #0D2F3D;
  --text-muted:  rgba(13,47,61,0.55);
  --border:      rgba(17,197,198,0.28);
  --shadow:      0 8px 32px rgba(0,0,0,0.12);
}
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(17,197,198,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(17,197,198,0.35); }
* { scrollbar-width: thin; scrollbar-color: rgba(17,197,198,0.2) transparent; }

/* ── Welcome screen ── */
/* ── Logo container (3 capas) ────────────────────────────────────────── */
.welcome-logo-img {
  width: 220px;
  height: 220px;
  position: relative;
  margin-bottom: 24px;
  flex-shrink: 0;
}

/* Float del container entero — activado por JS tras entradas */
.welcome-logo-img.logo-live {
  animation: logoFloat 6s ease-in-out infinite alternate;
}

/* Capas base — visibles por defecto */
.logo-layer {
  position: absolute;
  opacity: 1;
}
#layerEscudo {
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
/* Posición exact SF=220/1024 de los valores del editor */
#layerHuella { top: 29.9px; left: 61.4px; width: 97.7px;  height: auto; }
#layerCasa   { top: 20.0px; left: 46.6px; width: 126.8px; height: auto; }

/* ── 1. ESCUDO — Digital Forge (hologram materialize) ───────── */
#layerEscudo.anim-in {
  animation: shieldForge 1.1s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes shieldForge {
  0%   { opacity:0; filter:blur(18px) brightness(7) hue-rotate(170deg); transform:scale(1.4); }
  8%   { opacity:1; filter:blur(8px)  brightness(4) hue-rotate(90deg);  transform:scale(1.22); }
  26%  { filter:blur(3px)   brightness(2.8) hue-rotate(35deg);  transform:scale(1.08); }
  55%  { filter:blur(0.6px) brightness(1.9) hue-rotate(8deg);   transform:scale(1.01); }
  72%  { filter:blur(0)     brightness(2.6) hue-rotate(0deg);   transform:scale(1);    } /* flash */
  87%  { filter:blur(0)     brightness(1.3); }
  100% { opacity:1; filter:blur(0) brightness(1); transform:scale(1); }
}
/* Estado fijo post-entrada */
#layerEscudo:not(.anim-in) { opacity: 1; filter: brightness(1); transform: scale(1); }
/* Glow idle post-entrada */
#layerEscudo.logo-live {
  animation: escudoGlow 4.5s ease-in-out infinite alternate !important;
  opacity: 1 !important;
  filter: brightness(1) !important;
}
@keyframes escudoGlow {
  from { filter: drop-shadow(0 0 10px rgba(17,197,198,0.4)); }
  to   { filter: drop-shadow(0 0 30px rgba(17,197,198,0.88))
                 drop-shadow(0 0 52px rgba(73,229,122,0.22)); }
}

/* ── 2. HUELLA — Biometric Reader (expande desde el centro) ── */
#layerHuella.anim-in {
  animation: huellaBio 1.05s ease-out forwards;
}
@keyframes huellaBio {
  0%   { opacity:0; clip-path:inset(52% 12% 52% 12%); filter:brightness(5) blur(4px); }
  15%  { opacity:1; clip-path:inset(38% 6%  38% 6%);  filter:brightness(3.5) blur(1.5px); }
  42%  { clip-path:inset(14% 1%  14% 1%);  filter:brightness(2.1) blur(0); }
  68%  { clip-path:inset(4%  0%  4%  0%);  filter:brightness(1.5); }
  85%  { clip-path:inset(0 0 0 0);         filter:brightness(2.2); }
  100% { opacity:1; clip-path:inset(0 0 0 0); filter:brightness(1); }
}
/* Estado fijo post-entrada */
#layerHuella:not(.anim-in) { opacity: 1; clip-path: inset(0 0 0 0); filter: brightness(1); }
/* Pulso biométrico idle */
#layerHuella.logo-live {
  animation: huellaPulse 3.5s ease-in-out 0.3s infinite alternate !important;
  opacity: 1;
}
@keyframes huellaPulse {
  from { filter: brightness(1); }
  to   { filter: brightness(1.4) drop-shadow(0 0 8px rgba(73,229,122,0.55)); }
}

/* ── 3. CASA — Neon CRT Flicker (se enciende como neón) ───── */
#layerCasa.anim-in {
  animation: casaNeon 0.95s ease-out forwards;
}
@keyframes casaNeon {
  0%   { opacity:0; filter:blur(6px) brightness(9); transform:scale(0.88) translateY(9px); }
  5%   { opacity:0.9; filter:blur(1px) brightness(6); transform:scale(0.93) translateY(5px); }
  10%  { opacity:0.05; }
  17%  { opacity:1; filter:brightness(4.5); transform:scale(0.96) translateY(2px); }
  23%  { opacity:0.3; }
  31%  { opacity:1; filter:brightness(3); transform:scale(0.99) translateY(0); }
  42%  { opacity:0.75; }
  56%  { opacity:1; filter:brightness(1.9); transform:scale(1); }
  100% { opacity:1; filter:brightness(1); transform:scale(1); }
}
/* Estado fijo post-entrada */
#layerCasa:not(.anim-in) { opacity: 1; filter: brightness(1); transform: scale(1); }
/* Idle: sin animación adicional para casa, solo flotación del contenedor */
#layerCasa.logo-live { opacity: 1; }

/* ── Float y glow global ─────────────────────────────────────── */
@keyframes logoFloat {
  0%, 100% { transform: translate(calc(var(--logo-float-x, 0px)), calc(var(--logo-float-y, 0px) + 0px)); }
  50%      { transform: translate(calc(var(--logo-float-x, 0px)), calc(var(--logo-float-y, 0px) - 9px)); }
}

/* ── Welcome text ──────────────────────────────────────────── */
.welcome-title {
  opacity: 1;
}
.welcome-tagline {
  opacity: 1;
  clip-path: none;
  position: static;
  min-height: auto;
  perspective: none;
  display: block;
  font-size: 1.02rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
  width: 100%;
  max-width: 520px;
  margin-bottom: 24px;
}
.welcome-tagline .tagline-phrase {
  display: block;
  position: static;
  color: rgba(255,255,255,0.72);
  transform: none !important;
  opacity: 1 !important;
  will-change: auto;
  backface-visibility: visible;
}
.welcome-tagline .tagline-remate {
  display: none;
}
  animation: taglineFlipRemate 6s ease-in-out infinite;
}
.welcome-tagline.scan-anim .tagline-remate {
  color: var(--text);
}
.welcome-continuar-btn {
  opacity: 1;
  transform: none;
}
.welcome-continuar-btn.emerge-anim {
  animation: btnEmerge 0.65s cubic-bezier(.16,1,.3,1) forwards;
}

@keyframes taglineFlipMain {
  0%, 42%   { opacity: 1; transform: rotateX(0deg) translateY(0); }
  48%       { opacity: 0; transform: rotateX(90deg) translateY(-6px); }
  52%, 100% { opacity: 0; transform: rotateX(90deg) translateY(-6px); }
}

@keyframes taglineFlipRemate {
  0%, 42%   { opacity: 0; transform: rotateX(-90deg) translateY(6px); }
  48%       { opacity: 1; transform: rotateX(0deg) translateY(0); }
  52%, 100% { opacity: 1; transform: rotateX(0deg) translateY(0); }
}

@keyframes btnEmerge {
  0%   { opacity: 0; transform: scale(0.72); box-shadow: 0 0 0    rgba(17,197,198,0);    }
  55%  { opacity: 1; transform: scale(1.07); box-shadow: 0 0 30px rgba(17,197,198,0.72); }
  100% { opacity: 1; transform: scale(1);    box-shadow: 0 0 10px rgba(17,197,198,0.22); }
}

.welcome-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
}
/* ── Alternating brand name ── */
.welcome-brand {
  position: relative;
  height: 3.6rem;
  width: 100%;
  perspective: 600px;
  margin-bottom: 16px;
}
.welcome-brand {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}
.brand-es {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--text);
  opacity: 1;
  display: block;
}
.brand-en {
  display: none;
}
.welcome-tagline {
  font-size: 1.02rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  width: 100%;
  max-width: 620px;
  margin-bottom: 32px;
  white-space: nowrap;
}
.welcome-continuar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: background var(--tr), color var(--tr);
}
.welcome-continuar-btn:hover {
  background: var(--accent);
  color: #081C24;
}

/* ── Welcome button group (Register + Login) ── */
.welcome-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.welcome-btn-register {
  background: var(--accent) !important;
  color: #081C24 !important;
}
.welcome-btn-register:hover {
  background: #fff !important;
  color: #081C24 !important;
}
.welcome-btn-login {
  background: transparent !important;
  color: var(--accent) !important;
}
.welcome-btn-login:hover {
  background: rgba(17,197,198,0.15) !important;
  color: #fff !important;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbars ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(17,197,198,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(17,197,198,0.45); }

/* ════════════════════════════════════════════════════════════════
   SCREENS — navegación a pantalla completa
   ════════════════════════════════════════════════════════════════ */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.screen.is-hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════════
   SCREEN: BIENVENIDA
   ════════════════════════════════════════════════════════════════ */
#screenWelcome {
  background: #000;
  position: relative;
  width: 100vw;
  min-height: 100dvh;
}

.welcome-video-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.welcome-video-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,28,36,0.55) 0%,
    rgba(8,28,36,0.72) 100%
  );
  z-index: 1;
}

.welcome-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 36px 20px 32px;
  text-align: center;
  width: min(600px, 94vw);
  margin: 0 auto;
}

/* Fade-in suave de toda la pantalla de bienvenida */
#screenWelcome .welcome-content,
#screenWelcome ~ .welcome-mkt-section {
  animation: wFadeIn .25s ease both;
}
@keyframes wFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Welcome Top block ─────────────────────────────────────── */
.welcome-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ── Compact logo ──────────────────────────────────────────── */
.welcome-content .welcome-logo-img {
  width: 190px;
  height: 190px;
  margin-bottom: 12px;
}

/* Rescale layers proportionally (factor 190/220 ≈ 0.864) */
.welcome-content #layerHuella { top: 25.8px; left: 53.0px; width: 84.4px; }
.welcome-content #layerCasa   { top: 17.3px; left: 40.2px; width: 109.5px; }

/* Compact brand */
.welcome-content .welcome-brand  { height: 2.6rem; margin-bottom: 6px; }
.welcome-content .brand-es,
.welcome-content .brand-en        { font-size: 2.2rem; }
.welcome-content .welcome-title   { font-size: 1.15rem; margin-bottom: 4px; }
.welcome-content .welcome-tagline { margin-bottom: 14px; font-size: 0.88rem; min-height: 2.6em; }
.welcome-content .welcome-continuar-btn { padding: 10px 28px; font-size: 0.92rem; margin-bottom: 0; }

/* ── Welcome secondary actions (login / explore guest) ──────── */
.welcome-secondary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  opacity: .82;
}
.welcome-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: rgba(255,255,255,.72);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 2px;
  transition: color .18s;
  text-decoration: none;
}
.welcome-link-btn:hover { color: #fff; }
.welcome-sep { color: rgba(255,255,255,.3); font-size: .85rem; user-select: none; }

/* ── Consultar Huella search widget ────────────────────────── */
.welcome-search-section {
  width: 100%;
  margin-top: 20px;
  backdrop-filter: blur(10px);
  background: rgba(8,28,36,0.7);
  border: 1px solid rgba(17,197,198,0.28);
  border-radius: 16px;
  padding: 16px 18px 14px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.welcome-search-section.search-reveal {
  /* no-op: kept for JS compatibility */
}
@keyframes searchReveal {
  0%   { opacity: 0; transform: translateY(20px) scaleX(0.97); }
  65%  { opacity: 1; transform: translateY(-3px)  scaleX(1.005); }
  100% { opacity: 1; transform: translateY(0)     scaleX(1); }
}
.welcome-search-section.search-reveal-done {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.welcome-search-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.welcome-search-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(17,197,198,0.3);
}
.welcome-search-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
  white-space: nowrap;
}

.welcome-search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.welcome-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.welcome-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8,28,36,0.55);
  border: 1px solid rgba(17,197,198,0.28);
  border-radius: 30px;
  padding: 9px 14px;
  color: var(--text-muted);
  min-width: 0;
}
.welcome-search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.88rem;
  min-width: 0;
}
.welcome-search-input-wrap input::placeholder { color: var(--text-muted); }
.welcome-search-input-wrap svg { flex-shrink: 0; color: var(--accent); }

.welcome-search-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #081C24;
  border: none;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--tr), transform 0.1s;
}
.welcome-search-btn:hover   { background: var(--accent-dark); }
.welcome-search-btn:active  { transform: scale(0.97); }
.welcome-search-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.welcome-search-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1.5;
  padding: 0 4px;
}
.welcome-search-consent input[type="checkbox"] {
  accent-color: #22d3ee;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
}
.welcome-search-consent a {
  color: #22d3ee;
  text-decoration: underline;
}
.welcome-search-consent a:hover {
  color: #67e8f9;
}

/* ── Results area ────────────────────────────────────────────── */
.welcome-fp-result {
  margin-top: 12px;
  text-align: left;
}
.wfp-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 0;
}
.wfp-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(17,197,198,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: wfpSpin 0.7s linear infinite;
}
@keyframes wfpSpin { to { transform: rotate(360deg); } }
.wfp-error  { color: #f4616b; font-size: 0.82rem; padding: 6px 0; }

/* ══ Definición inline de La Huella (debajo de Consultar Huella) ══════════ */
.welcome-definition-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 28px 0;
  border-top: 1px solid rgba(17,197,198,0.12);
  margin-top: 8px;
  text-align: center;
}
.welcome-definition-logo {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  opacity: 0.75;
}
.welcome-definition-logo .logo-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.welcome-definition-kw {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-style: normal;
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #11C5C6;
  margin: 0;
  line-height: 1.1;
}
.welcome-definition-text {
  max-width: 560px;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.85;
  color: rgba(255,255,255,0.72);
  margin: 0;
  letter-spacing: .01em;
}
.welcome-definition-text strong {
  color: #49E57A;
  font-weight: 700;
}

/* ── Marketplace section (full-width slider) ───────────────── */
.welcome-mkt-section {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 40px 0 48px;
  border-top: 1px solid rgba(17,197,198,0.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.welcome-mkt-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #49E57A;
  margin: 0;
}
.welcome-mkt-heading {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}
/* ── Track wrapper con flechas ─────────────────────────────── */
.welcome-mkt-track-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.welcome-mkt-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 48px 16px;
  flex: 1;
}
.welcome-mkt-track::-webkit-scrollbar { display: none; }
/* ── Flechas de navegación ─────────────────────────────────── */
.mkt-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(17,197,198,0.4);
  background: rgba(0,0,0,0.55);
  color: #11C5C6;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  backdrop-filter: blur(4px);
}
.mkt-nav:hover {
  background: rgba(17,197,198,0.18);
  border-color: #11C5C6;
}
.mkt-nav--prev { left: 4px; }
.mkt-nav--next { right: 4px; }
/* ── Tarjetas ──────────────────────────────────────────────── */
.welcome-mkt-card {
  flex: 1 0 clamp(200px, 22vw, 280px);
  max-width: 300px;
  scroll-snap-align: start;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.welcome-mkt-card:hover {
  transform: translateY(-4px);
  border-color: rgba(17,197,198,0.4);
}
.welcome-mkt-card__img {
  height: 150px;
  position: relative;
  background: url('marketplace/casas/casa1.jpg') center/cover no-repeat, #0d1e35;
}
.welcome-mkt-card__img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,0.55));
}
.welcome-mkt-card__img--b { background: url('marketplace/casas/casa2.jpg') center/cover no-repeat, #1a0d35; }
.welcome-mkt-card__img--c { background: url('marketplace/casas/casa3.jpg') center/cover no-repeat, #0d2535; }
.welcome-mkt-card__img--d { background: url('marketplace/casas/casa4.jpg') center/cover no-repeat, #2d1a00; }
.welcome-mkt-card__img--e { background: url('marketplace/casas/casa5.jpg') center/cover no-repeat, #2d0d16; }
.welcome-mkt-card__img--f { background: url('marketplace/casas/casa6.jpg') center/cover no-repeat, #003d3a; }
.welcome-mkt-card__img--g { background: url('marketplace/casas/casa7.jpg') center/cover no-repeat, #1a1200; }
.welcome-mkt-card__body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.welcome-mkt-card__tag {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #11C5C6;
}
.welcome-mkt-card__title {
  font-size: .88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  margin: 0;
}
.welcome-mkt-card__price {
  font-size: .85rem;
  color: #49E57A;
  font-weight: 700;
  margin: 0;
}
.welcome-mkt-cta {
  background: transparent;
  border: 1px solid #11C5C6;
  color: #11C5C6;
  border-radius: 24px;
  padding: 11px 32px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.welcome-mkt-cta:hover {
  background: #11C5C6;
  color: #000;
}

/* ── Modal: Desempeño ──────────────────────────────────────── */
.desempeno-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.desempeno-modal.is-open {
  opacity: 1;
  pointer-events: all;
}
.desempeno-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.desempeno-modal__box {
  position: relative;
  z-index: 1;
  background: rgba(10,16,28,0.90);
  border: 1px solid rgba(17,197,198,0.22);
  border-radius: 20px;
  padding: 52px 36px 44px;
  max-width: 520px;
  width: calc(100% - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 56px rgba(0,0,0,0.55);
}
.desempeno-modal__close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
}
.desempeno-modal__close:hover { color: #fff; }
.desempeno-modal__logo {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}
.desempeno-modal__logo .logo-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.desempeno-modal__kw {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-style: normal;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #11C5C6;
  margin: 0;
  line-height: 1.1;
}
.desempeno-modal__text {
  max-width: 440px;
  font-size: clamp(0.88rem, 2vw, 1rem);
  line-height: 1.8;
  color: rgba(255,255,255,0.72);
  margin: 0;
}
.desempeno-modal__text strong {
  color: #49E57A;
  font-weight: 700;
}

/* ── welcome-top collapse when result found ─────────────────── */
.welcome-top {
  transition: opacity 0.4s ease, transform 0.4s ease,
              max-height 0.5s cubic-bezier(.4,0,.2,1),
              margin-bottom 0.4s ease;
  max-height: 600px;
  overflow: hidden;
}
.welcome-top.wt-collapsed {
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  max-height: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* ══ Found card — horizontal 3-col ════════════════════════════ */
.wfp-card {
  background: rgba(7,20,32,0.9);
  border: 1px solid rgba(17,197,198,0.3);
  border-radius: 16px;
  overflow: hidden;
  animation: wfpFadeIn 0.45s cubic-bezier(.16,1,.3,1);
}
@keyframes wfpFadeIn {
  from { opacity:0; transform: translateY(12px) scale(0.97); }
  to   { opacity:1; transform: none; }
}

.wfp-cols {
  display: flex;
  align-items: stretch;
  min-height: 120px;
}

.wfp-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  gap: 5px;
  text-align: center;
}
.wfp-col-left  { flex: 1.4; align-items: flex-start; text-align: left; padding: 16px 20px; }
.wfp-col-mid   { flex: 1; }
.wfp-col-right { flex: 0 0 110px; }

.wfp-vdiv {
  width: 1px;
  background: rgba(17,197,198,0.2);
  margin: 14px 0;
  flex-shrink: 0;
}

/* Left column */
.wfp-cl-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  width: 100%;
}
.wfp-avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(17,197,198,0.35), rgba(17,197,198,0.1));
  border: 2px solid rgba(17,197,198,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: var(--accent);
  flex-shrink: 0;
}
.wfp-cl-info { flex: 1; }
.wfp-lbl-sm  { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.wfp-big-num { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.wfp-col-mid .wfp-big-num { font-size: 2rem; color: var(--accent); }
.wfp-col-right .wfp-big-num { font-size: 1.6rem; color: var(--accent); }
.wfp-status-tag {
  font-size: 0.75rem; font-weight: 700;
  color: var(--accent);
  background: rgba(17,197,198,0.12);
  border: 1px solid rgba(17,197,198,0.3);
  border-radius: 20px; padding: 1px 8px;
  display: inline-block; margin-top: 2px;
}
.wfp-props-row {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
}
.wfp-props-txt { font-size: 0.75rem; color: var(--text-muted); }
.wfp-stars     { display: flex; gap: 2px; }
.wfp-star      { font-size: 0.85rem; color: rgba(17,197,198,0.22); }
.wfp-star.is-active { color: var(--accent); }
.wfp-stars-lg .wfp-star { font-size: 1.2rem; }

/* Middle column */
.wfp-badge {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em;
  padding: 3px 11px; border-radius: 20px;
  border: 1.5px solid; margin-bottom: 2px;
}
.wfp-badge-green  { color: #4ade80; border-color: rgba(74,222,128,0.45); background: rgba(74,222,128,0.1); }
.wfp-badge-teal   { color: var(--accent); border-color: rgba(17,197,198,0.45); background: rgba(17,197,198,0.1); }
.wfp-badge-yellow { color: #facc15; border-color: rgba(250,204,21,0.45);  background: rgba(250,204,21,0.1); }
.wfp-badge-red    { color: #f87171; border-color: rgba(248,113,113,0.45); background: rgba(248,113,113,0.1); }

/* Right column */
.wfp-kpi-ico { font-size: 1.8rem; line-height: 1; }

/* Card footer — back button */
.wfp-card-footer {
  display: flex;
  justify-content: flex-start;
  padding: 8px 18px 12px;
  border-top: 1px solid rgba(17,197,198,0.12);
}
.wfp-btn-back {
  background: transparent;
  border: 1.5px solid rgba(17,197,198,0.35);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  cursor: pointer;
  transition: background var(--tr), color var(--tr), transform 0.1s;
  letter-spacing: 0.04em;
}
.wfp-btn-back:hover  { background: rgba(17,197,198,0.12); }
.wfp-btn-back:active { transform: scale(0.96); }

/* Loading / error / not-found (unchanged) */

/* Not found */
.wfp-not-found {
  text-align: center;
  padding: 10px 0 4px;
  animation: wfpFadeIn 0.3s ease;
}
.wfp-nf-icon  { font-size: 1.6rem; margin-bottom: 6px; }
.wfp-nf-title { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.wfp-nf-sub   { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 14px; }
.wfp-nf-sub strong { color: var(--accent); }

.wfp-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.wfp-action-btn {
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid;
  transition: background var(--tr), color var(--tr), transform 0.1s;
}
.wfp-action-btn:active  { transform: scale(0.97); }
.wfp-action-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.wfp-btn-claim {
  background: rgba(17,197,198,0.12);
  border-color: rgba(17,197,198,0.5);
  color: var(--accent);
}
.wfp-btn-claim:hover  { background: rgba(17,197,198,0.22); }
.wfp-btn-invite {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
}
.wfp-btn-invite:hover  { background: rgba(255,255,255,0.13); }
.wfp-feedback  { font-size: 0.8rem; margin-top: 4px; }
.wfp-ok  { color: var(--accent); }
.wfp-err { color: #f4616b; }

/* ══ Role picker (registro) ════════════════════════════════════ */
.role-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.role-option { cursor: pointer; }
.role-option input[type="radio"] { display: none; }
.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 1.5px solid rgba(17,197,198,0.2);
  border-radius: 12px;
  background: rgba(8,28,36,0.5);
  transition: border-color var(--tr), background var(--tr), transform 0.1s;
  text-align: center;
}
.role-card:hover {
  border-color: rgba(17,197,198,0.5);
  background: rgba(17,197,198,0.07);
}
.role-option input:checked + .role-card {
  border-color: var(--accent);
  background: rgba(17,197,198,0.14);
  box-shadow: 0 0 14px rgba(17,197,198,0.2);
  transform: scale(1.03);
}
.role-icon { font-size: 1.6rem; line-height: 1; }
.role-name  { font-size: 0.76rem; font-weight: 600; color: var(--text); line-height: 1.2; }
@media (max-width: 400px) {
  .role-picker { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   TIER CAROUSEL (Sign Up — selector de plan con precios)
   ════════════════════════════════════════════════════════════════ */
.tier-picker-field > label { margin-bottom: 8px; display: block; }

.tier-carousel-outer {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.tier-carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
  /* Leave room for arrow buttons */
  padding-left: 2px;
  padding-right: 2px;
}
.tier-carousel::-webkit-scrollbar { display: none; }

/* Arrow buttons */
.tier-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(8,28,36,.85);
  border: 1px solid rgba(17,197,198,.3);
  color: rgba(255,255,255,.8);
  width: 28px;
  height: 44px;
  border-radius: 8px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tier-arrow:hover { background: rgba(17,197,198,.18); border-color: var(--accent); color: #fff; }
.tier-arrow--prev { left: 0; }
.tier-arrow--next { right: 0; }
/* Push carousel content away from arrows */
.tier-carousel { padding-left: 32px; padding-right: 32px; }

/* Individual tier card */
.tier-card {
  flex: 0 0 auto;
  width: 170px;
  scroll-snap-align: start;
  background: rgba(8,28,36,.6);
  border: 1.5px solid rgba(17,197,198,.18);
  border-radius: 14px;
  padding: 14px 12px 12px;
  cursor: pointer;
  user-select: none;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .12s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tier-card:hover {
  border-color: rgba(17,197,198,.5);
  background: rgba(17,197,198,.06);
}
.tier-card--selected {
  border-color: var(--accent);
  background: rgba(17,197,198,.1);
  box-shadow: 0 0 18px rgba(17,197,198,.22);
  transform: scale(1.02);
}
.tier-card--featured {
  border-color: rgba(251,191,36,.35);
  background: rgba(251,191,36,.05);
}
.tier-card--featured:hover { border-color: rgba(251,191,36,.65); }
.tier-card--featured.tier-card--selected {
  border-color: #fbbf24;
  background: rgba(251,191,36,.1);
  box-shadow: 0 0 18px rgba(251,191,36,.22);
}

/* Badge */
.tier-card-badge {
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%) translateY(-50%);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.tier-badge--green { background: rgba(74,222,128,.2); color: #4ade80; border: 1px solid rgba(74,222,128,.35); }
.tier-badge--gold  { background: rgba(251,191,36,.2);  color: #fbbf24; border: 1px solid rgba(251,191,36,.35); }

.tier-card-icon   { font-size: 1.5rem; line-height: 1; margin-top: 10px; }
.tier-card-name   { font-size: .75rem; font-weight: 700; color: #fff; line-height: 1.3; margin-top: 2px; }
.tier-card-price  { font-size: 1.35rem; font-weight: 800; color: var(--accent); line-height: 1; margin: 4px 0 2px; }
.tier-card--featured .tier-card-price { color: #fbbf24; }
.tier-card-period { font-size: .65rem; font-weight: 400; color: rgba(255,255,255,.5); }

/* Feature list */
.tier-card-feats {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tier-card-feats li {
  font-size: .7rem;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}
.tck { color: #4ade80; font-weight: 700; flex-shrink: 0; }
.tcx { color: rgba(255,255,255,.25); font-weight: 700; flex-shrink: 0; }
.tcn { color: #fbbf24; font-weight: 700; flex-shrink: 0; font-size: .75rem; }

/* ── Tier Dots (pagination indicators) ─────────────────────── */
.tier-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  min-height: 14px;
}
.tier-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(17,197,198,.22);
  border: 1px solid rgba(17,197,198,.35);
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s, border-color .2s;
  flex-shrink: 0;
}
.tier-dot:hover { background: rgba(17,197,198,.45); }
.tier-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.45);
}
/* Mobile: wider cards, center-snap, visible dots */
@media (max-width: 520px) {
  .tier-card {
    width: calc(80vw - 20px);
    min-width: 200px;
    max-width: 280px;
    scroll-snap-align: center;
  }
  .tier-carousel {
    scroll-snap-type: x mandatory;
    padding-left: 10%;
    padding-right: 10%;
    gap: 12px;
  }
  .tier-arrow { display: none; }
}

/* ── Payment sub-panel ─────────────────────────────────────── */
/* ════════════════════════════════════════════════════════════════
   TIER PAY PANEL — resumen de pago al seleccionar un plan
   ════════════════════════════════════════════════════════════════ */
.tier-pay-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .38s cubic-bezier(.4,0,.2,1), opacity .3s ease, margin .3s ease;
  margin-top: 0;
}
.tier-pay-panel.open {
  max-height: 420px;
  opacity: 1;
  margin-top: 14px;
}
.tier-pay-inner {
  background: rgba(4,18,24,.96);
  border: 1.5px solid rgba(17,197,198,.32);
  border-radius: 16px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 32px rgba(17,197,198,.1), 0 2px 12px rgba(0,0,0,.4);
}

/* Cabecera */
.tier-pay-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tier-pay-icon { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.tier-pay-info  { flex: 1; min-width: 0; }
.tier-pay-name  { font-size: .88rem; font-weight: 800; color: #fff; line-height: 1.2; }
.tier-pay-price-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.tier-pay-price { font-size: 1.2rem; font-weight: 900; color: var(--accent); line-height: 1; }
.tier-pay-badge {
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(74,222,128,.18);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,.3);
  white-space: nowrap;
}
.tier-pay-change-btn {
  background: transparent;
  border: 1px solid rgba(17,197,198,.35);
  color: rgba(17,197,198,.8);
  border-radius: 8px;
  font-size: .68rem;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.tier-pay-change-btn:hover { background: rgba(17,197,198,.12); color: #fff; }

/* Lista de features */
.tier-pay-feats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}
.tier-pay-feats li {
  font-size: .72rem;
  color: rgba(255,255,255,.72);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.35;
}
.tier-pay-feats .tck { color: #4ade80; font-weight: 700; flex-shrink: 0; font-size: .75rem; }

/* Divisor */
.tier-pay-divider {
  height: 1px;
  background: rgba(17,197,198,.12);
  border-radius: 1px;
}

/* Nota de facturación */
.tier-pay-note { font-size: .7rem; color: rgba(255,255,255,.4); margin: 0; line-height: 1.5; }

/* Seguridad */
.tier-pay-security {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: rgba(255,255,255,.45);
}
.tier-pay-security strong { color: rgba(255,255,255,.65); font-weight: 700; }
.tier-pay-cards { display: flex; gap: 3px; font-size: .9rem; margin-left: auto; }

/* CTA principal */
.tier-pay-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: linear-gradient(135deg, #11c5c6 0%, #0fa3a4 100%);
  border: none;
  border-radius: 12px;
  color: #041218;
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: opacity .15s, transform .12s, box-shadow .2s;
  box-shadow: 0 4px 18px rgba(17,197,198,.35);
  margin-top: 2px;
}
.tier-pay-cta:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(17,197,198,.45); }
.tier-pay-cta:active { transform: translateY(0); }
.tier-pay-cta--free { background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%); box-shadow: 0 4px 18px rgba(74,222,128,.3); color: #0a2010; }

/* ── Crypto CTA (tier-pay panel) ── */
.tier-pay-or {
  text-align: center; font-size: .65rem; color: rgba(255,255,255,.3);
  display: flex; align-items: center; gap: 10px; margin: 2px 0;
}
.tier-pay-or::before, .tier-pay-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.1); }
.tier-pay-cta--crypto {
  background: linear-gradient(135deg, #f7931a 0%, #e8a838 50%, #627eea 100%);
  box-shadow: 0 4px 18px rgba(247,147,26,.3);
  color: #fff;
}
.tier-pay-cta--crypto:hover { box-shadow: 0 6px 24px rgba(247,147,26,.45); }
.tier-pay-cta--crypto .crypto-icons { font-size: 1rem; letter-spacing: 2px; }
.tier-pay-crypto-note { font-size: .6rem; color: rgba(255,255,255,.3); text-align: center; margin: 0; }

/* Paywall crypto button */
.paywall-cta--crypto {
  background: linear-gradient(135deg, #f7931a 0%, #e8a838 50%, #627eea 100%) !important;
  color: #fff !important;
  margin-top: 8px;
  font-size: .82rem;
}

/* Nota cancelación */
.tier-pay-cancel-note { font-size: .65rem; color: rgba(255,255,255,.28); text-align: center; margin: 0; }

/* ════════════════════════════════════════════════════════════════
   PRICING PAY SHEET — bottom sheet al seleccionar plan en pricing
   ════════════════════════════════════════════════════════════════ */
.pricing-pay-sheet {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear .34s;
}
.pricing-pay-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s;
}

/* Fondo oscuro */
.pricing-pay-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  transition: opacity .28s ease;
  cursor: pointer;
}
.pricing-pay-sheet.is-open .pricing-pay-sheet-backdrop { opacity: 1; }

/* Tarjeta que sube */
.pricing-pay-sheet-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(4,16,22,.98);
  border: 1.5px solid rgba(17,197,198,.35);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 10px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,.5), 0 -2px 16px rgba(17,197,198,.12);
}
.pricing-pay-sheet.is-open .pricing-pay-sheet-card { transform: translateY(0); }

/* Drag handle */
.pricing-pay-sheet-drag {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  margin: 0 auto 6px;
  flex-shrink: 0;
}

/* Header */
.pps-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pps-icon  { font-size: 2rem; flex-shrink: 0; }
.pps-info  { flex: 1; min-width: 0; }
.pps-name  { font-size: 1rem; font-weight: 800; color: #fff; line-height: 1.2; }
.pps-price-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.pps-price { font-size: 1.4rem; font-weight: 900; color: var(--accent); line-height: 1; }
.pps-badge {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(74,222,128,.18);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,.3);
  white-space: nowrap;
}
.pps-close {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: .8rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.pps-close:hover { background: rgba(255,255,255,.16); color: #fff; }

/* Features */
.pps-feats {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 10px;
}
.pps-feats li {
  font-size: .76rem;
  color: rgba(255,255,255,.74);
  display: flex;
  align-items: center;
  gap: 5px;
}
.pps-feats .tck { color: #4ade80; font-weight: 700; flex-shrink: 0; }

/* Divider */
.pps-divider { height: 1px; background: rgba(17,197,198,.14); }

/* Nota */
.pps-note { font-size: .72rem; color: rgba(255,255,255,.4); margin: 0; line-height: 1.45; }

/* Seguridad */
.pps-security {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: rgba(255,255,255,.45);
}
.pps-security strong { color: rgba(255,255,255,.65); }
.pps-card-icons { margin-left: auto; font-size: .95rem; letter-spacing: 4px; }

/* CTA */
.pps-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  background: linear-gradient(135deg, #11c5c6 0%, #0da9aa 100%);
  border: none;
  border-radius: 14px;
  color: #041218;
  font-size: .96rem;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: opacity .15s, transform .12s, box-shadow .2s;
  box-shadow: 0 4px 22px rgba(17,197,198,.4);
}
.pps-cta:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 7px 28px rgba(17,197,198,.5); }
.pps-cta--free { background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%); box-shadow: 0 4px 22px rgba(74,222,128,.35); color: #041c0c; }

/* ── Crypto CTA (pricing pay sheet) ── */
.pps-or {
  text-align: center; font-size: .68rem; color: rgba(255,255,255,.3);
  display: flex; align-items: center; gap: 10px; margin: 2px 0;
}
.pps-or::before, .pps-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.1); }
.pps-cta--crypto {
  background: linear-gradient(135deg, #f7931a 0%, #e8a838 50%, #627eea 100%);
  box-shadow: 0 4px 22px rgba(247,147,26,.3);
  color: #fff;
}
.pps-cta--crypto:hover { box-shadow: 0 7px 28px rgba(247,147,26,.45); }
.pps-cta--crypto .crypto-icons { font-size: 1.05rem; letter-spacing: 2px; }
.pps-crypto-note { font-size: .62rem; color: rgba(255,255,255,.3); text-align: center; margin: 0; }

.pps-cancel { font-size: .65rem; color: rgba(255,255,255,.28); text-align: center; margin: 0; }

@media (max-width: 600px) {
  .pricing-pay-sheet-card { border-radius: 18px 18px 0 0; padding: 8px 16px 24px; }
  .pps-feats { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════ */
.primary-btn {
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--tr), transform 0.1s, box-shadow var(--tr);
  box-shadow: 0 4px 16px rgba(17,197,198,0.3);
}
.primary-btn:hover { background: var(--accent-dark); box-shadow: 0 6px 20px rgba(17,197,198,0.4); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.ghost-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr);
}
.ghost-btn:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.35); }

.back-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  margin-top: 2px;
  transition: color var(--tr);
}
.back-btn:hover { color: var(--accent); }

.danger-btn {
  width: 100%;
  max-width: 300px;
  padding: 13px 20px;
  background: transparent;
  border: 1px solid rgba(229,62,62,0.6);
  color: #fc8181;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background var(--tr), border-color var(--tr);
}
.danger-btn:hover { background: rgba(229,62,62,0.1); border-color: #fc8181; }

.modal-footer-actions {
  padding: 0 1rem 1rem;
  display: flex;
  justify-content: flex-end;
}
.modal-footer-actions .danger-btn {
  width: auto;
  max-width: none;
  padding: 10px 18px;
  font-size: .85rem;
}
.confirm-box {
  animation: fadeIn .2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════════
   SCREEN: AUTENTICACIÓN
   ════════════════════════════════════════════════════════════════ */
#screenAuth {
  background: #000;
  position: relative;
  overflow: hidden;
  width: 100vw;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
}

.auth-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.auth-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,28,36,0.56) 0%,
    rgba(8,28,36,0.76) 100%
  );
  z-index: 1;
}

.auth-layout {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Brand side */
.brand-side {
  padding: 0;
  max-width: 430px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-32px);
}

.auth-logo-img {
  width: 220px;
  height: 220px;
  position: relative;
  margin-bottom: 12px;
  flex-shrink: 0;
  overflow: visible;
}

.auth-logo-img.logo-live {
  animation: logoFloat 6s ease-in-out infinite alternate;
}

#authLayerEscudo {
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
#authLayerHuella {
  top: 29.9px;
  left: 61.4px;
  width: 97.7px;
  height: auto;
}
#authLayerCasa {
  top: 20.0px;
  left: 46.6px;
  width: 126.8px;
  height: auto;
}

#authLayerEscudo.anim-in {
  animation: authShieldForge 1.1s cubic-bezier(.22,1,.36,1) forwards;
}
#authLayerHuella.anim-in {
  animation: authHuellaBio 1.05s ease-out forwards;
}
#authLayerCasa.anim-in {
  animation: authCasaNeon 0.95s ease-out forwards;
}

/* Versiones auth sin transform de posición — el elemento no se mueve */
@keyframes authShieldForge {
  0%   { opacity:0; filter:blur(18px) brightness(7) hue-rotate(170deg); }
  8%   { opacity:1; filter:blur(8px)  brightness(4) hue-rotate(90deg); }
  26%  { filter:blur(3px)   brightness(2.8) hue-rotate(35deg); }
  55%  { filter:blur(0.6px) brightness(1.9) hue-rotate(8deg); }
  72%  { filter:blur(0)     brightness(2.6) hue-rotate(0deg); }
  87%  { filter:blur(0)     brightness(1.3); }
  100% { opacity:1; filter:blur(0) brightness(1); }
}
@keyframes authHuellaBio {
  0%   { opacity:0; clip-path:inset(52% 12% 52% 12%); filter:brightness(5) blur(4px); }
  15%  { opacity:1; clip-path:inset(38% 6%  38% 6%);  filter:brightness(3.5) blur(1.5px); }
  42%  { clip-path:inset(14% 1%  14% 1%);  filter:brightness(2.1) blur(0); }
  68%  { clip-path:inset(4%  0%  4%  0%);  filter:brightness(1.5); }
  85%  { clip-path:inset(0 0 0 0);         filter:brightness(2.2); }
  100% { opacity:1; clip-path:inset(0 0 0 0); filter:brightness(1); }
}
@keyframes authCasaNeon {
  0%   { opacity:0;   filter:blur(6px) brightness(9); }
  5%   { opacity:0.9; filter:blur(1px) brightness(6); }
  10%  { opacity:0.05; }
  17%  { opacity:1;   filter:brightness(4.5); }
  23%  { opacity:0.3; }
  31%  { opacity:1;   filter:brightness(3); }
  42%  { opacity:0.75; }
  56%  { opacity:1;   filter:brightness(1.9); }
  100% { opacity:1;   filter:brightness(1); }
}
#authLayerEscudo.logo-live {
  animation: escudoGlow 4.5s ease-in-out infinite alternate !important;
  opacity: 1 !important;
  filter: brightness(1) !important;
}
#authLayerHuella.logo-live {
  animation: huellaPulse 3.5s ease-in-out 0.3s infinite alternate !important;
  opacity: 1;
}
#authLayerCasa.logo-live { opacity: 1; }

.brand-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.brand-name {
  font-size: 2.45rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.7px;
}
.brand-desc {
  max-width: 340px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 2px;
}

/* Auth card */
.auth-card {
  width: 100%;
  max-width: 410px;
  background: rgba(8,28,36,0.58);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px 22px;
  box-shadow: var(--shadow);
  transform: translateY(-28px);
  box-sizing: border-box;
}

.auth-editor-toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(17,197,198,0.42);
  background: rgba(8,28,36,0.72);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.auth-editor-toggle:hover {
  border-color: var(--accent);
  color: #fff;
}

.auth-editor-overlay {
  z-index: 20;
}

.auth-editor-card {
  width: 400px;
  max-width: calc(100vw - 24px);
}

.auth-editor-note {
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.editor-grid {
  display: grid;
  gap: 10px;
}

.editor-grid .field input {
  font-variant-numeric: tabular-nums;
}

.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.editor-actions .primary-btn,
.editor-actions .ghost-btn {
  flex: 1;
}

/* ── Tabs ──────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: color var(--tr), border-color var(--tr);
  margin-bottom: -1px;
}
.tab.is-active  { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover:not(.is-active) { color: var(--text); }

/* ── Forms ─────────────────────────────────────────────────────── */
.form { display: none; flex-direction: column; gap: 11px; }
.form.is-active { display: flex; }

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

.field label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.94rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17,197,198,0.12);
}
.field input::placeholder { color: rgba(224,240,242,0.28); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Status box ────────────────────────────────────────────────── */
.status {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.4;
}
.status.is-error { background: rgba(229,62,62,0.14); color: #fc8181; border: 1px solid rgba(229,62,62,0.28); }
.status.is-ok    { background: rgba(73,229,122,0.1);  color: #68d391; border: 1px solid rgba(73,229,122,0.28); }

/* ════════════════════════════════════════════════════════════════
   SCREEN: DASHBOARD
   ════════════════════════════════════════════════════════════════ */
#screenDashboard {
  background: var(--bg-deep);
  overflow-y: auto;
}

/* ── Dash Header ────────────────────────────────────────────────── */
.dash-header {
  background: linear-gradient(135deg, var(--accent) 0%, #0D5C63 55%, #094050 100%);
  padding: 16px 90px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.dash-header-user {
  display: flex;
  align-items: center;
  gap: 13px;
}

.avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  flex-shrink: 0;
}

.dash-username { font-weight: 700; font-size: 1rem; color: #fff; }
.dash-email    { font-size: 0.77rem; color: rgba(255,255,255,0.7); margin-top: 2px; }

/* ── Dash Tabs ──────────────────────────────────────────────────── */
.dash-tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }

.dash-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  color: var(--text-muted);
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--tr), border-color var(--tr);
  flex-shrink: 0;
  margin-bottom: -1px;
}
.dash-tab.is-active  { color: var(--accent); border-bottom-color: var(--accent); }
.dash-tab:hover:not(.is-active) { color: var(--text); }

/* ── Dash Content ───────────────────────────────────────────────── */
.dash-content { flex: 1; }

.tab-panel { display: none; padding: 22px 20px; }
.tab-panel.is-active { display: block; }
#tabMarketplace { padding: 0; }

/* ════════════════════════════════════════════════════════════════
   TAB: AGREGAR — Feature Cards
   ════════════════════════════════════════════════════════════════ */
.feature-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 580px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   HOME DASHBOARD — nuevo layout  (hd-*)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Greeting bar ── */
.hd-greeting-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.25rem;
  background: linear-gradient(135deg, rgba(15,46,60,.95) 0%, rgba(9,31,45,.9) 100%);
  border: 1px solid rgba(17,197,198,.18);
  border-radius: 12px;
  margin-bottom: 10px;
}
.hd-gb-left {
  display: flex;
  align-items: center;
  gap: .8rem;
}
.hd-gb-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #11c5c6 0%, #0e9b9c 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(17,197,198,.25);
}
.hd-gb-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #f1f5f9);
  line-height: 1.2;
}
.hd-gb-sub {
  font-size: .75rem;
  color: var(--text-muted, #64748b);
  margin-top: .1rem;
}
.hd-gb-right {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.hd-score-badge {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  border: 1px solid;
  cursor: default;
}
.hd-score-badge.level-bronze { background: rgba(180,100,40,.15); border-color: rgba(180,100,40,.4); color: #cd7f32; }
.hd-score-badge.level-silver { background: rgba(160,163,172,.12); border-color: rgba(160,163,172,.4); color: #b0b3bc; }
.hd-score-badge.level-gold   { background: rgba(212,175,55,.14);  border-color: rgba(212,175,55,.4);  color: #f4c430; }
.hd-score-badge.level-diamond{ background: rgba(99,102,241,.14);  border-color: rgba(99,102,241,.4);  color: #a5b4fc; }
.hd-score-label { display: flex; flex-direction: column; line-height: 1.15; }
.hd-score-level { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.hd-score-pct   { font-size: .92rem; font-weight: 800; }
.hd-gb-date {
  font-size: .78rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

/* ── KPI strip ── */
.hd-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.hd-kpi-chip {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, rgba(15,46,60,.9), rgba(9,31,45,.85));
  border: 1px solid rgba(17,197,198,.15);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.hd-kpi-chip::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.hd-kpi-chip.is-green::before  { background: #22c55e; }
.hd-kpi-chip.is-red::before    { background: #f87171; }
.hd-kpi-chip.is-yellow::before { background: #fbbf24; }
.hd-kpi-chip.is-teal::before   { background: #11c5c6; }
.hd-kpi-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted, #64748b);
}
.hd-kpi-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text, #f1f5f9);
  line-height: 1.1;
}
.hd-kpi-bar-wrap {
  height: 5px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: .15rem;
}
.hd-kpi-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease;
}

/* ── Body layout ── */
.hd-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

/* ── Sidebar ── */
.hd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Quick section ── */
.hd-quick-section {
  background: linear-gradient(135deg, rgba(15,46,60,.9), rgba(9,31,45,.85));
  border: 1px solid rgba(17,197,198,.15);
  border-radius: 12px;
  padding: .85rem;
}
.hd-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted, #64748b);
  margin: 0 0 .65rem;
}
.hd-qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
}
.hd-qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .7rem .3rem .6rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;
  cursor: pointer;
  transition: background .18s, border-color .18s, transform .15s;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}
.hd-qa-btn:hover {
  background: rgba(17,197,198,.1);
  border-color: rgba(17,197,198,.35);
  transform: translateY(-1px);
}
.hd-qa-btn:active { transform: scale(.97); }
.hd-qa-icon {
  width: 28px; height: 28px;
  background: rgba(17,197,198,.12);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #11c5c6;
}
.hd-qa-icon svg { width: 15px; height: 15px; }
.hd-qa-btn span {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Inbox inside sidebar ── */
.hd-sidebar .home-inbox {
  grid-column: unset;
  max-height: 260px;
}
.hd-sidebar .home-inbox .inbox-list {
  max-height: 190px;
}

/* ── Invite inside sidebar ── */
.hd-sidebar .home-invite-section {
  grid-column: unset;
}

/* ── Performance section ── */
.home-performance-summary {
  grid-area: unset;
  border: 1px solid rgba(17,197,198,.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15,46,60,.95), rgba(9,31,45,.95));
  padding: 0;
  overflow: hidden;
}
.perf-inner {
  padding: 1rem 1.25rem;
}
.perf-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.perf-body-grid .perf-section {
  border-right: 1px solid rgba(255,255,255,.05);
  padding-right: 1rem;
}
.perf-body-grid .perf-section:nth-child(2n) {
  border-right: none;
  padding-right: 0;
}
.perf-collection-bar {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.pcb-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}
.pcb-bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.07);
  border-radius: 4px;
  overflow: hidden;
}
.pcb-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .7s ease;
}
.pcb-pct {
  font-size: .85rem;
  font-weight: 800;
  min-width: 38px;
  text-align: right;
}

/* ── Performance section overrides for new layout ── */
.perf-summary-head {
  padding: .9rem 1.25rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* ── Map section ── */
.home-map-section {
  border: 1px solid rgba(17,197,198,.15);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15,46,60,.9), rgba(9,31,45,.85));
  overflow: hidden;
}

/* ── Old home-top-grid (kept for compat but not used) ── */
.home-top-grid {
  display: grid;
  grid-template-columns: minmax(340px, 580px) minmax(320px, 1fr);
  gap: 12px;
  align-items: start;
}

/* ── Inbox (base styles — used both in sidebar and standalone) ── */
.home-inbox {
  grid-column: 1 / -1;
  border: 1px solid rgba(17,197,198,0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,46,60,0.95), rgba(9,31,45,0.95));
  padding: 0;
  overflow: hidden;
}
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid rgba(148,163,184,.1);
}
.inbox-header-left {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.inbox-header-left h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
}
.inbox-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 20px;
  background: rgba(239,68,68,.2);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.3);
}
.inbox-count {
  font-size: .75rem;
  color: #64748b;
}
.inbox-list {
  max-height: 360px;
  overflow-y: auto;
}
.inbox-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  padding: .75rem 1.2rem;
  border-bottom: 1px solid rgba(148,163,184,.06);
  transition: background .15s;
}
.inbox-item:hover { background: rgba(99,102,241,.04); }
.inbox-item.is-unread {
  background: rgba(99,102,241,.06);
  border-left: 3px solid #6366f1;
}
.inbox-item-left {
  display: flex;
  gap: .7rem;
  min-width: 0;
  flex: 1;
}
.inbox-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(99,102,241,.18);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.inbox-item-body { min-width: 0; flex: 1; }
.inbox-item-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .15rem;
}
.inbox-sender {
  font-size: .82rem;
  font-weight: 700;
  color: #f1f5f9;
}
.inbox-type-tag {
  font-size: .62rem;
  font-weight: 600;
  padding: .1rem .4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.inbox-tag--visit {
  background: rgba(34,197,94,.14);
  color: #22c55e;
}
.inbox-tag--msg {
  background: rgba(59,130,246,.14);
  color: #60a5fa;
}
.inbox-property {
  font-size: .72rem;
  color: #94a3b8;
  margin-bottom: .2rem;
}
.inbox-preview {
  font-size: .78rem;
  color: #cbd5e1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.inbox-phone, .inbox-email {
  font-size: .7rem;
  color: #64748b;
  margin-top: .15rem;
}
.inbox-item-right {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
}
.inbox-time {
  font-size: .68rem;
  color: #475569;
  white-space: nowrap;
}
.inbox-actions {
  display: flex;
  gap: .3rem;
}
.inbox-action-btn {
  background: none;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 6px;
  padding: .2rem .35rem;
  font-size: .72rem;
  cursor: pointer;
  color: #94a3b8;
  transition: background .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.inbox-action-btn:hover {
  background: rgba(148,163,184,.1);
  color: #e2e8f0;
}
.inbox-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #64748b;
}
.inbox-empty-icon { font-size: 2rem; margin-bottom: .4rem; }
.inbox-empty strong { display: block; color: #94a3b8; font-size: .9rem; margin-bottom: .3rem; }
.inbox-empty p { font-size: .8rem; margin: 0; max-width: 320px; margin-inline: auto; line-height: 1.5; }
.inbox-more {
  text-align: center;
  font-size: .72rem;
  color: #475569;
  padding: .6rem;
  border-top: 1px solid rgba(148,163,184,.06);
}


.perf-summary-head h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.perf-summary-head p {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.perf-kpi-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.perf-kpi {
  border: 1px solid rgba(17,197,198,0.16);
  border-radius: 10px;
  background: rgba(8,28,36,0.55);
  padding: 10px;
}

.perf-kpi span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.perf-kpi strong {
  display: block;
  margin-top: 3px;
  font-size: 1.05rem;
  color: var(--accent);
}

.perf-section {
  margin-top: 10px;
}

.perf-section-title {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.perf-list {
  display: grid;
  gap: 6px;
}

.perf-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(17,197,198,0.14);
  border-radius: 9px;
  background: rgba(8,28,36,0.52);
  padding: 8px 9px;
}

.perf-item.is-alert {
  border-color: rgba(246,173,85,0.45);
  background: rgba(246,173,85,0.08);
}

.perf-item-name {
  font-size: 0.84rem;
  color: var(--text);
  font-weight: 700;
}

.perf-item-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.perf-item-value {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
  text-align: right;
}

.perf-summary-empty {
  display: grid;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.perf-summary-empty strong {
  color: var(--text);
}

.home-map-section {
  grid-area: map;
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,46,60,0.9), rgba(10,34,45,0.88));
  padding: 12px;
}

/* ══════════════════════════════════════════════════════════
   HOME INVITE — Widget de invitaciones desde Inicio
   ══════════════════════════════════════════════════════════ */
.home-invite-section {
  grid-column: 1 / -1;
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20,14,50,0.97), rgba(12,8,38,0.95));
  overflow: hidden;
}
.home-invite-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid rgba(124,58,237,0.18);
}
.home-invite-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
  flex: 1;
}
.home-invite-toggle {
  background: transparent;
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 6px;
  color: #a78bfa;
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.home-invite-toggle:hover { background: rgba(124,58,237,0.15); color: #c4b5fd; }
.home-invite-body {
  padding: 1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.home-invite-body.is-hidden { display: none; }

/* Type pills */
.hi-type-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.hi-type-pill {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: .55rem .8rem;
  border-radius: 8px;
  border: 1px solid rgba(124,58,237,0.25);
  background: rgba(124,58,237,0.06);
  color: #94a3b8;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1.3;
}
.hi-type-pill span.hi-pill-desc {
  display: block;
  font-size: .7rem;
  font-weight: 400;
  color: #64748b;
  margin-top: 2px;
}
.hi-type-pill:hover,
.hi-type-pill.is-active {
  border-color: #7c3aed;
  background: rgba(124,58,237,0.2);
  color: #c4b5fd;
}
.hi-type-pill.is-active span.hi-pill-desc { color: #a78bfa; }

/* Inputs */
.hi-label {
  font-size: .78rem;
  font-weight: 600;
  color: #94a3b8;
  display: block;
  margin-bottom: 4px;
}
.hi-input, .hi-select, .hi-textarea {
  width: 100%;
  padding: .55rem .8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.hi-input:focus, .hi-select:focus, .hi-textarea:focus {
  border-color: #7c3aed;
}
.hi-input::placeholder, .hi-textarea::placeholder { color: #475569; }
.hi-select option { background: #0f172a; color: #e2e8f0; }
.hi-textarea { resize: vertical; min-height: 64px; }

/* Send button */
.hi-send-btn {
  padding: .65rem 1.4rem;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
  align-self: flex-start;
}
.hi-send-btn:hover:not(:disabled) { filter: brightness(1.12); }
.hi-send-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Feedback */
.hi-feedback {
  font-size: .82rem;
  padding: .4rem .7rem;
  border-radius: 6px;
  background: rgba(124,58,237,0.08);
}
.hi-feedback.is-ok  { color: #4ade80; background: rgba(74,222,128,.08); }
.hi-feedback.is-err { color: #f87171; background: rgba(248,113,113,.08); }

.home-map-head h3 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
}

.home-map-head p {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Contracts & Compliance ─────────────────────────────────── */
.contracts-grid {
  display: grid;
  grid-template-columns: minmax(340px, 520px) minmax(320px, 1fr);
  gap: 12px;
  align-items: start;
}

.contracts-card {
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,46,60,0.9), rgba(10,34,45,0.88));
  padding: 12px;
  margin-top: 12px;
}

.contracts-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.contracts-card p {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contracts-kpi-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.contracts-kpi {
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: 12px;
  background: rgba(8,28,36,0.65);
  padding: 14px 14px 12px;
  transition: border-color .2s, box-shadow .2s;
}
.contracts-kpi:hover {
  border-color: rgba(17,197,198,0.35);
  box-shadow: 0 4px 16px rgba(17,197,198,0.06);
}

.contracts-kpi span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.contracts-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

/* KPI status variants */
.contracts-kpi.crf-status-pending strong { color: #f6c575; }
.contracts-kpi.crf-status-pending { border-color: rgba(246,173,85,0.3); }
.contracts-kpi.crf-status-approved strong { color: var(--green, #49E57A); }
.contracts-kpi.crf-status-approved { border-color: rgba(73,229,122,0.3); }
.contracts-kpi.crf-status-rejected strong { color: #fda4a4; }
.contracts-kpi.crf-status-rejected { border-color: rgba(239,68,68,0.3); }

/* Active badge for contracts */
.contract-badge.is-active {
  border-color: rgba(73,229,122,0.45);
  color: var(--green, #49E57A);
  background: rgba(73,229,122,0.12);
}

.contracts-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.contract-row {
  border: 1px solid rgba(17,197,198,0.14);
  border-radius: 10px;
  background: rgba(8,28,36,0.52);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  transition: border-color .2s;
}
.contract-row:hover { border-color: rgba(17,197,198,0.28); }

.contract-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.contract-row-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.contract-row-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.5;
}

.contract-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(17,197,198,0.2);
  color: var(--accent);
  background: rgba(17,197,198,0.1);
}

.contract-badge.is-warning {
  border-color: rgba(246,173,85,0.45);
  color: #f6c575;
  background: rgba(246,173,85,0.12);
}

.contract-badge.is-danger {
  border-color: rgba(239,68,68,0.45);
  color: #fda4a4;
  background: rgba(239,68,68,0.12);
}

.contract-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.contract-actions .secondary-btn,
.contract-actions .ghost-btn {
  padding: 6px 10px;
  font-size: 0.76rem;
}

/* ── Botones de acción en cards visualizador ── */
.ctr-vis-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 2px;
}
.ctr-vis-btn {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(17,197,198,0.3);
  background: rgba(17,197,198,0.08);
  color: var(--accent);
  cursor: pointer;
  transition: background .18s, border-color .18s;
  white-space: nowrap;
}
.ctr-vis-btn:hover {
  background: rgba(17,197,198,0.18);
  border-color: rgba(17,197,198,0.5);
}
.ctr-vis-btn--danger {
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.06);
  color: #fda4a4;
}
.ctr-vis-btn--danger:hover {
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.5);
}

/* ══ Visualizador de contratos por inquilino ══════════════════════ */
.ctr-vis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ctr-vis-card {
  background: rgba(8,28,36,0.7);
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: 14px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.ctr-vis-card:hover {
  border-color: rgba(17,197,198,0.42);
  box-shadow: 0 6px 24px rgba(17,197,198,0.1);
  transform: translateY(-1px);
}
.ctr-vis-card.ctr-vis-expiring {
  border-color: rgba(246,173,85,0.35);
  background: rgba(246,173,85,0.04);
}
.ctr-vis-card.ctr-vis-expired {
  border-color: rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.03);
  opacity: .8;
}

.ctr-vis-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ctr-vis-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(17,197,198,0.3), rgba(17,197,198,0.1));
  border: 2px solid rgba(17,197,198,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(17,197,198,0.18);
}
.ctr-vis-meta { flex: 1; min-width: 0; }
.ctr-vis-tenant {
  font-size: .95rem; font-weight: 700;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctr-vis-prop {
  font-size: .73rem; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctr-vis-prop em { font-style: normal; color: var(--accent); }

.ctr-vis-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ctr-vis-stat {
  background: rgba(17,197,198,0.04);
  border: 1px solid rgba(17,197,198,0.1);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex; flex-direction: column; gap: 3px;
}
.ctr-vis-stat span { font-size: .62rem; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); font-weight: 600; }
.ctr-vis-stat strong { font-size: .9rem; color: var(--text); font-weight: 700; }
.ctr-vis-stat strong small { font-size: .7rem; font-weight: 400; opacity: .65; }

.ctr-vis-progress-wrap {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.ctr-vis-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), rgba(17,197,198,0.55));
  border-radius: 99px;
  transition: width .5s ease;
  box-shadow: 0 0 8px rgba(17,197,198,0.3);
}
.ctr-vis-expiring .ctr-vis-progress-bar { background: linear-gradient(90deg, #f6ad55, #f6c575); }
.ctr-vis-expired  .ctr-vis-progress-bar { background: rgba(239,68,68,0.5); }

.ctr-vis-progress-label {
  display: flex; justify-content: space-between;
  font-size: .63rem; color: var(--text-muted);
  margin-top: -4px;
}

/* Sección de vencidos colapsable */
.ctr-expired-details {
  margin-top: 16px;
}
.ctr-expired-details summary {
  cursor: pointer;
  font-size: .8rem;
  color: var(--text-muted);
  padding: 8px 4px;
  list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.ctr-expired-details summary::before {
  content: '▶';
  font-size: .65rem;
  transition: transform .2s;
}
.ctr-expired-details[open] summary::before { transform: rotate(90deg); }
.ctr-vis-grid--expired { opacity: .7; }
/* ════════════════════════════════════════════════════════════════ */

.home-map-message {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.home-map-canvas {
  margin-top: 10px;
  width: 100%;
  height: 360px;
  border-radius: 12px;
  border: 1px solid rgba(17,197,198,0.24);
  overflow: hidden;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), transform 0.15s;
  user-select: none;
}
.feature-card:not(.coming-soon):hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}
.feature-card:not(.coming-soon):active { transform: scale(0.99); }
.feature-card.coming-soon { cursor: default; opacity: 0.65; }

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: rgba(17,197,198,0.1);
  border: 1px solid rgba(17,197,198,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg { width: 24px; height: 24px; color: var(--accent); }

.feature-card > div:not(.feature-icon) { flex: 1; }
.feature-card h3 { font-size: 0.98rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.feature-card p  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }

.feature-arrow { font-size: 1.5rem; color: var(--accent); font-weight: 700; flex-shrink: 0; line-height: 1; }

.secondary-btn {
  width: auto;
  padding: 9px 12px;
  background: rgba(17,197,198,0.1);
  color: var(--accent);
  border: 1px solid rgba(17,197,198,0.35);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr);
}
.secondary-btn:hover { background: rgba(17,197,198,0.18); border-color: var(--accent); }

.soon-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   TAB: DIRECTORIO — Stats Grid
   ════════════════════════════════════════════════════════════════ */
.stat-card {
  background: rgba(17,197,198,0.08);
  border: 1px solid rgba(17,197,198,0.14);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat-card.full-width { grid-column: 1 / -1; }

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
  line-height: 1;
}
.stat-card.full-width .stat-value {
  font-size: 1.25rem;
  color: var(--accent);
}

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}
.section-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: -4px 0 16px;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 6px;
}
.section-title-row .section-title { margin-bottom: 0; }

.crf-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 4px;
  line-height: 1.5;
  max-width: 700px;
}

.add-inline-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(17,197,198,0.1);
  border: 1px solid rgba(17,197,198,0.3);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr);
  flex-shrink: 0;
}
.add-inline-btn:hover { background: rgba(17,197,198,0.18); border-color: var(--accent); }

/* ════════════════════════════════════════════════════════════════
   PROPERTY MANAGEMENT — Directory tab
   ════════════════════════════════════════════════════════════════ */

/* ── Header ── */
.dir-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dir-header-left {
  flex: 1;
  min-width: 200px;
}
.dir-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.3;
}
.dir-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  max-width: 480px;
}

/* ── Inline i18n selector for dashboard ── */
.dir-i18n {
  position: relative;
  flex-shrink: 0;
}
.dir-i18n .i18n-toggle {
  background: var(--surface);
  backdrop-filter: none;
  border-color: var(--border);
  box-shadow: none;
}
.dir-i18n .i18n-toggle:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.2);
}
.dir-i18n .i18n-dropdown {
  background: var(--surface);
  backdrop-filter: none;
  border-color: var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* ── Actions row ── */
.dir-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dir-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #081C24;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--tr), transform var(--tr), box-shadow var(--tr);
  line-height: 1;
}
.dir-add-btn svg {
  flex-shrink: 0;
}
.dir-add-btn:hover {
  background: #15d8d9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(17,197,198,0.3);
}
.dir-add-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.dir-add-btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.dir-add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Delete button (secondary/destructive) ── */
.dir-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(232,80,80,0.25);
  border-radius: var(--radius-sm);
  color: rgba(232,80,80,0.7);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tr), border-color var(--tr), color var(--tr);
  line-height: 1;
}
.dir-delete-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.dir-delete-btn:hover {
  background: rgba(232,80,80,0.08);
  border-color: rgba(232,80,80,0.5);
  color: #e85050;
}
.dir-delete-btn:hover svg { opacity: 1; }
.dir-delete-btn:focus-visible {
  outline: 2px solid #e85050;
  outline-offset: 2px;
}
.dir-delete-btn:active {
  background: rgba(232,80,80,0.15);
}
.dir-delete-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

/* ── Properties section header ── */
.dir-props-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dir-props-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.dir-props-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Responsive property grid ── */
.property-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
  width: 100%;
}

@media (min-width: 1024px) {
  .property-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1400px) {
  .property-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 600px) {
  .property-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Property card (tile) ── */
.property-tile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--tr), background var(--tr), transform var(--tr), box-shadow var(--tr);
  overflow: hidden;
  text-align: left;
}
.property-tile:hover {
  border-color: rgba(17,197,198,0.35);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.property-tile:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.property-tile:active {
  transform: translateY(0);
  box-shadow: none;
  border-color: var(--primary);
}

/* ── Property card icon ── */
.property-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 0;
}
.property-tile-icon svg {
  width: 36px;
  height: 36px;
  color: var(--primary);
  opacity: 0.8;
}

/* ── Property card body ── */
.property-tile-body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.property-tile-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.property-tile-address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-tile-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ── Metrics grid ── */
.property-tile-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  text-align: center;
}
.metric-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.metric-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Card CTA ── */
.property-tile-cta {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--tr);
}
.property-tile:hover .property-tile-cta {
  gap: 8px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-state strong {
  display: block;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ─── Delete button inside each property tile ─── */
.property-tile-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(231,76,60,0.4);
  background: rgba(0,0,0,0.55);
  color: #e74c3c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  opacity: 0;
  z-index: 2;
}
.property-tile:hover .property-tile-delete-btn {
  opacity: 1;
}
.property-tile-delete-btn:hover {
  background: rgba(231,76,60,0.25);
  border-color: #e74c3c;
}
.property-tile {
  position: relative;
}

/* ─── Photo gallery in Property Details modal ─── */
.prop-photo-section {
  margin: 18px 0 4px;
}
.prop-photo-section-title {
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.prop-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.prop-photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(17,197,198,0.06);
  border: 1.5px solid var(--border);
}
.prop-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prop-photo-item.is-cover {
  border: 2px solid var(--accent);
}
.prop-photo-item.is-cover::before {
  content: '★ Cover';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17,197,198,0.82);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  padding: 2px 0;
  line-height: 1.4;
}
.prop-photo-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
}
.prop-photo-btn {
  background: rgba(0,0,0,0.65);
  border: none;
  color: #fff;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.prop-photo-btn:hover { background: rgba(0,0,0,0.9); }
.prop-photo-btn.set-cover { color: var(--accent); }
.prop-photo-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1.5px dashed rgba(17,197,198,0.40);
  color: var(--accent);
  font-size: .76rem;
  cursor: pointer;
  min-height: 100px;
  background: transparent;
  transition: background var(--tr), border-color var(--tr);
}
.prop-photo-upload-btn:hover {
  background: rgba(17,197,198,0.08);
  border-color: var(--accent);
}
.prop-photo-upload-btn input[type=file] { display: none; }
.prop-photo-upload-icon { font-size: 1.5rem; }
.prop-photo-count {
  font-size: .74rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Tarjeta de propiedad en directorio */
.property-dir-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.property-dir-card h4 { font-size: 1rem; font-weight: 700; color: var(--text); }
.prop-address { font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; margin-bottom: 10px; }
.prop-stats   { display: flex; gap: 16px; flex-wrap: wrap; }
.prop-stat    { font-size: 0.82rem; color: var(--text-muted); }
.prop-stat strong { color: var(--text); }
.prop-rent    { margin-top: 8px; font-size: 0.94rem; font-weight: 700; color: var(--accent); }

/* Unidades en directorio */
.unit-list-dir {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(17,197,198,0.07);
  gap: 8px;
}
.unit-row:last-child { border-bottom: none; }
.unit-row-name   { font-size: 0.87rem; color: var(--text); font-weight: 500; flex: 1; }
.unit-row-tenant { font-size: 0.8rem; color: var(--text-muted); flex: 1; text-align: center; }

.unit-pill {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  flex-shrink: 0;
}
.unit-pill.is-free     { background: rgba(73,229,122,0.12); color: #68d391; }
.unit-pill.is-occupied { background: rgba(17,197,198,0.12); color: var(--accent); }
.unit-pill.is-reserved { background: rgba(246,173,85,0.12);  color: #f6ad55; }

/* ════════════════════════════════════════════════════════════════
   TAB: CUENTA
   ════════════════════════════════════════════════════════════════ */
.account-info { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; max-width: 500px; }

.account-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.account-row-icon  { color: var(--accent); flex-shrink: 0; }
.account-row-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.account-row-value { font-size: 0.94rem; color: var(--text); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════
   MODALES — Bottom sheet igual al Navigator.push de Flutter
   ════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,15,20,0.75);
  z-index: 200;
  display: block;
  backdrop-filter: blur(5px);
}
.modal-overlay[hidden] { display: none !important; }

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid rgba(17,197,198,0.35);
  border-radius: var(--radius);
  padding: 26px 24px;
  width: min(520px, calc(100vw - 32px));
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65);
  animation: modalIn 0.24s cubic-bezier(0.32,0.72,0,1);
}

.modal-card-wide {
  max-width: 820px;
  width: min(820px, calc(100vw - 32px));
}

@keyframes modalIn {
  from { transform: translate(-50%, -46%) scale(0.96); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.08rem; font-weight: 800; }

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--tr), color var(--tr);
}
.modal-close:hover { background: rgba(255,255,255,0.14); color: var(--text); }

.modal-form { display: flex; flex-direction: column; gap: 14px; }

/* ── Form cards: layout en grid de 3 columnas con secciones ── */
.form-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: start;
}
.form-card {
  background: rgba(10,30,42,0.75);
  border: 1px solid rgba(17,197,198,0.16);
  border-radius: 12px;
  padding: 16px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s, box-shadow .15s;
}
.form-card:focus-within {
  border-color: rgba(17,197,198,0.38);
  background: rgba(15,44,60,0.82);
  box-shadow: 0 4px 16px rgba(17,197,198,0.06);
}
.form-card-title {
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin: 0 0 2px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(17,197,198,0.14);
  flex-shrink: 0;
}
.fc-span-2 { grid-column: span 2; }
.fc-span-3 { grid-column: span 3; }
.fc-2col   { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fc-3col   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
/* Inputs dentro de cards: quitar padding excesivo */
.form-card .field input,
.form-card .field select {
  padding: 8px 10px;
  font-size: .88rem;
}
@media (max-width: 620px) {
  .form-cards  { grid-template-columns: 1fr; }
  .fc-span-2, .fc-span-3 { grid-column: span 1; }
  .fc-2col, .fc-3col { grid-template-columns: 1fr; }
}

/* Modal más ancho para formularios con cards */
.modal-card-cards {
  max-width: 680px;
  width: min(680px, calc(100vw - 32px));
}

.property-edit-form {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(17,197,198,0.05);
}

.details-header-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.details-kpi {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(17,197,198,0.06);
}

.details-kpi-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  font-weight: 700;
}

.details-kpi-value {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 800;
  margin-top: 3px;
}

.unit-detail-list {
  display: grid;
  gap: 10px;
}

.unit-detail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(15,46,60,0.75);
}

.unit-detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.unit-detail-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.unit-detail-sub {
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.unit-detail-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.unit-detail-item {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.unit-detail-item strong {
  color: var(--text);
}

.unit-edit-toggle {
  margin-top: 10px;
}

.unit-edit-form {
  margin-top: 12px;
  border-top: 1px dashed rgba(17,197,198,0.22);
  padding-top: 12px;
}

.unit-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.unit-edit-checkbox {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.unit-edit-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.unit-edit-actions .primary-btn {
  width: auto;
  min-width: 150px;
}

.tenant-footprint-form {
  margin-top: 10px;
  border-top: 1px dashed rgba(17,197,198,0.2);
  padding-top: 10px;
}

.tenant-footprint-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}

.tenant-footprint-form textarea {
  width: 100%;
  min-height: 78px;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  resize: vertical;
  font-family: inherit;
}

.tenant-footprint-meta {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-search-form {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.history-search-form select,
.history-search-form input {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.history-block {
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(17,197,198,0.16);
  border-radius: var(--radius);
  background: rgba(10,34,45,0.45);
}

.history-layout {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 18px;
  align-items: start;
}

/* ── History mode selector (3 cards at top) ─────────────────────────── */
.history-mode-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.history-mode-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(11,35,51,0.82), rgba(8,28,36,0.75));
  border: 1.5px solid rgba(17,197,198,0.2);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--tr), background var(--tr), color var(--tr), transform var(--tr);
  position: relative;
  overflow: hidden;
}

.history-mode-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.history-mode-btn:hover {
  border-color: rgba(17,197,198,0.38);
  background: rgba(17,197,198,0.07);
  color: var(--text);
  transform: translateY(-2px);
}

.history-mode-btn.is-active {
  border-color: rgba(17,197,198,0.55);
  background: linear-gradient(180deg, rgba(17,197,198,0.14), rgba(17,197,198,0.06));
  color: var(--accent);
}

.history-mode-btn.is-active::before {
  transform: scaleX(1);
}

.history-mode-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(17,197,198,0.1);
  border: 1px solid rgba(17,197,198,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--tr), border-color var(--tr);
}

.history-mode-btn.is-active .history-mode-icon {
  background: rgba(17,197,198,0.2);
  border-color: rgba(17,197,198,0.5);
}

.history-mode-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-mode-copy strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  color: inherit;
}

.history-mode-copy small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── History search row (inline input) ──────────────────────────────── */
.history-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(8,28,36,0.6);
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  color: var(--text-muted);
}

.history-search-row svg { flex-shrink: 0; }

.history-search-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.92rem;
  min-width: 0;
}

.history-search-row input::placeholder { color: var(--text-muted); }

.history-nav {
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,46,60,0.86), rgba(10,34,45,0.82));
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
  position: sticky;
  top: 18px;
}

.history-nav-card {
  border: 1px solid rgba(17,197,198,0.16);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(11,35,51,0.75), rgba(8,28,36,0.68));
  padding: 8px;
}

.history-nav-card.is-active {
  border-color: rgba(17,197,198,0.42);
  background: rgba(17,197,198,0.08);
}

.history-nav-head {
  border: 1px solid rgba(17,197,198,0.15);
  background: rgba(8,28,36,0.45);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.history-nav-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.history-nav-subtitle {
  margin-top: 5px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.history-nav-btn {
  text-align: left;
  background: rgba(8,28,36,0.62);
  border: 1px solid rgba(17,197,198,0.22);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  transition: border-color var(--tr), background var(--tr), color var(--tr), transform var(--tr);
}

.history-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(17,197,198,0.25);
  background: rgba(17,197,198,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-nav-icon svg {
  width: 18px;
  height: 18px;
}

.history-nav-copy {
  display: grid;
  gap: 2px;
}

.history-nav-copy strong {
  font-size: 0.95rem;
  line-height: 1.1;
}

.history-nav-copy small {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.history-nav-btn:hover {
  border-color: rgba(17,197,198,0.35);
  background: rgba(17,197,198,0.1);
  transform: translateY(-1px);
}

.history-nav-btn.is-active {
  border-color: rgba(17,197,198,0.52);
  background: linear-gradient(180deg, rgba(17,197,198,0.18), rgba(17,197,198,0.12));
  color: var(--accent);
  font-weight: 700;
}

.history-nav-btn.is-active .history-nav-icon {
  border-color: rgba(17,197,198,0.5);
  background: rgba(17,197,198,0.2);
}

/* ── Forms inside content panels (desktop: horizontal row) ──────────── */
.history-panel-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: rgba(8,28,36,0.55);
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: var(--radius-sm);
}

.history-form-select {
  flex: 1;
  min-width: 0;
  background: rgba(8,28,36,0.62);
  border: 1px solid rgba(17,197,198,0.25);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.history-form-search-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8,28,36,0.45);
  border: 1px solid rgba(17,197,198,0.22);
  border-radius: 7px;
  padding: 7px 12px;
  color: var(--text-muted);
  min-width: 0;
}

.history-form-search-row svg { flex-shrink: 0; }

.history-form-search-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 0;
}

.history-form-search-row input::placeholder { color: var(--text-muted); }

.history-panel-form .primary-btn {
  flex-shrink: 0;
  width: auto;
  padding: 8px 20px;
  white-space: nowrap;
}

.history-content {
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,46,60,0.86), rgba(10,34,45,0.82));
  padding: 14px;
  min-height: 520px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  overflow-x: hidden;
  overflow-y: auto;
}

.history-panel { display: none; }
.history-panel.is-active { display: block; }

.history-panel-head {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(17,197,198,0.15);
  border-radius: var(--radius-sm);
  background: rgba(8,28,36,0.4);
}

.history-panel-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
}

.history-panel-subtitle {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.quick-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-select-list:empty {
  display: none;
}

.history-main-shell {
  border: 1px solid rgba(17,197,198,0.18);
  border-radius: var(--radius);
  background: radial-gradient(circle at top left, rgba(20,62,92,0.35), rgba(8,28,36,0.96) 40%), linear-gradient(105deg, rgba(8,28,36,0.92), rgba(17,43,67,0.9));
  overflow: hidden;
}

.history-main-head {
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(17,197,198,0.16);
}

.history-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-main-title {
  margin-top: 8px;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text);
}

.history-main-subtitle {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 1.06rem;
}

.history-segmented {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(17,197,198,0.12);
  border-bottom: 1px solid rgba(17,197,198,0.12);
  background: rgba(8,28,36,0.45);
}

.history-segmented-item {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-muted);
  border-right: 1px solid rgba(17,197,198,0.12);
  cursor: pointer;
  transition: color .2s;
}

.history-segmented-item:hover {
  color: var(--accent);
}

.history-segmented-item.is-active {
  color: var(--accent);
}

.history-main-body {
  padding: 14px;
}

.history-seg-panel {
  display: none;
}

.history-seg-panel.is-visible {
  display: block;
}

.history-main-section {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-card {
  display: grid;
  grid-template-columns: 142px 1fr;
  border: 1px solid rgba(17,197,198,0.2);
  border-radius: var(--radius-sm);
  background: linear-gradient(102deg, rgba(16,49,76,0.55), rgba(10,31,48,0.7));
  overflow: hidden;
}

.timeline-date {
  padding: 12px;
  color: #4ad9ff;
  font-size: 0.95rem;
  border-right: 1px solid rgba(17,197,198,0.18);
}

.timeline-main {
  padding: 11px 13px;
}

.timeline-name {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
}

.timeline-unit {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.timeline-desc {
  font-size: 1.15rem;
  color: var(--text);
  margin-top: 7px;
  line-height: 1.42;
}

/* ── Contact message highlight ─────────────────────────── */
.timeline-card--contact {
  border-color: rgba(73,229,122,0.45);
  background: linear-gradient(102deg, rgba(16,76,49,0.45), rgba(10,48,31,0.6));
}
.timeline-card--contact .timeline-date { color: #49e57a; }
.timeline-card--contact .timeline-unit { color: #49e57a; font-weight: 600; }
.timeline-badge-contact {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

/* ── Tenant Cards Grid ─────────────────────────────────── */
.tenant-cards-grid {
  display: grid;
  gap: 12px;
  padding: 4px 0;
}

.tenant-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  background: linear-gradient(120deg, rgba(10,32,50,0.85), rgba(6,22,36,0.92));
  border: 1px solid rgba(17,197,198,0.22);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.tenant-card:hover {
  transform: translateY(-2px);
  border-color: rgba(17,197,198,0.55);
  box-shadow: 0 6px 22px rgba(17,197,198,0.12);
}

.tenant-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #11c5c6, #0a5f8a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(17,197,198,0.3);
}

.tenant-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tenant-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-card-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.tenant-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.tenant-card-rating {
  font-size: 0.78rem;
  color: #fbbf24;
  white-space: nowrap;
}

.tenant-card-rent {
  font-size: 0.8rem;
  font-weight: 700;
  color: #11c5c6;
  background: rgba(17,197,198,0.1);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
}

.tenant-card-arrow {
  font-size: 1.5rem;
  color: rgba(17,197,198,0.5);
  line-height: 1;
  margin-top: 2px;
}

/* ────────────────────────────────────────────────────── */
.quick-select-btn {
  background: linear-gradient(180deg, rgba(8,28,36,0.72), rgba(8,28,36,0.56));
  border: 1px solid rgba(17,197,198,0.24);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), color var(--tr), transform var(--tr);
}

.quick-select-btn:hover,
.quick-select-btn.is-active {
  border-color: rgba(17,197,198,0.5);
  background: rgba(17,197,198,0.15);
  color: var(--accent);
  transform: translateY(-1px);
}

.history-event-list {
  display: grid;
  gap: 8px;
}

.history-event-item {
  border: 1px solid rgba(17,197,198,0.14);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: linear-gradient(180deg, rgba(8,28,36,0.62), rgba(8,28,36,0.5));
}

.history-event-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.history-event-type {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-event-date {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.history-event-text {
  font-size: 0.84rem;
}

.history-footprint-card {
  border: 1px solid rgba(17,197,198,0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15,46,60,0.9), rgba(11,38,51,0.86));
  padding: 14px;
  margin-bottom: 10px;
}

.history-footprint-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.history-footprint-name {
  font-size: 1rem;
  font-weight: 800;
}

.history-stars {
  color: #f6ad55;
  font-size: 0.9rem;
  font-weight: 700;
}

.history-footprint-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.history-review-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.history-review-item {
  border: 1px solid rgba(17,197,198,0.16);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: rgba(8,28,36,0.62);
  font-size: 0.82rem;
}

.history-review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.history-review-stars { color: #fbbf24; font-size: 0.92rem; }
.history-review-score {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.history-review-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.history-review-comment {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}
.history-review-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   ROLE-BASED DASHBOARD VISIBILITY
   ═══════════════════════════════════════════════════════════ */

/* TENANT: ocultar tabs de gestión */
#screenDashboard[data-role="tenant"] .dash-tab[data-tab="directory"],
#screenDashboard[data-role="tenant"] .dash-tab[data-tab="contracts"],
#screenDashboard[data-role="tenant"] .dash-tab[data-tab="compliance"],
#screenDashboard[data-role="tenant"] #tabDirectory,
#screenDashboard[data-role="tenant"] #tabContracts,
#screenDashboard[data-role="tenant"] #tabCompliance { display: none; }

/* AGENT: no ve compliance */
#screenDashboard[data-role="agent"] .dash-tab[data-tab="compliance"],
#screenDashboard[data-role="agent"] #tabCompliance { display: none; }

/* ═══════════════════════════════════════════════════════════
   TENANT SELF-VIEW (Mi Unidad)
   ═══════════════════════════════════════════════════════════ */

.tenant-self-view {
  padding: 16px;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tenant-self-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.tenant-self-block--extra {
  border-top: 2px solid var(--accent);
}

.tenant-self-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.tenant-self-header svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}

.tenant-self-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 3px;
}

.tenant-self-address {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.tenant-self-payments {
  margin-top: 18px;
}

.tenant-self-more {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 10px 0;
}

.tenant-self-empty {
  text-align: center;
  padding: 48px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}
.tenant-self-empty svg { opacity: 0.35; }
.tenant-self-empty h3 { color: var(--text); font-size: 1.05rem; margin: 0; }
.tenant-self-empty p  { font-size: 0.88rem; margin: 0; }

/* Warning/danger cards in tenant grid */
.tenant-dashboard-card.is-warning { border-left: 3px solid #f59e0b; }
.tenant-dashboard-card.is-danger  { border-left: 3px solid #ef4444; }

/* Estilos para el selector de dashboard */
.dashboard-selector {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-selector select {
  font-size: 0.9rem;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/* Estilos para mostrar el rango del usuario */
.user-rank {
  position: fixed;
  top: 50px;
  right: 10px;
  z-index: 1000;
  background: rgba(17, 197, 198, 0.1);
  border: 1px solid rgba(17, 197, 198, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--accent);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════
   CONTRACT REQUEST FORM (CRF)
   ══════════════════════════════════════════════════════════════════════ */

.crf-wrap {
  margin-bottom: 1.5rem;
}

/* ── Acordeón "Generar nuevo contrato" ─────────────────────────── */
.crf-accordion-trigger-row {
  display: flex;
  justify-content: flex-start;
  margin: 18px 0 0;
}

.crf-accordion-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
}

.crf-chevron {
  transition: transform .28s ease;
  flex-shrink: 0;
}

.crf-accordion-trigger[aria-expanded="true"] .crf-chevron {
  transform: rotate(180deg);
}

.crf-accordion {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .32s ease;
  overflow: hidden;
}

.crf-accordion[aria-hidden="false"] {
  grid-template-rows: 1fr;
}

.crf-accordion > .crf-wrap {
  min-height: 0;
  overflow: hidden;
  padding-top: 16px;
}

.crf-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* El formulario de contratos usa form-cards — ampliar el wrapper */
.crf-wrap .form-cards {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) {
  .crf-wrap .form-cards { grid-template-columns: 1fr 1fr; }
  .crf-wrap .fc-span-3  { grid-column: span 2; }
}
@media (max-width: 580px) {
  .crf-wrap .form-cards  { grid-template-columns: 1fr; }
  .crf-wrap .fc-span-2,
  .crf-wrap .fc-span-3   { grid-column: span 1; }
}

.crf-section {
  background: linear-gradient(180deg, rgba(15,46,60,0.92), rgba(10,34,45,0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.crf-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.crf-section-header svg { color: var(--accent); flex-shrink: 0; }

.crf-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.crf-check-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.crf-check-item select {
  font-size: 0.85rem;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  transition: border-color var(--tr);
}
.crf-check-item select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17,197,198,0.12);
}

/* File drop zone */
.crf-file-drop {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  background: rgba(17,197,198,0.04);
}

.crf-file-drop:hover,
.crf-file-drop.drag-over {
  background: rgba(17,197,198,0.1);
}

.crf-file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.crf-file-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
  color: var(--text-muted);
}
.crf-file-drop-inner svg { color: var(--accent); }

.crf-file-hint {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-muted);
}

.crf-file-link {
  color: var(--accent);
  font-weight: 600;
}

.crf-file-types {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.crf-file-selected {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(17,197,198,0.1);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.5rem;
  pointer-events: auto;
}

.crf-duration-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(17,197,198,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text);
}

.crf-duration-label {
  color: var(--text-muted);
}

.crf-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

/* Textarea inside contract form */
.crf-form textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.94rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.crf-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17,197,198,0.12);
}
.crf-form textarea::placeholder { color: rgba(224,240,242,0.28); }

/* Resumen solicitudes en tab Contracts */
.crf-requests-summary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.crf-req-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(8,28,36,0.55);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  gap: 0.5rem;
  color: var(--text);
}

.crf-req-row .crf-req-info { flex: 1; }
.crf-req-row .crf-req-name { font-weight: 700; }
.crf-req-row .crf-req-date { color: var(--text-muted); font-size: 0.78rem; }

/* ══════════════════════════════════════════════════════════════════════
   GOD PANEL
   ══════════════════════════════════════════════════════════════════════ */

.god-panel-btn {
  display: none; /* Moved to tab */
}

.god-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  margin-bottom: 1.5rem;
}

.god-panel-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: #f59e0b;
}

.dash-tab--god {
  color: #f59e0b !important;
}
.dash-tab--god.is-active {
  color: #fbbf24 !important;
  border-color: #f59e0b !important;
}

.dash-tab--agent001 {
  color: #25d366 !important;
}
.dash-tab--agent001.is-active {
  color: #25d366 !important;
  border-color: #25d366 !important;
}

.agent001-content {
  padding: 1.2rem;
}

#screenGod {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg, #f1f5f9);
}

.god-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: #1e1b4b;
  color: #fff;
}

.god-header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.god-badge {
  font-size: 0.65rem;
  background: #f59e0b;
  color: #1e1b4b;
  border-radius: 4px;
  padding: 0.1em 0.5em;
  font-weight: 800;
  letter-spacing: 0.08em;
  vertical-align: middle;
  margin-left: 4px;
}

.god-content {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.god-section {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.god-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text, #1e293b);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.god-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: var(--accent, #6366f1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0 6px;
  margin-left: auto;
}

.god-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.god-filter-btn {
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border, #e2e8f0);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s;
}

.god-filter-btn.is-active,
.god-filter-btn:hover {
  background: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
  color: #fff;
}

.god-requests-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.god-req-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  background: var(--surface, #f8fafc);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow 0.15s;
}

.god-req-card:hover {
  box-shadow: 0 2px 12px rgba(99,102,241,0.1);
}

.god-req-card-body {
  flex: 1;
}

.god-req-card-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text, #1e293b);
  margin-bottom: 0.2rem;
}

.god-req-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.4rem;
}

.god-req-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.god-req-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  flex-shrink: 0;
}

/* Status chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.65em;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-chip.pending  { background: #fef9c3; color: #b45309; }
.status-chip.approved { background: #dcfce7; color: #166534; }
.status-chip.rejected { background: #fee2e2; color: #991b1b; }

/* God detail modal */
.god-detail-body {
  padding: 0.5rem 0;
  max-height: 70vh;
  overflow-y: auto;
}

.god-detail-section {
  margin-bottom: 1.25rem;
}

.god-detail-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.6rem;
}

.god-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1rem;
}

.god-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.god-detail-item label {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}

.god-detail-item span {
  font-size: 0.88rem;
  color: var(--text, #1e293b);
  font-weight: 600;
}

.god-detail-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
  margin-top: 1rem;
}

.god-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent, #6366f1);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.3rem 0.75rem;
  border: 1.5px solid var(--accent, #6366f1);
  border-radius: 6px;
  transition: background 0.15s;
}

.god-file-link:hover {
  background: var(--accent, #6366f1);
  color: #fff;
}

.btn-approve {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: none;
  background: #22c55e;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-approve:hover { background: #16a34a; }

.btn-reject {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-reject:hover { background: #dc2626; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.ghost-btn:hover {
  background: rgba(255,255,255,0.15);
}

/* Modal wide */
.modal-card-wide {
  max-width: 760px;
  width: 95vw;
}

/* Responsive CRF */
@media (max-width: 600px) {
  .crf-section { padding: 1rem; }
  .god-content { padding: 1rem; }
  .god-header  { padding: 0.75rem 1rem; }
  .crf-checks-grid { grid-template-columns: 1fr; }
  .god-detail-grid { grid-template-columns: 1fr; }
  .contracts-grid { grid-template-columns: 1fr; }
  .contracts-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crf-actions { flex-direction: column; }
  .crf-actions button { width: 100%; justify-content: center; }
}

/* ═══ AGENTE 001: CRM WhatsApp — Two-column layout ══════════════════════════ */
.a1-wrapper {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 120px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  overflow: hidden;
}
/* Sidebar */
.a1-sidebar {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,.15);
  border-right: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}
.a1-sidebar-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(37,211,102,.06);
}
.a1-sidebar-title {
  font-weight: 800;
  font-size: .95rem;
  color: #25d366;
}
.a1-count {
  margin-left: auto;
  background: #25d366;
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  padding: .1rem .5rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.a1-sidebar-actions {
  padding: .5rem .75rem;
}
.a1-new-lead-btn {
  width: 100%;
  padding: .45rem;
  border-radius: 8px;
  border: 1.5px dashed rgba(37,211,102,.4);
  background: transparent;
  color: #25d366;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  transition: all .15s;
}
.a1-new-lead-btn:hover {
  background: rgba(37,211,102,.1);
  border-color: #25d366;
}
/* Inline new lead form */
.a1-new-lead-form {
  padding: .5rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(37,211,102,.04);
}
.a1-new-lead-form input,
.a1-new-lead-form textarea {
  width: 100%;
  padding: .4rem .6rem;
  margin-bottom: .35rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--text-primary, #e2e8f0);
  font-size: .8rem;
  box-sizing: border-box;
}
.a1-form-actions {
  display: flex;
  gap: .4rem;
  margin-top: .25rem;
}
.a1-btn-save {
  flex: 1;
  padding: .4rem;
  border-radius: 6px;
  border: none;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: .78rem;
  cursor: pointer;
}
.a1-btn-save:hover { background: #1da851; }
.a1-btn-cancel {
  padding: .4rem .75rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: .78rem;
  cursor: pointer;
}
/* Filters */
.a1-filters {
  display: flex;
  gap: .25rem;
  padding: .4rem .75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.a1-filter {
  padding: .2rem .5rem;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.a1-filter.is-active,
.a1-filter:hover {
  background: rgba(37,211,102,.15);
  color: #25d366;
}
/* Lead list */
.a1-leads-list {
  flex: 1;
  overflow-y: auto;
  padding: .25rem 0;
}
.a1-lead {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  cursor: pointer;
  transition: background .12s;
  border-left: 3px solid transparent;
}
.a1-lead:hover {
  background: rgba(37,211,102,.06);
}
.a1-lead.is-active {
  background: rgba(37,211,102,.1);
  border-left-color: #25d366;
}
.a1-lead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
}
.a1-lead-info {
  flex: 1;
  min-width: 0;
}
.a1-lead-name {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.a1-lead-preview {
  font-size: .72rem;
  color: var(--text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.a1-lead-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .15rem;
  flex-shrink: 0;
}
.a1-lead-time {
  font-size: .65rem;
  color: var(--text-secondary, #64748b);
}
.a1-lead-badge {
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
}
.a1-lead-badge[data-s="new"]        { background: rgba(59,130,246,.15); color: #3b82f6; }
.a1-lead-badge[data-s="contacted"]  { background: rgba(245,158,11,.15); color: #f59e0b; }
.a1-lead-badge[data-s="interested"] { background: rgba(37,211,102,.15); color: #25d366; }
.a1-lead-badge[data-s="registered"] { background: rgba(16,185,129,.15); color: #10b981; }
.a1-lead-badge[data-s="discarded"]  { background: rgba(239,68,68,.12);  color: #ef4444; }
.a1-empty {
  text-align: center;
  color: var(--text-secondary, #64748b);
  padding: 2rem 1rem;
  font-size: .85rem;
}
.a1-empty p { margin-top: .5rem; }

/* Chat panel */
.a1-chat {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,.08);
}
.a1-chat-header {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(37,211,102,.04);
  min-height: 54px;
}
.a1-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.a1-chat-header-info {
  flex: 1;
  min-width: 0;
}
.a1-chat-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text-primary, #e2e8f0);
  display: block;
}
.a1-chat-phone {
  font-size: .75rem;
  color: var(--text-secondary, #94a3b8);
}
.a1-chat-header-actions {
  flex-shrink: 0;
}
.a1-chat-status-sel {
  padding: .3rem .5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text-primary, #e2e8f0);
  font-size: .75rem;
  font-weight: 600;
}
/* Messages */
.a1-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.a1-msg {
  max-width: 75%;
  padding: .5rem .75rem;
  border-radius: 10px;
  font-size: .82rem;
  line-height: 1.45;
  position: relative;
}
.a1-msg--out {
  background: #25d366;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.a1-msg--in {
  background: rgba(255,255,255,.08);
  color: var(--text-primary, #e2e8f0);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.a1-msg-time {
  font-size: .62rem;
  opacity: .55;
  margin-top: .15rem;
  display: block;
}
.a1-msg-status {
  font-size: .6rem;
  opacity: .5;
}
/* Input area */
.a1-chat-input {
  padding: .6rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.1);
}
.a1-tpl-select {
  width: 100%;
  padding: .35rem .5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--text-primary, #e2e8f0);
  font-size: .78rem;
  margin-bottom: .4rem;
}
.a1-input-row {
  display: flex;
  gap: .4rem;
  align-items: flex-end;
}
.a1-input-row textarea {
  flex: 1;
  padding: .5rem .75rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: var(--text-primary, #e2e8f0);
  font-size: .85rem;
  resize: none;
  min-height: 38px;
  max-height: 100px;
}
.a1-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.a1-send-btn:hover { background: #1da851; }
.a1-send-btn:disabled { opacity: .5; cursor: not-allowed; }
.a1-log-btn {
  width: 100%;
  margin-top: .35rem;
  padding: .3rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: .72rem;
  cursor: pointer;
  transition: background .12s;
}
.a1-log-btn:hover { background: rgba(255,255,255,.05); }

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .a1-wrapper {
    grid-template-columns: 1fr;
    height: auto;
  }
  .a1-sidebar { max-height: 50vh; }
  .a1-chat { min-height: 50vh; }
}
.agent001-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border-radius: 8px;
  border: none;
  background: #25d366;
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.agent001-wa-btn:hover {
  background: #1da851;
}

@media (max-width: 600px) {
  .agent001-lead-card { flex-wrap: wrap; }
  .agent001-chat-messages { max-height: 280px; }
}

/* ── Stripe Connect — tarjeta de cuenta económica ────────────────────────────── */
.stripe-card {
  background: var(--card-bg, rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 420px;
}
.stripe-card--active {
  border-color: rgba(74,222,128,0.4);
  background: rgba(74,222,128,0.06);
}
.stripe-card--pending {
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.06);
}
.stripe-card-icon { font-size: 1.8rem; line-height: 1; }
.stripe-card h4 { margin: 0; font-size: 1rem; font-weight: 700; }
.stripe-card p  { margin: 0; font-size: 0.85rem; opacity: 0.75; line-height: 1.5; }
.stripe-card-badge {
  display: inline-block;
  background: rgba(74,222,128,0.18);
  color: #4ade80;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 0.2rem 0.7rem;
  width: fit-content;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
  width: fit-content;
}
.btn-primary:hover  { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════
   PRICING SCREEN
   ══════════════════════════════════════════════════════════════ */
.pricing-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem 3rem;
  overflow-y: auto;
  overflow-x: hidden;
}
.pricing-back {
  align-self: flex-start;
  margin-bottom: 1rem;
}
.pricing-header { text-align: center; margin-bottom: 2rem; }
.pricing-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent, #3b82f6);
  margin-bottom: .5rem;
}
.pricing-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 .5rem;
}
.pricing-brand { color: var(--accent, #3b82f6); }
.pricing-subtitle { color: rgba(255,255,255,.6); font-size: .95rem; }

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto 1.5rem;
}
.pricing-card {
  background: rgba(4,18,24,.94);
  border: 1px solid rgba(17,197,198,.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  position: relative;
  transition: transform .2s, border-color .2s;
  cursor: pointer;
}
.pricing-card:hover, .pricing-card:focus { transform: translateY(-4px); border-color: var(--accent, #3b82f6); outline: none; }
.pricing-card--selected { border-color: var(--accent) !important; box-shadow: 0 0 22px rgba(17,197,198,.22); transform: translateY(-3px); }
.pricing-card--featured { border-color: rgba(251,191,36,.65); background: rgba(28,18,4,.94); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.pricing-card--featured:hover, .pricing-card--featured:focus { border-color: #fbbf24; }
.pricing-card-badge {
  display: inline-block;
  background: rgba(59,130,246,.2);
  color: #60a5fa;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 99px;
  padding: .2rem .7rem;
  width: fit-content;
}
.pricing-card-badge--gold { background: rgba(251,191,36,.2); color: #fbbf24; }
.pricing-card-badge--blue { background: rgba(139,92,246,.2); color: #a78bfa; }
.pricing-card-icon { font-size: 2rem; }
.pricing-card-name { font-size: 1.2rem; font-weight: 800; color: #fff; margin: 0; }
.pricing-card-price { display: flex; align-items: baseline; gap: .4rem; }
.price-amount { font-size: 2.4rem; font-weight: 900; color: #fff; }
.price-period { font-size: .85rem; color: rgba(255,255,255,.5); }
.pricing-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
}
.pricing-card-features li { font-size: .85rem; color: rgba(255,255,255,.75); display: flex; gap: .5rem; align-items: flex-start; }
.feat-check { color: #4ade80; font-weight: 700; flex-shrink: 0; }
.pricing-cta {
  margin-top: .75rem;
  padding: .7rem 1.2rem;
  border-radius: 10px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  width: 100%;
}
.pricing-cta:hover { opacity: .88; }
.pricing-cta:active { transform: scale(.97); }
.pricing-cta--featured { background: #fbbf24; color: #1a1000; }
.pricing-cta--ghost { background: transparent; border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.65); }
.pricing-cta--ghost:hover { border-color: rgba(255,255,255,.55); opacity: 1; }
.pricing-card-badge--green { background: rgba(74,222,128,.2); color: #4ade80; }
.feat-dash { color: rgba(255,255,255,.3); font-weight: 700; flex-shrink: 0; }
.feat-note { color: #fbbf24; font-weight: 700; flex-shrink: 0; }
.pricing-note { font-size: .78rem; color: rgba(255,255,255,.4); text-align: center; max-width: 480px; }

/* Paywall overlay en marketplace */
.paywall-overlay {
  position: fixed; inset: 0;
  background: rgba(10,15,30,.92);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.paywall-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
}
.paywall-icon { font-size: 3rem; margin-bottom: .75rem; }
.paywall-title { font-size: 1.5rem; font-weight: 900; color: #fff; margin-bottom: .5rem; }
.paywall-text  { color: #8b949e; font-size: .9rem; margin-bottom: 1.5rem; line-height: 1.6; }
.paywall-cta {
  display: block;
  width: 100%;
  padding: .8rem;
  border-radius: 10px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .2s;
}
.paywall-cta:hover { opacity: .88; }

@media (max-width: 900px) {
  .pricing-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .pricing-cards { grid-template-columns: 1fr; }
}

/* ══ SIGNUP MODAL (plan summary + form) ══════════════════════════════════ */
.signup-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  align-items: center;
  justify-content: center;
}
.signup-modal.is-open { display: flex; }

.signup-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.signup-modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(17,197,198,.22);
  margin: 1rem;
  animation: smu-appear .28s cubic-bezier(.32,.72,0,1);
}
@keyframes smu-appear {
  from { opacity: 0; transform: scale(.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ─── Lado izquierdo: resumen del plan ─── */
.smu-plan {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(160deg, rgba(17,197,198,.12) 0%, rgba(4,16,22,1) 65%);
  border-right: 1px solid rgba(17,197,198,.18);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.smu-plan-icon { font-size: 2.4rem; line-height: 1; }
.smu-plan-name { font-size: 1.15rem; font-weight: 700; color: #e2f8f8; }
.smu-plan-price-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.smu-plan-price { font-size: 1.5rem; font-weight: 800; color: #11c5c6; }
.smu-plan-badge {
  font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .15rem .45rem; border-radius: 20px;
  background: rgba(251,191,36,.15); color: #fbbf24; border: 1px solid rgba(251,191,36,.3);
}
.smu-plan-feats {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .45rem;
  font-size: .82rem; color: #94c9cc;
}
.smu-plan-feats li::before { content: '✓  '; color: #11c5c6; font-weight: 700; }
.smu-plan-security {
  margin-top: auto;
  font-size: .74rem; color: rgba(148,201,204,.65);
  display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
}
.smu-plan-security strong { color: #94c9cc; }

/* ─── Lado derecho: formulario ─── */
.smu-form-wrap {
  flex: 1;
  background: rgba(4,12,18,.97);
  padding: 1.75rem 1.75rem 1.5rem;
  overflow-y: auto;
  position: relative;
}
.smu-close {
  position: absolute; top: .75rem; right: .75rem;
  background: rgba(255,255,255,.06); border: none; border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #94a3b8;
  transition: background .15s;
}
.smu-close:hover { background: rgba(255,255,255,.12); }
.smu-title { font-size: 1.1rem; font-weight: 700; color: #e2f8f8; margin: 0 0 1rem; }

.smu-form { display: flex; flex-direction: column; gap: .65rem; }
.smu-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.smu-field { display: flex; flex-direction: column; gap: .25rem; }
.smu-field label { font-size: .76rem; color: #94c9cc; font-weight: 600; }
.smu-field input,
.smu-field select {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(17,197,198,.2);
  border-radius: 8px;
  padding: .52rem .72rem;
  font-size: .87rem;
  color: #e2f8f8;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s;
}
.smu-field input:focus,
.smu-field select:focus { border-color: rgba(17,197,198,.6); }
.smu-field select option { background: #041216; color: #e2f8f8; }

.smu-status { font-size: .82rem; min-height: 1.1rem; color: #f87171; text-align: center; }
.smu-status.ok { color: #4ade80; }

.smu-cta {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: linear-gradient(135deg, #11c5c6 0%, #0891b2 100%);
  color: #041216; font-weight: 800; font-size: .95rem;
  border: none; border-radius: 10px; padding: .8rem;
  cursor: pointer; width: 100%;
  transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 22px rgba(17,197,198,.4);
}
.smu-cta:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.smu-cta:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.smu-cta--free {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  box-shadow: 0 4px 22px rgba(74,222,128,.35); color: #041c0c;
}
.smu-cancel-note { font-size: .73rem; color: rgba(148,201,204,.5); text-align: center; margin: .2rem 0 0; }

@media (max-width: 640px) {
  .signup-modal-card { flex-direction: column; border-radius: 18px 18px 0 0; margin: 0; align-self: flex-end; max-height: 96vh; }
  .signup-modal { align-items: flex-end; }
  .smu-plan { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 1rem 1.2rem .8rem; gap: .5rem; border-right: none; border-bottom: 1px solid rgba(17,197,198,.18); }
  .smu-plan-icon { font-size: 1.6rem; }
  .smu-plan-name { font-size: .95rem; }
  .smu-plan-feats, .smu-plan-security { display: none; }
  .smu-form-wrap { padding: 1.2rem 1rem 1.5rem; }
}

/* ══ STRIPE EMBEDDED CHECKOUT MODAL ══════════════════════════════════════ */
.stripe-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.stripe-modal.is-open { display: flex; }

.stripe-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.stripe-modal-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  padding: 1.5rem 1.5rem .5rem;
  margin: 1rem;
}

.stripe-modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  transition: background .15s;
  z-index: 2;
}
.stripe-modal-close:hover { background: #e2e8f0; }

#stripeCheckoutContainer { min-height: 200px; }

@media (max-width: 600px) {
  .stripe-modal-card { border-radius: 12px 12px 0 0; align-self: flex-end; max-height: 92vh; padding: 1.2rem 1rem .5rem; }
  .stripe-modal { align-items: flex-end; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FAQ SECTION — Preguntas frecuentes (dentro de screenPricing)
   ═══════════════════════════════════════════════════════════════════════════ */
.faq-section {
  max-width: 720px;
  margin: 1.5rem auto 1rem;
  padding: 0 1.5rem;
}
.faq-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: .5rem;
  color: #e2e8f0;
}
.faq-subtitle {
  text-align: center;
  color: #64748b;
  font-size: .82rem;
  margin-bottom: 1rem;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.faq-item {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.faq-item:hover {
  border-color: rgba(129,140,248,.2);
  background: rgba(255,255,255,.05);
}
.faq-item[open] {
  border-color: rgba(129,140,248,.35);
  background: rgba(129,140,248,.06);
  box-shadow: 0 0 20px rgba(129,140,248,.08);
}

/* ── Summary / Question ── */
.faq-question {
  padding: .9rem 1.1rem;
  font-weight: 600;
  font-size: .88rem;
  color: #cbd5e1;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .65rem;
  transition: color .2s;
  -webkit-user-select: none;
  user-select: none;
}
.faq-question::-webkit-details-marker,
.faq-question::marker { display: none; content: ''; }
.faq-item:hover .faq-question { color: #e2e8f0; }
.faq-item[open] .faq-question { color: #fff; }

/* Chevron icon */
.faq-question::before {
  content: '';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 7px;
  background: rgba(129,140,248,.12);
  border: 1px solid rgba(129,140,248,.18);
  transition: transform .3s, background .25s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23818cf8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.faq-item[open] .faq-question::before {
  transform: rotate(180deg);
  background-color: rgba(129,140,248,.22);
}

/* ── Answer ── */
.faq-answer {
  padding: 0 1.1rem .9rem 3rem;
  color: #94a3b8;
  font-size: .82rem;
  line-height: 1.7;
  animation: faqSlideIn .25s ease-out;
}
.faq-answer p { margin: 0; }

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

@media (max-width: 600px) {
  .faq-title { font-size: 1.1rem; }
  .faq-section { margin: 2.5rem auto 1.5rem; padding: 0 1rem; }
  .faq-question { font-size: .82rem; padding: .8rem .9rem; }
  .faq-question::before { width: 22px; height: 22px; min-width: 22px; border-radius: 6px; }
  .faq-answer { font-size: .78rem; padding: 0 .9rem .8rem 2.5rem; }
}

/* ── Consent checkboxes ── */
.consent-group {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .78rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1.5;
}
.consent-check input[type="checkbox"] {
  accent-color: #22d3ee;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.consent-check a {
  color: #22d3ee;
  text-decoration: underline;
}
.consent-check a:hover {
  color: #67e8f9;
}
.consent-check--inline {
  flex-direction: row;
  align-items: center;
}
.consent-error {
  color: #f87171;
  font-size: .75rem;
  margin-top: .2rem;
  display: none;
}
@keyframes consent-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.consent-shake {
  animation: consent-shake .4s ease-in-out;
}

/* ── Compliance debt banner ── */
/* ══════════════════════════════════════════════════════════
   DOCUMENTOS TAB — InmoContract-style dashboard
   ══════════════════════════════════════════════════════════ */

/* ── KPI Bar ── */
.cd-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cd-kpi-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: rgba(30, 41, 59, .55);
  border: 1px solid rgba(148, 163, 184, .1);
}
.cd-kpi-icon {
  font-size: 1.6rem;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.cd-kpi--danger .cd-kpi-icon { background: rgba(239, 68, 68, .15); }
.cd-kpi--info   .cd-kpi-icon { background: rgba(59, 130, 246, .15); }
.cd-kpi--warning .cd-kpi-icon { background: rgba(234, 179, 8, .15); }
.cd-kpi--success .cd-kpi-icon { background: rgba(34, 197, 94, .15); }
.cd-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.1;
}
.cd-kpi-label {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: .1rem;
}

/* ── Layout: main + sidebar ── */
.cd-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.2rem;
  align-items: start;
}

/* ── Section headers ── */
.cd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .8rem;
}
.cd-section-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0;
}
.cd-section-count {
  font-size: .75rem;
  color: #94a3b8;
  background: rgba(148, 163, 184, .1);
  padding: .2rem .6rem;
  border-radius: 20px;
}

/* ── Property card grid ── */
.cd-risk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .9rem;
  margin-bottom: 1.8rem;
}
.cd-prop-card {
  background: rgba(30, 41, 59, .65);
  border: 1px solid rgba(148, 163, 184, .1);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  transition: border-color .2s;
}
.cd-prop-card:hover {
  border-color: rgba(99, 102, 241, .35);
}
.cd-prop-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .8rem;
}
.cd-prop-info {
  flex: 1;
  min-width: 0;
}
.cd-prop-name {
  font-weight: 700;
  font-size: .92rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-prop-addr {
  font-size: .76rem;
  color: #94a3b8;
  margin-top: .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-prop-docs {
  font-size: .72rem;
  color: #94a3b8;
  margin-top: .3rem;
}
.cd-prop-score {
  flex-shrink: 0;
}

/* ── Circular score ring ── */
.cd-ring { display: block; }

/* ── Badges ── */
.cd-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 6px;
  margin-top: .35rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.cd-badge--danger {
  background: rgba(239, 68, 68, .15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, .25);
}
.cd-badge--warning {
  background: rgba(234, 179, 8, .15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, .25);
}
.cd-badge--ok {
  background: rgba(34, 197, 94, .15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, .25);
}

/* ── Missing doc tags ── */
.cd-prop-missing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.cd-missing-tag {
  font-size: .68rem;
  padding: .15rem .5rem;
  border-radius: 5px;
  background: rgba(248, 113, 113, .08);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, .18);
  white-space: nowrap;
}

/* ── Card action buttons ── */
.cd-prop-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding-top: .3rem;
  border-top: 1px solid rgba(148, 163, 184, .08);
}
.cd-btn {
  font-size: .74rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.cd-btn:active { transform: scale(.97); }
.cd-btn--ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, .18);
}
.cd-btn--ghost:hover { background: rgba(148, 163, 184, .08); color: #e2e8f0; }
.cd-btn--primary {
  background: rgba(99, 102, 241, .2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, .3);
}
.cd-btn--primary:hover { background: rgba(99, 102, 241, .35); }
.cd-btn--secondary {
  background: rgba(234, 179, 8, .12);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, .25);
}
.cd-btn--secondary:hover { background: rgba(234, 179, 8, .22); }

/* ── Empty state ── */
.cd-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
}
.cd-empty-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.cd-empty-state p { font-size: .85rem; margin: 0; }

/* ── Sidebar ── */
.cd-sidebar {
  background: rgba(30, 41, 59, .55);
  border: 1px solid rgba(148, 163, 184, .1);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 1rem;
}
.cd-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid rgba(148, 163, 184, .1);
}
.cd-sidebar-tab {
  flex: 1;
  padding: .65rem .5rem;
  font-size: .74rem;
  font-weight: 600;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  transition: color .2s, background .2s;
  text-align: center;
}
.cd-sidebar-tab:hover { color: #94a3b8; }
.cd-sidebar-tab.is-active {
  color: #a5b4fc;
  background: rgba(99, 102, 241, .06);
  box-shadow: inset 0 -2px 0 #6366f1;
}
.cd-sidebar-panel {
  display: none;
  padding: .8rem 1rem 1rem;
  max-height: 450px;
  overflow-y: auto;
}
.cd-sidebar-panel.is-active { display: block; }
.cd-sidebar-panel h4 {
  font-size: .82rem;
  font-weight: 700;
  color: #cbd5e1;
  margin: 0 0 .6rem;
}

/* ── Sidebar items ── */
.cd-side-item {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, .06);
}
.cd-side-item:last-child { border-bottom: none; }
.cd-side-item-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .3rem;
}
.cd-dot--danger  { background: #ef4444; }
.cd-dot--warning { background: #eab308; }
.cd-dot--info    { background: #6366f1; }
.cd-side-item-body { min-width: 0; flex: 1; }
.cd-side-item-title {
  font-size: .78rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-side-item-sub {
  font-size: .7rem;
  color: #64748b;
  margin-top: .1rem;
}
.cd-side-empty {
  font-size: .78rem;
  color: #475569;
  text-align: center;
  padding: 1.2rem 0;
  margin: 0;
}

/* ── Upload modal ── */
.cd-upload-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.cd-upload-modal.is-open {
  display: flex;
}
.cd-upload-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.cd-upload-panel {
  position: relative;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 16px;
  width: 480px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.cd-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cd-upload-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}
.cd-upload-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #94a3b8;
  cursor: pointer;
  padding: .2rem .4rem;
  line-height: 1;
}
.cd-upload-close:hover { color: #f1f5f9; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .cd-kpi-bar { grid-template-columns: repeat(2, 1fr); }
  .cd-layout { grid-template-columns: 1fr; }
  .cd-sidebar { position: static; }
}
@media (max-width: 600px) {
  .cd-kpi-bar { grid-template-columns: 1fr; }
  .cd-risk-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   CONTRACT VIEWER BOARD  (cvb-*)
   ═══════════════════════════════════════════════════════════════════ */
#contractViewerBoard {
  padding: 0;
  overflow: hidden;
}
.cvb-header {
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cvb-title-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--text-primary, #f1f5f9);
}
.cvb-title-row h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.cvb-title-row svg { opacity: .65; flex-shrink: 0; }
.cvb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.cvb-filter-group {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  flex: 1 1 170px;
}
.cvb-filter-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted, #94a3b8);
}
.cvb-select {
  background: var(--surface-alt, #1e293b);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-primary, #f1f5f9);
  border-radius: 6px;
  padding: .38rem .65rem;
  font-size: .82rem;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  width: 100%;
}
.cvb-select:focus { border-color: var(--accent, #6366f1); }

/* List */
.cvb-list {
  max-height: 420px;
  overflow-y: auto;
  padding: .5rem 0;
}
.cvb-empty {
  padding: 2rem;
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted, #64748b);
}
.cvb-row {
  display: grid;
  grid-template-columns: 1fr 1fr .9fr auto;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .15s;
}
.cvb-row:last-child { border-bottom: none; }
.cvb-row:hover { background: rgba(255,255,255,.04); }
.cvb-row-tenant { font-size: .88rem; font-weight: 600; color: var(--text-primary, #f1f5f9); }
.cvb-row-prop {
  font-size: .8rem;
  color: var(--text-secondary, #cbd5e1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cvb-row-dates { font-size: .78rem; color: var(--text-muted, #64748b); }
.cvb-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.cvb-badge-active   { background: rgba(34,197,94,.15);  color: #4ade80; }
.cvb-badge-expiring { background: rgba(234,179,8,.15);   color: #fbbf24; }
.cvb-badge-expired  { background: rgba(239,68,68,.12);   color: #f87171; }
.cvb-badge-renewed  { background: rgba(99,102,241,.15);  color: #818cf8; }
.cvb-open-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-secondary, #94a3b8);
  border-radius: 5px;
  padding: .3rem .65rem;
  font-size: .75rem;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
}
.cvb-row:hover .cvb-open-btn { border-color: var(--accent, #6366f1); color: #a5b4fc; }

/* ── Document Modal ── */
.cvb-doc-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cvb-doc-modal[hidden] { display: none; }
.cvb-doc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
}
.cvb-doc-panel {
  position: relative;
  z-index: 1;
  background: var(--surface, #1e293b);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
  animation: cvbSlideUp .28s ease;
}
@keyframes cvbSlideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.cvb-doc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.cvb-doc-modal-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
}
.cvb-doc-close {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: .3rem;
  border-radius: 5px;
  transition: color .15s, background .15s;
}
.cvb-doc-close:hover { color: #f1f5f9; background: rgba(255,255,255,.08); }
.cvb-doc-content {
  overflow-y: auto;
  flex: 1;
  padding: 1.5rem 1.75rem;
}

/* Contract document render */
.cvb-contract-doc {
  background: #fff;
  color: #111;
  border-radius: 8px;
  padding: 2.5rem 2.25rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: .92rem;
  line-height: 1.75;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 2px 24px rgba(0,0,0,.25);
}
.cvb-contract-doc h2 {
  font-size: 1.15rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1.75rem;
  color: #111;
  border-bottom: 2px solid #111;
  padding-bottom: .75rem;
}
.cvb-contract-doc h4 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 1.5rem 0 .4rem;
  color: #333;
  border-bottom: 1px solid #ddd;
  padding-bottom: .25rem;
}
.cvb-contract-section { margin-bottom: 1rem; }
.cvb-contract-section p { margin: .2rem 0; font-size: .9rem; }
.cvb-contract-section strong { font-weight: 700; }
.cvb-contract-doc .cvb-contract-footer {
  margin-top: 3rem;
  border-top: 1px solid #ccc;
  padding-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  font-size: .85rem;
}
.cvb-sig-block { display: flex; flex-direction: column; gap: .3rem; }
.cvb-sig-line {
  border-top: 1px solid #555;
  margin-top: 2.5rem;
  padding-top: .3rem;
  font-size: .8rem;
  color: #444;
}
/* If PDF file is attached */
.cvb-pdf-frame {
  width: 100%;
  height: 65vh;
  border: none;
  border-radius: 6px;
  background: #111;
}

@media (max-width: 640px) {
  .cvb-row { grid-template-columns: 1fr 1fr; }
  .cvb-row-dates, .cvb-open-btn { display: none; }
  .cvb-doc-panel { border-radius: 12px 12px 0 0; }
  .cvb-contract-doc { padding: 1.5rem 1rem; }
  .cvb-contract-doc .cvb-contract-footer { grid-template-columns: 1fr; }
}
