/* Terrenos del Valle — design system (extraído de las maquetas Etapa 34) */
:root {
  --ink: #182422;
  --muted: #61706b;
  --line: #d9e1dc;
  --paper: #fbfcf9;
  --soft: #edf4ef;
  --green: #1f6b4e;
  --green-2: #2f8f68;
  --green-dark: #164734;
  --blue: #1b5b74;
  --clay: #b65b32;
  --sun: #efbd5b;
  --white: #ffffff;
  --danger: #8a2e17;
  --shadow: 0 18px 45px rgba(24, 36, 34, .12);
  --shadow-sm: 0 12px 32px rgba(24, 36, 34, .08);
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
a { color: var(--green); }
img { max-width: 100%; }

/* Layout */
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(251, 252, 249, .95);
  border-bottom: 1px solid rgba(217, 225, 220, .9);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden;
  border-radius: 8px; color: var(--white); background: var(--green); font-weight: 900;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

/* Buttons */
.btn {
  border: 0; border-radius: 8px; padding: 12px 16px; cursor: pointer;
  font-weight: 800; color: var(--white); background: var(--green); text-decoration: none;
  display: inline-grid; place-items: center; min-height: 44px;
}
.btn:hover { background: var(--green-dark); }
.btn.wa { background: var(--green-2); box-shadow: 0 10px 25px rgba(47,143,104,.22); }
.btn.ghost { color: var(--ink); background: var(--white); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--green); color: var(--green); background: var(--soft); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(138,46,23,.3); }
.btn.sm { min-height: 38px; padding: 9px 12px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Cards / panels */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm); padding: 18px;
}
.section-head { margin: 26px 0 12px; }
.section-head h2 { margin: 0 0 4px; font-size: clamp(22px, 3vw, 30px); }
.section-head p { margin: 0; color: var(--muted); }

/* Forms */
.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field label { color: var(--muted); font-size: .9rem; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 13px 14px; color: var(--ink); background: var(--white); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green); box-shadow: 0 0 0 4px rgba(31,107,78,.14);
}
.field textarea { min-height: 90px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* Messages */
.msg { padding: 12px 14px; border-radius: 8px; font-weight: 700; }
.msg.ok { color: var(--green-dark); background: rgba(31,107,78,.1); }
.msg.error { color: var(--danger); background: rgba(166,91,56,.14); }

/* Badges / pills */
.pill { border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 800;
  color: var(--muted); background: var(--soft); display: inline-block; }
.pill.green { color: var(--green); }
.badge { border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 900;
  color: var(--white); background: var(--clay); }

/* Lot catalog */
.catalog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .catalog { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .catalog { grid-template-columns: 1fr; } }
.lot-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm); }
.lot-image { position: relative; height: 172px; background: var(--soft); }
.lot-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lot-image .badge { position: absolute; left: 12px; top: 12px; }
.lot-body { padding: 16px; }
.lot-title { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lot-title h3 { margin: 0; font-size: 19px; }
.lot-title .price { color: var(--green); font-weight: 900; white-space: nowrap; }
.lot-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }

/* Auth split screen */
.login-page { min-height: 100vh; display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr); }
@media (max-width: 820px) { .login-page { grid-template-columns: 1fr; } }
.login-panel { min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  gap: 16px; padding: clamp(28px, 6vw, 64px); background: rgba(246,247,242,.97); }
.login-panel h1 { margin: 6px 0; font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1; }
.login-side { padding: clamp(24px,5vw,64px); display: grid; align-content: end; gap: 14px;
  color: #fff; background:
    linear-gradient(120deg, rgba(31,107,78,.92), rgba(23,35,31,.85)); }
.login-side .card { background: rgba(23,35,31,.5); border-color: rgba(255,255,255,.25);
  color: #fff; backdrop-filter: blur(10px); }
.login-side .card strong { color: var(--sun); }

/* Utilities */
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

/* ============ Componentes ricos (página del cliente) ============ */
.hero { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 18px; margin-top: 18px; }
@media (max-width: 860px){ .hero { grid-template-columns: 1fr; } }
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: clamp(22px,3vw,36px); border-radius: var(--radius); background: var(--white);
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-copy h1 { margin: 0; font-size: clamp(34px,5vw,58px); line-height: .98; }
.hero-copy p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 46ch; }
.hero-photo { position: relative; overflow: hidden; min-height: 340px; border-radius: var(--radius);
  background: var(--ink); box-shadow: var(--shadow); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo .price-tag { position: absolute; right: 16px; bottom: 16px; padding: 12px 16px;
  border-radius: 10px; background: var(--sun); color: var(--ink); text-align: right; box-shadow: var(--shadow); }
.hero-photo .price-tag strong { display: block; font-size: 22px; line-height: 1; }
.hero-photo .price-tag span { font-size: 11px; font-weight: 900; text-transform: uppercase; }

.hero-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 16px 0; }
@media (max-width: 720px){ .hero-stats { grid-template-columns: repeat(2,1fr); } }
.hero-stats .stat { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.hero-stats .stat strong { display: block; font-size: 24px; }
.hero-stats .stat span { color: var(--muted); font-size: 13px; }

.lot-card { display: flex; flex-direction: column; }
.lot-card .lot-body { display: flex; flex-direction: column; flex: 1; }
.lot-feats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.lot-feats span { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 6px; padding: 4px 8px; }
.lot-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: auto; }

/* Modal genérico */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: rgba(24,36,34,.6); overflow: auto; }
.modal-box { width: min(920px,100%); max-height: 92vh; overflow: auto; background: var(--white);
  border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.modal-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 16px 20px; background: var(--white); border-bottom: 1px solid var(--line); z-index: 2; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-body { padding: 20px; }

/* Galería */
.gallery-main { position: relative; height: 360px; background: var(--soft); border-radius: 12px; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 74px; height: 56px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--green); }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.9); cursor: pointer; font-size: 20px; display: grid; place-items: center; }
.gallery-nav.prev { left: 12px; } .gallery-nav.next { right: 12px; }

/* Simulador de pagos */
.pay-sim { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 640px){ .pay-sim { grid-template-columns: 1fr; } }
.pay-controls .field { margin-bottom: 10px; }
.pay-slider { width: 100%; accent-color: var(--green); }
.pay-result { padding: 18px; border-radius: 12px; background: var(--green); color: #fff; }
.pay-result .big { font-size: clamp(34px,6vw,52px); line-height: 1; font-weight: 900; }
.pay-result small { color: rgba(255,255,255,.8); font-weight: 800; text-transform: uppercase; font-size: 11px; }
.pay-breakdown { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.pay-breakdown div { background: rgba(255,255,255,.12); border-radius: 8px; padding: 10px; }
.pay-breakdown strong { display: block; font-size: 16px; }
.pay-breakdown span { font-size: 11px; color: rgba(255,255,255,.8); }

/* Mapa */
.map-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.map-card iframe { width: 100%; height: 320px; border: 0; display: block; }
.map-caption { padding: 12px 14px; color: var(--muted); }
.map-illustrated { height: 300px; border-radius: var(--radius); position: relative;
  background: radial-gradient(circle at 50% 45%, #dceade, #cde0d1); border: 1px solid var(--line); overflow: hidden; }
.map-pin { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%);
  background: var(--green); color: #fff; padding: 8px 12px; border-radius: 999px; font-weight: 800;
  border: 3px solid #fff; box-shadow: var(--shadow); }

/* Contacto */
.contact { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; margin-top: 20px; }
@media (max-width: 800px){ .contact { grid-template-columns: 1fr; } }
.interest-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 14px 0; }
@media (max-width: 560px){ .interest-grid { grid-template-columns: 1fr; } }
.interest { text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--white); cursor: pointer; }
.interest.active { border-color: var(--green); background: var(--soft); }
.interest strong { display: block; margin-bottom: 4px; }
.interest span { color: var(--muted); font-size: 13px; }
.msg-preview { min-height: 90px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); line-height: 1.45; }
.agent-card { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.agent-avatar { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: var(--green); color: #fff; font-weight: 900; font-size: 20px; }
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Nudge flotante */
.nudge { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: min(320px, calc(100% - 32px));
  padding: 14px; border-radius: 12px; background: var(--white); border: 1px solid var(--line);
  box-shadow: var(--shadow); transform: translateY(140%); opacity: 0; transition: .3s; }
.nudge.show { transform: translateY(0); opacity: 1; }
.nudge strong { display: block; margin-bottom: 4px; }
.nudge p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }

/* Chips de amenidades (editor) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--ink);
  border-radius: 999px; padding: 5px 10px; font-size: 13px; }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; }

/* Stat tiles admin/agente */
.tiles { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
@media (max-width: 720px){ .tiles { grid-template-columns: repeat(2,1fr); } }
.tile { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); }
.tile .n { font-size: 30px; font-weight: 900; line-height: 1; }
.tile .l { color: var(--muted); font-size: 13px; margin-top: 6px; }
.tile.accent { background: var(--green); color: #fff; border: 0; }
.tile.accent .l { color: rgba(255,255,255,.85); }

/* ---------- Estado de acceso: aviso de vencimiento, gracia y pausa ---------- */
.pill.warn { color: var(--clay); border-color: rgba(182,91,50,.35); background: rgba(182,91,50,.1); }
.pill.danger { color: var(--danger); border-color: rgba(138,46,23,.3); background: rgba(138,46,23,.08); }

.banner { border-radius: var(--radius); border: 1px solid var(--line); background: var(--white);
  padding: 16px; margin: 18px 0; box-shadow: var(--shadow-sm); }
.banner.warn { border-color: rgba(182,91,50,.35); background: rgba(239,189,91,.12); }
.banner.danger { border-color: rgba(138,46,23,.3); background: rgba(138,46,23,.07); }
.banner.soft { background: var(--soft); }
.banner-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.banner-head > div { flex: 1 1 260px; min-width: 0; }
.banner-head strong { display: block; font-size: 18px; }
.banner-head p { margin: 4px 0 0; color: var(--muted); }
.banner-mark { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; display: grid;
  place-items: center; font-weight: 900; color: var(--white); background: var(--clay); }
.banner.danger .banner-mark { background: var(--danger); }
.banner.soft .banner-mark { background: var(--green); }
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.banner-grid > div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--white); }
.banner-grid strong { display: block; margin-bottom: 4px; }
.banner-grid span { color: var(--muted); font-size: 14px; }
.banner-foot { margin: 12px 0 0; color: var(--clay); font-weight: 700; }

.paused-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--soft); }
.paused-card { max-width: 520px; text-align: center; }
.paused-card .brand-mark { width: 56px; height: 56px; margin: 0 auto 14px; font-size: 20px; }
.paused-card h1 { margin: 10px 0; font-size: clamp(28px, 5vw, 44px); line-height: 1.05; }

@media (max-width: 760px) {
  .banner-grid { grid-template-columns: 1fr; }
}

/* ---------- Casa sobrepuesta a la foto del terreno ---------- */
.facade-editor { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 14px; align-items: start; }
.facade-stage { position: relative; height: 250px; background: var(--soft); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; }
.facade-stage #f-base { width: 100%; height: 100%; object-fit: cover; display: block; }
.facade-stage #f-house, .gallery-main img.facade-layer { position: absolute; height: auto; object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(24,36,34,.38)); }
.facade-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 18px; }
.facade-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery-house { position: absolute; right: 12px; top: 12px; z-index: 3; }

/* ---------- Recorrido del lote ---------- */
.tour { display: grid; grid-template-columns: minmax(0,250px) minmax(0,1fr); gap: 12px; }
.tour-list { display: grid; gap: 8px; align-content: start; }
.tour-btn { text-align: left; justify-content: flex-start; }
.tour-btn.active { border-color: var(--green); color: var(--green); background: var(--soft); }
.tour-stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--soft); }
.tour-stage img { width: 100%; height: 300px; object-fit: cover; display: block; }
.tour-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; color: #fff; display: flex;
  justify-content: space-between; align-items: flex-end; gap: 12px;
  background: linear-gradient(to top, rgba(20,28,26,.88), rgba(20,28,26,0)); }
.tour-caption strong { display: block; font-size: 18px; }
.tour-caption span { color: rgba(255,255,255,.85); font-size: 14px; }
.tour-caption .tour-count { flex: 0 0 auto; background: var(--white); color: var(--ink); border-radius: 999px;
  padding: 7px 12px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.tour-dial { position: absolute; right: 14px; top: 14px; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20,28,26,.75); color: #fff; font-weight: 800; font-size: 13px; }
.tour-slider { width: 100%; margin-top: 10px; }
.tour-slider-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-weight: 800; font-size: 13px; }

@media (max-width: 760px) {
  .facade-editor, .tour { grid-template-columns: 1fr; }
  .tour-stage img { height: 220px; }
}

/* ---------------- Tablero de rendimiento (admin) ---------------- */
.mes-input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--white);
  font-weight: 800; color: var(--ink); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.perf { display: grid; gap: 14px; }
.funnel { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap;
  background: var(--soft); border-radius: var(--radius); padding: 14px; }
.funnel-step { flex: 1 1 110px; min-width: 96px; text-align: center; background: var(--white);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 8px; }
.funnel-step b { display: block; font-size: 28px; line-height: 1; }
.funnel-step span { display: block; color: var(--muted); font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em; margin-top: 6px; }
.funnel-arrow { flex: 0 0 auto; display: grid; place-items: center; padding: 0 4px; }
.funnel-arrow span { font-size: 12px; font-weight: 900; color: var(--green); background: var(--white);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; white-space: nowrap; }
.growth { display: inline-block; font-style: normal; font-size: 12px; font-weight: 900; margin-top: 6px; }
.growth.sube  { color: var(--green-2); }
.growth.baja  { color: var(--clay); }
.growth.igual { color: var(--muted); }

.perf-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.perf-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; font-size: 14px; }
.lista { margin: 0; padding-left: 18px; color: var(--ink); font-size: 14px; }
.lista li { margin-bottom: 3px; }

.spark { display: flex; align-items: flex-end; gap: 6px; height: 84px; }
.spark-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  height: 100%; gap: 4px; }
.spark-bar { width: 100%; background: var(--green); border-radius: 4px 4px 0 0; min-height: 3px; }
.spark-col span { font-size: 11px; color: var(--muted); font-weight: 800; }

.verdict { border-radius: var(--radius); padding: 14px; border: 1px solid var(--line); background: var(--white); }
.verdict strong { display: block; font-size: 16px; }
.verdict p { margin: 4px 0 0; color: var(--muted); }
.verdict.bien  { border-color: rgba(47,143,104,.45); background: rgba(47,143,104,.08); }
.verdict.medio { border-color: rgba(239,189,91,.6);  background: rgba(239,189,91,.12); }
.verdict.flojo { border-color: rgba(182,91,50,.35);  background: rgba(182,91,50,.07); }
.verdict.nulo  { border-color: rgba(138,46,23,.3);   background: rgba(138,46,23,.06); }
.verdict .precio { margin-top: 10px; font-weight: 800; color: var(--ink); }
.verdict .precio.sube { color: var(--green); }
.verdict .precio.baja { color: var(--clay); }

.verdict-pill { border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 900;
  border: 1px solid var(--line); background: var(--white); white-space: nowrap; }
.verdict-pill.bien  { color: var(--green);  border-color: rgba(47,143,104,.5); }
.verdict-pill.medio { color: var(--clay);   border-color: rgba(239,189,91,.7); }
.verdict-pill.flojo { color: var(--clay);   border-color: rgba(182,91,50,.4); }
.verdict-pill.nulo  { color: var(--danger); border-color: rgba(138,46,23,.35); }

.perf-money { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.perf-money div { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.perf-money span { display: block; font-size: 12px; }
.perf-money strong { font-size: 18px; }

@media (max-width: 860px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .perf-cols { grid-template-columns: 1fr; }
  .perf-money { grid-template-columns: 1fr 1fr; }
  .funnel-arrow { display: none; }
}

/* ---------------- Vista 360 ---------------- */
.pano { position: relative; border-radius: 12px; overflow: hidden; background: #101614; }
.pano-lienzo { display: block; width: 100%; height: 380px; touch-action: none; cursor: grab; }
.pano-lienzo:active { cursor: grabbing; }
.pano-pista { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); color: #fff;
  background: rgba(20,28,26,.7); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.pano-controles { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.pano-brujula { position: absolute; right: 12px; bottom: 12px; background: rgba(20,28,26,.75); color: #fff;
  border-radius: 999px; padding: 8px 12px; font-weight: 900; font-size: 13px; }
.pano-plano { overflow-x: auto; }
.pano-plano img { height: 380px; max-width: none; display: block; }
.ayuda-360 { background: var(--soft); border-radius: var(--radius); padding: 14px 16px; margin: -6px 0 12px; }
.ayuda-360 > strong { display: block; margin-bottom: 6px; }
.ayuda-360 ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.ayuda-360 li { margin-bottom: 4px; }

/* ------------- Imaginar la construcción ------------- */
.dz-stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--soft); }
.dz-base { width: 100%; height: 380px; object-fit: cover; display: block; }
.dz-capa { position: absolute; inset: 0; }
.dz-item { position: absolute; transform: translateX(-50%); cursor: grab; touch-action: none;
  filter: drop-shadow(0 12px 18px rgba(24,36,34,.35)); }
.dz-item.sel { outline: 2px dashed rgba(255,255,255,.9); outline-offset: 4px; }
.dz-vacio { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); color: #fff;
  background: rgba(20,28,26,.7); padding: 10px 14px; border-radius: 10px; font-weight: 700; text-align: center; }
.dz-catalogo { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 4px; }
.dz-chip { flex: 0 0 auto; width: 118px; border: 1px solid var(--line); background: var(--white);
  border-radius: 10px; padding: 8px; cursor: pointer; display: grid; gap: 6px; justify-items: center; }
.dz-chip:hover { border-color: var(--green); }
.dz-chip img { width: 100%; height: 46px; object-fit: contain; }
.dz-chip span { font-size: 12px; font-weight: 800; color: var(--ink); text-align: center; line-height: 1.2; }
.dz-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------------- Plusvalía ---------------- */
.plus-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.plus-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--white); }
.plus-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.plus-card strong { display: block; font-size: 20px; margin: 6px 0 2px; }
.plus-card em { font-style: normal; font-size: 13px; font-weight: 800; color: var(--green-2); }
.plus-card.hoy { background: var(--green); border: 0; color: #fff; }
.plus-card.hoy span, .plus-card.hoy em { color: rgba(255,255,255,.85); }

/* ---------------- Qué hay alrededor ---------------- */
.cerca-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cerca-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--white); }
.cerca-card strong { display: block; margin-bottom: 8px; }
.cerca-card ul { list-style: none; margin: 0; padding: 0; }
.cerca-card li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0;
  border-bottom: 1px dashed var(--line); }
.cerca-card li:last-child { border-bottom: 0; }
.cerca-card em { font-style: normal; color: var(--muted); white-space: nowrap; }

@media (max-width: 860px) {
  .plus-grid { grid-template-columns: repeat(2, 1fr); }
  .cerca-grid { grid-template-columns: 1fr; }
  .pano-lienzo, .dz-base, .pano-plano img { height: 300px; }
}

/* ------- Aviso automático de la página del comprador ------- */
.nudge-opciones { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.nudge-folio { display: block; margin-top: 8px; font-size: 11px; font-weight: 800; color: var(--muted); }

/* ---------------- Visitas y folios (panel del agente) ---------------- */
.folio-tag { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 900;
  background: var(--soft); border-radius: 6px; padding: 3px 8px; font-size: 13px; }
.nivel { border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 900; white-space: nowrap;
  border: 1px solid var(--line); background: var(--white); }
.nivel.alto  { color: #fff; background: var(--green); border-color: var(--green); }
.nivel.medio { color: var(--clay); border-color: rgba(239,189,91,.8); background: rgba(239,189,91,.15); }
.nivel.bajo  { color: var(--muted); }

.visita-barras { display: grid; gap: 6px; margin: 12px 0; }
.visita-barra { display: grid; grid-template-columns: minmax(120px, 1fr) 3fr auto; gap: 10px; align-items: center;
  font-size: 14px; }
.visita-barra .via { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.visita-barra .via i { display: block; height: 100%; background: var(--green); }
.visita-barra em { font-style: normal; color: var(--muted); font-size: 13px; white-space: nowrap; }

.usos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.usos span { font-size: 12px; font-weight: 800; background: var(--soft); border-radius: 999px; padding: 5px 10px; }

.sugerencia { border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 10px;
  padding: 12px 14px; background: var(--white); margin-bottom: 10px; }
.sugerencia strong { display: block; margin-bottom: 4px; }
.sugerencia p { margin: 0 0 10px; color: var(--muted); white-space: pre-wrap; font-size: 14px; }

.plantilla { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--white);
  margin-bottom: 10px; }
.plantilla strong { display: block; }
.plantilla p { margin: 4px 0 10px; color: var(--muted); white-space: pre-wrap; font-size: 14px; }

/* ---------------- Agenda ---------------- */
/* Un renglón por día: así caben las citas de lado y se lee como agenda. */
.ag-semana { display: grid; gap: 10px; }
.ag-dia { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 12px 14px; }
.ag-dia.vacio { background: var(--paper); }
.ag-dia.hoy { border-color: var(--green); box-shadow: 0 0 0 2px rgba(31,107,78,.15); }
.ag-dia-head { display: grid; gap: 2px; }
.ag-dia-head strong { text-transform: capitalize; font-size: 16px; }
.ag-dia-head span { color: var(--muted); font-size: 12px; }
.ag-dia-head em { font-style: normal; font-size: 11px; font-weight: 900; color: var(--green); }
.ag-dia-cuerpo { min-width: 0; }
.ag-citas { display: flex; flex-wrap: wrap; gap: 10px; }
.ag-libre { margin: 4px 0; color: var(--muted); font-size: 13px; }

.ag-cita { flex: 1 1 260px; max-width: 340px; display: grid; grid-template-columns: 74px 1fr; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--soft); }
.ag-cita .ag-acciones { grid-column: 1 / -1; }
.ag-cita.choque { border-color: rgba(138,46,23,.45); background: rgba(138,46,23,.07); }
.ag-hora { font-weight: 900; font-size: 15px; }
.ag-hora span { display: block; font-weight: 700; font-size: 12px; color: var(--muted); }
.ag-info strong { display: block; font-size: 14px; }
.ag-acciones { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-acciones select { min-width: 84px; }
.ag-tip { margin: 6px 0 0; font-size: 12px; color: var(--green-dark); background: rgba(47,143,104,.1);
  border-radius: 8px; padding: 8px 10px; line-height: 1.4; }
.pill.danger { color: var(--danger); }
.pill.warn { color: var(--clay); }

.ag-rutas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ag-ruta { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--white); }

@media (max-width: 700px) {
  .ag-dia { grid-template-columns: 1fr; gap: 8px; }
  .ag-cita { max-width: none; }
}

/* ---------------- Expedientes ---------------- */
.ex-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.docs { display: grid; gap: 6px; }
.doc { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: var(--white); font-size: 14px; }
.doc em { font-style: normal; color: var(--muted); font-size: 12px; }
.doc.entregado  { border-left-color: var(--green-2); background: rgba(47,143,104,.07); }
.doc.solicitado { border-left-color: var(--sun); background: rgba(239,189,91,.12); }
.doc select { min-width: 108px; }

.bitacora { display: grid; gap: 8px; }
.bit-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; background: var(--white); }
.bit-item.sistema { background: var(--soft); }
.bit-tipo { flex: 0 0 auto; font-size: 11px; font-weight: 900; text-transform: uppercase; color: var(--green);
  background: rgba(47,143,104,.12); border-radius: 999px; padding: 4px 9px; }
.bit-item p { margin: 0; font-size: 14px; }
.bit-item em { font-style: normal; color: var(--muted); font-size: 12px; }

@media (max-width: 860px) { .ex-cols { grid-template-columns: 1fr; } }

/* ------- Bitácora de actividad de la página (panel del agente) ------- */
.act-barras { display: flex; align-items: flex-end; gap: 3px; height: 130px; margin-top: 12px; }
.act-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  height: 100%; gap: 4px; min-width: 0; }
.act-bar { width: 100%; background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; }
.act-bar.cero { background: var(--line); }
.act-col span { font-size: 10px; color: var(--muted); font-weight: 800; }

.act-meses { display: grid; gap: 8px; }
.act-mes { display: grid; grid-template-columns: 250px 1fr; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--white); }
.act-mes-barra { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; order: 2; }
.act-mes-barra i { display: block; height: 100%; background: var(--green); }
.act-mes-datos { order: 1; }
.act-mes-datos strong { display: block; text-transform: capitalize; }
.act-mes-datos span { color: var(--muted); font-size: 13px; }

/* Redes del agente en la página del comprador */
.redes { display: flex; flex-wrap: wrap; gap: 8px; }
.red { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800;
  font-size: 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  background: var(--white); }
.red:hover { border-color: var(--green); color: var(--green); }
.red-icono { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--soft); font-size: 12px; }

.sugerencia .porque { display: block; color: var(--muted); font-size: 12px; font-weight: 800;
  margin-bottom: 8px; }

/* ---------------- Panel con menú lateral ---------------- */
.wrap.ancho { width: min(1500px, calc(100% - 32px)); }

.panel { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 22px; align-items: start; }
.panel-cuerpo { min-width: 0; }
.panel-seccion { animation: aparece .18s ease-out; }
@keyframes aparece { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.sidebar { position: sticky; top: 84px; }
.nav-lista { display: grid; gap: 4px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-sm); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700;
  padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.nav-item:hover { background: var(--soft); }
.nav-item.activo { background: var(--green); color: #fff; font-weight: 800; }
.nav-icono { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--soft); color: var(--green); font-size: 14px; flex: 0 0 auto; }
.nav-item.activo .nav-icono { background: rgba(255,255,255,.22); color: #fff; }
.nav-aviso { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 900; color: #fff;
  background: var(--clay); border-radius: 999px; padding: 2px 8px; }
.nav-item.activo .nav-aviso { background: rgba(255,255,255,.25); }

/* La primera sección de cada pantalla ya no necesita separarse de la de arriba */
.panel-seccion > .section-head:first-child { margin-top: 0; }

.panel-titulo { color: var(--muted); font-weight: 700; font-size: 15px; }
.panel-titulo::before { content: "/"; margin: 0 8px; color: var(--line); }
.solo-movil { display: none; }

@media (max-width: 900px) {
  .panel { grid-template-columns: 1fr; gap: 12px; }
  .solo-movil { display: inline-grid; }
  .sidebar { position: static; }
  .nav-lista { display: none; }
  .sidebar.abierta .nav-lista { display: grid; }
  .panel-titulo { display: none; }
}

/* En celular la barra de arriba no alcanza para todo: manda el menú y los botones */
@media (max-width: 600px) {
  .topbar #nav-name { display: none; }
  .topbar .btn.sm { padding: 8px 10px; font-size: 13px; }
}
