/* Busquedas e Ingresos — hoja de estilos (v5, 2026-10-19)

   Herramienta de trabajo para asesores, mucha gente grande:
   - Letra Source Sans 3 (Adobe): muy legible en tablas y formularios, con
     numeros claros para precios. Base 18px, buen contraste. (Se probo
     Atkinson Hyperlegible: su cero con barra quedaba raro en los precios.)
   - Barra lateral oscura (azul pizarra) + area de trabajo gris muy claro con
     paneles blancos: se distingue de un vistazo donde esta cada cosa.
   - Un color de accion (azul marino), el dorado del logo solo como marca, y el
     verde reservado para el MATCH.
   - Botones y campos grandes (46px), foco bien visible.

   Las clases son las mismas de siempre: este archivo solo cambia el aspecto. */

:root {
  /* superficies */
  --canvas: #f3f4f6;
  --bg: #ffffff;
  --side: #f7f8fa;          /* fondos suaves dentro de paneles */
  --hover: #f1f3f6;
  --line: #e2e5ea;
  --line-2: #cdd2d9;

  /* texto */
  --text: #17202b;
  --text-2: #475262;
  --muted: #7a8494;

  /* barra lateral */
  --nav-bg: #16212e;
  --nav-text: #c4ccd6;
  --nav-muted: #7f8b9a;
  --nav-hover: rgba(255, 255, 255, 0.06);
  --nav-active: rgba(255, 255, 255, 0.10);

  /* color de accion y marca */
  --primary: #1f3b5c;
  --primary-hover: #182f4a;
  --primary-soft: #eaf0f7;
  --focus: rgba(47, 98, 168, 0.28);
  --accent: #ccb176;        /* dorado del logo de buscan (el rombo) */
  --accent-ink: #7d6c3e;

  /* estados */
  --venta: #2752c4;
  --alquiler: #a33f86;
  --ok: #17784a;
  --danger: #b8322a;
  --match: #17784a;
  --match-soft: #e7f4ec;
  --match-line: #b6dbc4;
  --warn: #d29b00;
  --warn-soft: #fff8e3;

  --radius: 8px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0; background: var(--canvas); color: var(--text);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.icon { flex-shrink: 0; }
.nd { color: #b3b9c2; }
.nowrap { white-space: nowrap; }

/* ================================================================ shell */

.shell { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--nav-bg); color: var(--nav-text);
  display: flex; flex-direction: column; padding: 22px 14px 16px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.wordmark { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; text-decoration: none; }
.wordmark-logo { display: block; height: 30px; width: auto; }
.wordmark-logo-grande { height: 44px; }
.inmo { padding: 12px; margin: 0 0 14px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.05); }
.inmo-label { display: block; font-size: 0.72rem; color: var(--nav-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.inmo-name { display: block; font-size: 0.94rem; font-weight: 600; color: #fff; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius);
  font-size: 0.94rem; color: var(--nav-text); text-decoration: none;
}
.nav a .icon { color: var(--nav-muted); }
.nav a:hover { background: var(--nav-hover); color: #fff; }
.nav a:hover .icon { color: var(--nav-text); }
.nav a.active { background: var(--nav-active); color: #fff; font-weight: 600; }
.nav a.active .icon { color: var(--accent); }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 10px 12px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.sidebar-user { padding: 12px; margin-bottom: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-user b { display: block; font-size: 0.92rem; font-weight: 600; color: #fff; }
.sidebar-user span { font-size: 0.78rem; color: var(--nav-muted); }

.main { min-width: 0; }
.content { max-width: 1220px; padding: 36px 40px 80px; }
.content.narrow { max-width: 960px; }

/* ================================================================ encabezados */

.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 26px;
}
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
h2 { font-size: 1.02rem; font-weight: 700; margin: 0; }
.subtitle { color: var(--text-2); font-size: 0.97rem; margin: 6px 0 0; }
.subtitle a { color: var(--text-2); }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  font-size: 0.9rem; font-weight: 500; color: var(--text-2); text-decoration: none;
}
.back-link:hover { color: var(--primary); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-size: 0.92rem; font-weight: 600; margin-bottom: 10px; }
.empty {
  color: var(--text-2); font-size: 0.97rem; margin: 0;
  padding: 28px 24px; background: var(--bg); border: 1px dashed var(--line-2); border-radius: var(--radius-lg);
}
.table-wrap .empty { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

/* ================================================================ botones */

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 0.96rem; font-weight: 600; line-height: 1;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  background: var(--primary); color: #fff; border: 1px solid var(--primary);
  transition: background-color .12s, border-color .12s, color .12s;
}
button:hover, .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
button:disabled { opacity: 0.6; cursor: default; }
.btn-ghost { background: var(--bg); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--hover); border-color: var(--line-2); color: var(--text); }
.btn-text {
  min-height: 0; background: none; border: 0; padding: 6px 0;
  color: var(--danger); font-size: 0.9rem; font-weight: 600;
}
.btn-text:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.btn-wide { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.84rem; }
.btn-wa { background: var(--match); border-color: var(--match); }
.btn-wa:hover { background: #115c38; border-color: #115c38; }
.btn-peligro { color: var(--danger); border-color: #e4b9b5; }
.btn-peligro:hover { color: var(--danger); background: #fdeeec; border-color: #e4b9b5; }
.btn-borrar {
  min-height: 0; background: none; border: 1px solid transparent; color: var(--muted);
  padding: 7px; border-radius: var(--radius); line-height: 0;
}
.btn-borrar:hover { background: #fdeeec; border-color: #efc9c5; color: var(--danger); }

/* ================================================================ formularios */

/* Cada seccion del formulario es un panel: titulo y ayuda a la izquierda,
   campos a la derecha. */
.fs {
  display: grid; grid-template-columns: 230px 1fr; gap: 36px;
  padding: 26px 28px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.fs-info h2 { margin-bottom: 6px; }
.fs-info p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.fs-fields { min-width: 0; }
.fs-fields > *:first-child, .fs-fields > .row:first-child label { margin-top: 0; }
.fs-fields > .row:first-child > div > label { margin-top: 0; }

label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-2); margin: 18px 0 7px; }
.opt { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 8px 0 0; }
.hint-top { margin: 0 0 12px; }

input[type=text], input[type=number], input[type=email], input[type=url], input[type=tel],
input[type=password], input[type=search], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s;
}
input[type=text], input[type=number], input[type=email], input[type=url], input[type=tel],
input[type=password], input[type=search], input[type=date], input[type=time], select { height: 46px; padding: 0 14px; }
textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: #a7aeb8; }
input:hover, select:hover, textarea:hover { border-color: #b9c0c9; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; }
.row > div > label { margin-top: 18px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 22px; }
.carga-de { color: var(--muted); font-size: 0.9rem; margin: 6px 0 0; }

/* opciones de una sola eleccion (Venta / Alquiler, Si / No importa) */
.radio-line { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-line span { position: relative; }
.radio-line input[type=radio] { position: absolute; opacity: 0; }
.radio-line label {
  margin: 0; display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: 0.96rem; font-weight: 500; color: var(--text);
}
.radio-line label:hover { background: var(--hover); }
.radio-line input:checked + label { background: var(--primary); color: #fff; border-color: var(--primary); }
.radio-line input:focus-visible + label { box-shadow: 0 0 0 3px var(--focus); }

/* casillas tipo boton (tipos de propiedad, amenities) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 16px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: 0.96rem; font-weight: 500; color: var(--text);
}
.chip:hover span { background: var(--hover); }
.chip span::before {
  content: ""; width: 18px; height: 18px; border: 1.5px solid #b3bac4; border-radius: 4px; background: var(--bg); flex-shrink: 0;
}
.chip input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.chip input:checked + span::before {
  border-color: var(--primary); background: var(--primary)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat;
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }

/* lista de barrios con casillas */
.checkbox-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px; max-height: 380px; overflow-y: auto;
  background: var(--bg);
}
.checkbox-item {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 9px 10px; border-radius: 6px; font-size: 0.96rem; font-weight: 400; color: var(--text); cursor: pointer;
}
.checkbox-item:hover { background: var(--hover); }
.checkbox-item:has(input:checked) { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.checkbox-item input { width: 19px; height: 19px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }

/* control segmentado (Todas / Venta / Alquiler, modos de zona) */
.seg {
  display: inline-flex; padding: 3px; gap: 3px;
  background: #e9ecf0; border-radius: var(--radius);
}
.seg button {
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-2); font-size: 0.92rem; font-weight: 600;
}
.seg button:hover { background: rgba(255, 255, 255, 0.6); color: var(--text); }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12); }
.zona-busqueda .seg { flex-wrap: wrap; }

/* marcas de revision (formulario completado por la lectura automatica) */
.campo-dudoso input, .campo-dudoso select { border-color: var(--warn); background: var(--warn-soft); }
.campo-dudoso .radio-line label, .campo-dudoso .chip span { border-color: var(--warn); }
.campo-falta input, .campo-falta select { background: var(--side); border-style: dashed; }
.rev { display: flex; align-items: flex-start; gap: 5px; margin: 6px 0 0; font-size: 0.84rem; line-height: 1.35; }
.rev .icon { flex-shrink: 0; margin-top: 1px; }
.rev-dudoso { color: #8a6300; }
.rev-falta { color: var(--muted); }

/* ================================================================ avisos */

.flash {
  padding: 13px 16px; margin-bottom: 22px; font-size: 0.94rem;
  border: 1px solid; border-left-width: 4px; border-radius: var(--radius); background: var(--bg);
}
.flash.error { border-color: #ecc4c0; border-left-color: var(--danger); color: #8f241e; background: #fdf3f2; }
.flash.ok { border-color: var(--match-line); border-left-color: var(--ok); color: #135c3b; background: var(--match-soft); }
.flash code { font-size: 0.88em; }

.aviso-dup {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; margin-bottom: 22px;
  border: 1px solid #ecd28a; border-left: 4px solid var(--warn); border-radius: var(--radius);
  background: var(--warn-soft); font-size: 0.92rem; color: var(--text-2);
}
.aviso-dup .icon { color: #b38600; flex-shrink: 0; margin-top: 2px; }
.aviso-dup b { color: var(--text); display: block; margin-bottom: 2px; }
.aviso-dup span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.86rem; }

.aviso-pass {
  border: 1px solid var(--match-line); border-left: 4px solid var(--match); border-radius: var(--radius-lg);
  background: var(--match-soft); padding: 16px 20px; margin-bottom: 24px;
}
.aviso-pass-datos { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 8px 0; font-size: 1.05rem; }
.aviso-pass .pass { font-size: 1.15rem; letter-spacing: 0.02em; background: var(--bg); padding: 2px 8px; border-radius: 5px; border: 1px solid var(--match-line); }
.aviso-pass p { margin: 4px 0 0; font-size: 0.88rem; color: var(--text-2); }

/* ================================================================ inicio */

.primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.primary-action {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 28px; min-height: 220px; text-decoration: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.primary-action .icon {
  color: var(--primary); margin-bottom: 20px; padding: 10px; box-sizing: content-box;
  background: var(--primary-soft); border-radius: var(--radius);
}
.primary-action:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08); }
.primary-action:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.primary-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; }
.primary-desc { color: var(--text-2); font-size: 0.95rem; margin-top: 6px; max-width: 340px; }
.primary-cta { margin-top: auto; padding-top: 20px; font-size: 0.95rem; font-weight: 700; color: var(--primary); }
.primary-action:hover .primary-cta { text-decoration: underline; text-underline-offset: 4px; }

.secondary-heading {
  font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em;
  margin: 36px 0 10px;
}
.secondary-actions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.secondary-action { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--bg); text-decoration: none; }
.secondary-action:last-child:nth-child(odd) { grid-column: span 2; }
.secondary-action .icon { color: var(--primary); }
.secondary-action:hover { background: #fafbfc; }
.secondary-action:hover .secondary-title { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.secondary-title { display: block; font-size: 1rem; font-weight: 600; }
.secondary-desc { display: block; font-size: 0.86rem; color: var(--muted); }

/* ================================================================ resumen numerico */

.scoreboard { display: flex; flex-wrap: wrap; gap: 12px; margin: -4px 0 22px; }
.score {
  display: flex; align-items: baseline; gap: 10px; padding: 14px 20px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.score b { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.score span { color: var(--text-2); font-size: 0.94rem; }
.score-match { background: var(--match-soft); border-color: var(--match-line); }
.score-match b { color: var(--match); }

/* ================================================================ filtros de las tablas */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.filters input[type=search] { width: 320px; height: 44px; font-size: 0.96rem; }
.toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 0.94rem; font-weight: 600; color: var(--text); cursor: pointer; }
.toggle input { width: 19px; height: 19px; accent-color: var(--match); margin: 0; }
.filters-count { margin-left: auto; color: var(--muted); font-size: 0.88rem; }
.f-limpiar[hidden] { display: none; }
.f-limpiar { align-self: center; }

.filters-2 {
  gap: 10px 14px; align-items: flex-end; padding: 12px 14px; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.f-campo { display: flex; flex-direction: column; gap: 4px; margin: 0; flex-shrink: 0; font-size: 0.76rem; font-weight: 700; color: var(--muted); }
.f-campo select, .f-campo input {
  width: auto; min-width: 0; height: 38px; padding: 0 6px 0 10px; margin: 0;
  font-size: 0.88rem; border-radius: 6px;
}
.f-precio-inputs { display: flex; gap: 6px; }
.f-precio-inputs input { width: 100px; padding-right: 10px; }

/* ================================================================ tablas */

.table-wrap {
  overflow-x: auto; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.tabla { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabla th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  font-size: 0.78rem; font-weight: 700; color: var(--text-2);
  background: #f7f8fa; padding: 11px 12px; border-bottom: 1px solid var(--line);
}
.tabla td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover td { background: #fafbfc; }
.tabla .num { text-align: right; white-space: nowrap; }
.tabla .actions { text-align: right; white-space: nowrap; }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.row-baja td { color: var(--muted); }
.rol-admin { color: var(--accent-ink); font-weight: 700; }
.acciones-acceso form { display: flex; flex-wrap: wrap; gap: 10px; }

/* tablas de "Consultar": una columna por dato, la fila abre la ficha */
.tabla-c { font-size: 0.9rem; }
.tabla-c th { padding: 0 9px; height: 42px; }
.tabla-c td { padding: 11px 9px; vertical-align: middle; }
.tabla-c tr.fila-link { cursor: pointer; }
.tabla-c tr.fila-link:hover td { background: #f5f7fa; }
.tabla-c tr.row-match td { background: #f4faf6; }
.tabla-c tr.row-match:hover td, .tabla-c tr.fila-link.row-match:hover td { background: #eaf5ee; }
.tabla-c tr.row-match td:first-child { box-shadow: inset 4px 0 0 var(--match); }
.tabla-c .c-match { width: 70px; white-space: nowrap; }
.tabla-c .c-num, .tabla-c th.c-num { text-align: right; white-space: nowrap; }
.tabla-c .c-valor { font-weight: 700; }
.tabla-c .c-fecha { white-space: nowrap; color: var(--text-2); font-size: 0.86rem; }
.tabla-c .c-acc { text-align: right; white-space: nowrap; width: 1%; }
.tabla-c .c-titulo { min-width: 150px; max-width: 220px; }
.tabla-c .c-op { white-space: nowrap; }
.tabla-c .c-tipo-solo { white-space: normal; max-width: 110px; }
.tabla-c .c-asesor { white-space: normal; min-width: 0; max-width: 170px; }
.tabla-c .c-asesor .t-sec { white-space: nowrap; }
.tabla-c .c-ir { width: 1%; padding-left: 0; color: #c3c9d1; }
.tabla-c tr.fila-link:hover .c-ir { color: var(--primary); }
.tabla-c a.t-link { text-decoration: none; }
.tabla-c tr.fila-link:hover a.t-link { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.t-principal { display: block; font-weight: 600; color: var(--text); line-height: 1.3; }
.t-sec { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
a.t-sec { color: var(--muted); }
.cliente-sub { color: var(--match); font-weight: 600; }
.vencida { color: var(--danger); font-size: 0.84rem; font-weight: 700; }

.match-pill {
  display: inline-block; min-width: 28px; padding: 3px 9px; border-radius: 999px; text-align: center;
  background: var(--match); color: #fff; font-weight: 700; font-size: 0.84rem;
}
.ver-matches { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; font-size: 0.88rem; color: var(--match); }
.ver-matches span:last-child { text-decoration: underline; text-underline-offset: 3px; }

.op { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; white-space: nowrap; }
.op::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.op-venta { color: var(--venta); }
.op-alquiler { color: var(--alquiler); }
.op span { color: var(--text); }
.op-chip { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.op-chip.op-venta { background: #ebf0fc; color: var(--venta); }
.op-chip.op-alquiler { background: #f8ecf4; color: var(--alquiler); }

/* encabezados que ordenan */
.tabla-c th.th-orden { padding: 0; }
.th-orden button {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; width: 100%;
  height: 42px; padding: 0 9px; cursor: pointer; font: inherit; color: inherit; white-space: nowrap;
}
/* En las columnas de numeros (alineadas a la derecha) la flechita va a la
   IZQUIERDA del titulo: asi el titulo termina justo donde terminan los numeros. */
.tabla-c th.c-num.th-orden button { flex-direction: row-reverse; justify-content: flex-start; }
/* Columnas cortas (Amb., Cochera): titulo y valor centrados. El ::before
   ocupa lo mismo que la flechita, asi el titulo queda centrado de verdad. */
.tabla-c .c-centro, .tabla-c th.c-centro { text-align: center; white-space: nowrap; }
.tabla-c th.c-centro.th-orden button { justify-content: center; }
.tabla-c th.c-centro.th-orden button::before { content: ""; width: 8px; flex: none; }
.th-orden button:hover { color: var(--primary); }
.th-orden button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.th-orden .flecha { width: 8px; display: inline-block; font-size: 0.66rem; }
.th-orden[aria-sort=ascending] .flecha::after { content: "▲"; }
.th-orden[aria-sort=descending] .flecha::after { content: "▼"; }
.th-orden[aria-sort=ascending], .th-orden[aria-sort=descending] { color: var(--primary); }

/* ================================================================ fichas */

.prop-price { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.page-header .prop-price { font-size: 1.2rem; margin-bottom: 2px; }
.bq-cliente { font-size: 0.86rem; font-weight: 700; color: var(--match); margin-bottom: 2px; }

.ficha-grupo {
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); margin: 24px 0 8px;
}
.ficha-datos {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
/* La ultima fila no lleva linea abajo: cada celda se corre 1px y el borde queda recortado. */
.ficha-datos > div { padding: 12px 18px; border-bottom: 1px solid var(--line); margin-bottom: -1px; border-right: 1px solid var(--line); }
.ficha-datos > div:nth-child(3n) { border-right: 0; }
.ficha-datos > .ficha-ancho { grid-column: span 3; border-right: 0; }
.ficha-datos dt { font-size: 0.8rem; color: var(--muted); }
.ficha-datos dd { margin: 3px 0 0; font-size: 1rem; font-weight: 600; }
.ficha-datos dd .nd { font-weight: 400; }
.ficha-datos.ficha-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ficha-datos.ficha-2 > div { border-right: 1px solid var(--line); }
.ficha-datos.ficha-2 > div:nth-child(2n), .ficha-datos.ficha-2 > .ficha-ancho { border-right: 0; }
.ficha-datos.ficha-2 > .ficha-ancho { grid-column: span 2; }
.dd-nota { display: block; font-size: 0.84rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
a.dd-nota { color: var(--muted); }

/* ficha del ingreso */
.ficha { display: grid; grid-template-columns: 1fr; gap: 20px; margin: 0 0 34px; }
.ficha-con-mapa { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.ficha-mapa { height: auto; min-height: 300px; margin: 0; }

/* ficha de la busqueda */
.ficha-b { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; margin: 0 0 34px; align-items: start; }
.ficha-b section > .ficha-grupo:first-child { margin-top: 0; }
.ficha-b-mapa { height: 380px; margin: 0; }
.zona-chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.zona-chip {
  display: inline-block; padding: 7px 13px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: 0.94rem; font-weight: 600;
}
.zona-desc { margin: 0 0 8px; font-weight: 600; }

.group-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; margin: 0 0 14px; }
.dot-match { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--match); box-shadow: 0 0 0 4px var(--match-soft); }

/* tarjetas de propiedad compatible */
.props { display: flex; flex-direction: column; gap: 8px; }
.props-solo { padding: 0; }
.prop {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 18px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: border-color .12s, box-shadow .12s;
}
.prop-link { cursor: pointer; }
.prop-link:hover { border-color: #b7c3d3; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.07); }
.prop-title { font-weight: 600; font-size: 0.96rem; margin-top: 2px; }
.prop-title span { font-weight: 400; color: var(--text-2); }
.prop-title-link { color: inherit; text-decoration: none; }
.prop-link:hover .prop-title-link, .prop-title-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prop-specs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.prop-specs span { font-size: 0.8rem; color: var(--text-2); padding: 2px 8px; border-radius: 5px; background: #f1f3f6; }
.prop-contact { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.prop-who { font-weight: 700; font-size: 0.92rem; }
.prop-tel { color: var(--text-2); font-size: 0.86rem; }
.prop-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ================================================================ cargar ingreso: link / descripcion */

.modos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
a.modo { text-decoration: none; }
a.modo:hover .modo-titulo { color: var(--primary); }
.modo {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; text-align: left; min-height: 0;
  padding: 20px 22px; background: var(--bg); color: var(--text);
  border: 1.5px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.modo:hover { background: var(--bg); border-color: var(--line-2); }
.modo .icon { color: var(--text-2); margin-bottom: 8px; }
.modo.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--bg); }
.modo.on .icon { color: var(--primary); }
.modo-titulo { font-size: 1.1rem; font-weight: 700; }
.modo-desc { font-size: 0.88rem; color: var(--muted); font-weight: 400; line-height: 1.4; }
.panel-modo {
  padding: 22px 24px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.panel-modo > label:first-of-type { margin-top: 0; }
.panel-modo .form-actions { padding-top: 16px; }
.btn-leer { min-width: 220px; }
.leyendo {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 18px;
  background: var(--primary-soft); border: 1px solid #cfdcec; border-radius: var(--radius-lg);
}
.leyendo b { display: block; }
.leyendo span:not(.spinner) { font-size: 0.88rem; color: var(--text-2); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #c6d3e4; border-top-color: var(--primary); animation: girar 0.8s linear infinite; flex-shrink: 0; }
@keyframes girar { to { transform: rotate(360deg); } }
.leyendo[hidden], .panel-modo[hidden] { display: none; }

/* ================================================================ mapas */

.zona-panel { margin-top: 16px; }
.zona-panel[hidden], .zona-mapa[hidden] { display: none; }
.zona-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mapa-estado { margin: 0; font-size: 0.9rem; color: var(--text-2); }
.zona-acciones { display: flex; gap: 8px; }
.row-radio { grid-template-columns: 1fr 150px auto; align-items: end; }
.row-radio .col-boton button { width: 100%; }
.mapa {
  height: 400px; margin-top: 14px; z-index: 0;
  background: var(--side); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
}
.mapa-chico { height: 260px; margin-top: 6px; }
.mapa-matches { height: 340px; margin: 0 0 26px; }
.mapa.con-lapiz { cursor: crosshair; touch-action: none; }
.mapa.con-lapiz .leaflet-interactive { cursor: crosshair; }
.zona-mapa > label { margin-top: 18px; }
.ubicacion-ingreso { margin-top: 18px; }
.leaflet-container { font-family: inherit; font-size: 0.8rem; }
.leaflet-container a { color: var(--text-2); }
.leaflet-bar a { color: var(--text); }

/* ================================================================ acceso (login, activar...) */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-side {
  background: var(--nav-bg); color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side .wordmark { padding: 0; }
.auth-side blockquote { margin: 0; max-width: 400px; font-size: 1.45rem; font-weight: 500; line-height: 1.4; color: #e6eaef; }
.auth-side small { color: var(--nav-muted); font-size: 0.92rem; max-width: 360px; line-height: 1.5; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-form .box { width: 100%; max-width: 520px; }
.auth-form h1 { margin-bottom: 8px; }
.auth-form .subtitle { margin-bottom: 26px; }
.auth-form .form-actions { padding-top: 22px; }
.auth-form .foot { color: var(--muted); font-size: 0.88rem; margin-top: 20px; }
.auth-form .foot a { color: var(--primary); font-weight: 600; }
.auth-section { font-size: 0.97rem; margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-extra { line-height: 1.7; }

/* ================================================================ informe de mercado */

:root { --chart: #2f4a6e; --chart-soft: #b4c2d6; --chart-track: #eef1f5; }

.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.kpi { display: flex; flex-direction: column; padding: 18px 20px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi-label { font-size: 0.86rem; color: var(--text-2); }
.kpi-value { white-space: nowrap; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 6px 0 4px; }
.kpi-value small { font-size: 0.55em; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.kpi-note { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

.insight { border-left: 4px solid var(--accent); background: #fbf8f0; border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin-bottom: 30px; font-size: 0.97rem; }

.report-block {
  margin-bottom: 20px; min-width: 0; padding: 20px 22px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.report-block .table-wrap, .report-block .tabla-simple { box-shadow: none; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.block-head span { color: var(--muted); font-size: 0.85rem; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

.hbar { display: flex; align-items: center; gap: 10px; }
.hbar span { display: block; height: 14px; min-width: 2px; background: var(--chart); border-radius: 0 4px 4px 0; }
.hbar b { font-weight: 600; font-size: 0.86rem; color: var(--text); }
.tabla-informe td { vertical-align: middle; padding-top: 10px; padding-bottom: 10px; }
.tabla-informe .col-bar { width: 38%; min-width: 180px; }
.tabla-informe .cero { color: var(--danger); }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 44px; align-items: center; gap: 12px; font-size: 0.92rem; }
.bar-label { color: var(--text-2); }
.bar-pct { text-align: right; color: var(--muted); font-size: 0.85rem; }

.columns { display: flex; align-items: flex-end; gap: 16px; height: 220px; padding-top: 8px; border-bottom: 1px solid var(--line-2); }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.col-value { font-size: 0.88rem; margin-bottom: 6px; }
.col-track { flex: 1; width: 100%; max-width: 56px; display: flex; align-items: flex-end; }
.col-track span { display: block; width: 100%; background: var(--chart); border-radius: 4px 4px 0 0; min-height: 2px; }
.col-track span.parcial { background: var(--chart-soft); }
.col-label { font-size: 0.84rem; color: var(--text-2); text-align: center; padding-top: 8px; margin-bottom: -44px; height: 44px; line-height: 1.3; }
.col-label small { color: var(--muted); }
.report-grid .report-block:has(.columns) { padding-bottom: 64px; }

.tabla-simple { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }

.metodologia { border-top: 1px solid var(--line-2); padding-top: 22px; margin-top: 8px; color: var(--text-2); font-size: 0.88rem; }
.metodologia h2 { font-size: 0.92rem; margin-bottom: 8px; }
.metodologia ul { margin: 0; padding-left: 18px; }
.metodologia li { margin-bottom: 4px; }

/* ================================================================ pantallas medianas (notebooks) */

/* Las tablas de Consultar tienen que entrar enteras, sin scroll de costado,
   desde 1280px: medir .table-wrap (clientWidth vs scrollWidth). */
@media (max-width: 1400px) {
  .shell { grid-template-columns: 240px 1fr; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .nav a { font-size: 0.88rem; gap: 9px; padding: 9px 10px; white-space: nowrap; }
  .nav a.active::before { left: -10px; }
  .content { padding: 30px 32px 72px; }
  .tabla-c { font-size: 0.86rem; }
  .tabla-c td { padding: 10px 7px; }
  .tabla-c th, .th-orden button { padding: 0 7px; }
  .tabla-c .c-titulo { min-width: 130px; max-width: 180px; }
  .tabla-c .c-asesor { max-width: 130px; }
  .tabla-c .c-match { width: 58px; }
  .tabla-c .c-acc { padding-left: 2px; padding-right: 2px; }
  .fs { grid-template-columns: 200px 1fr; gap: 28px; }
}
@media (max-width: 1000px) { .ficha-b { grid-template-columns: 1fr; } }

/* ================================================================ celular / tablet */

@media (max-width: 900px) {
  /* La barra de arriba mide lo suyo y el contenido ocupa el resto: sin esto,
     en paginas cortas (una lista vacia) el alto de pantalla se repartia y la
     barra quedaba enorme. */
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto; overflow: visible;
    flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 8px 10px;
  }
  .wordmark { padding: 0 8px 0 4px; }
  .wordmark-logo { height: 26px; }
  .inmo, .nav-sep, .sidebar-user { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 9px; }
  .nav a span { display: none; }
  .nav a.active::before { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding-top: 0; }
  .content { padding: 22px 16px 64px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .fs { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
  .primary-actions { grid-template-columns: 1fr; }
  .secondary-actions { grid-template-columns: 1fr; }
  .secondary-action:last-child:nth-child(odd) { grid-column: auto; }
  .primary-action { min-height: 0; }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
  .modos { grid-template-columns: 1fr; }
  .filters input[type=search] { width: 100%; }
  .filters-count { margin-left: 0; }
  .prop { flex-direction: column; align-items: stretch; gap: 12px; }
  .prop-contact { text-align: left; align-items: flex-start; }
  .ficha-con-mapa { grid-template-columns: 1fr; }
  .ficha-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ficha-datos > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .ficha-datos > div:nth-child(2n) { border-right: 0; }
  .ficha-datos > .ficha-ancho { grid-column: span 2; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; gap: 24px; }
  .auth-side blockquote { font-size: 1.15rem; }
  .auth-form { padding: 32px 20px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .report-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 40px; }
}
@media (max-width: 700px) { .row-radio { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .checkbox-grid { grid-template-columns: 1fr; }
  .nav a { padding: 7px; }
}

/* ================================================================ impresion (informe) */

@media print {
  body { background: #fff; }
  .sidebar, .no-print { display: none !important; }
  .shell { display: block; }
  .content { max-width: none; padding: 0; }
  html { font-size: 13px; }
  .report-block, .kpis, .insight { break-inside: avoid; box-shadow: none; }
  .hbar span, .col-track span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ================================================================ buscador de barrios (static/barrios.js) */

.combo { position: relative; }
.combo[hidden], .checkbox-grid[hidden] { display: none; }
.combo-caja {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 52px; padding: 6px 8px; cursor: text;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s;
}
.combo-caja:hover { border-color: #b9c0c9; }
.combo-caja:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.combo-elegidos { display: contents; list-style: none; margin: 0; padding: 0; }
.combo-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 4px 0 12px;
  background: var(--primary-soft); color: var(--primary); border-radius: 6px; font-size: 0.95rem; font-weight: 600;
}
.combo-quitar {
  min-height: 0; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px;
  background: transparent; color: var(--primary); font-size: 1.25rem; font-weight: 400; line-height: 1;
}
.combo-quitar:hover { background: rgba(31, 59, 92, 0.12); border: 0; }
.combo-input.combo-input {
  flex: 1 1 180px; min-width: 140px; height: 38px; padding: 0 6px;
  border: 0; box-shadow: none; background: transparent;
}
.combo-input.combo-input:focus { box-shadow: none; }
.combo-opciones {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  max-height: 300px; overflow-y: auto; list-style: none; margin: 0; padding: 6px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
}
.combo-opciones[hidden] { display: none; }
.combo-op { padding: 10px 12px; border-radius: 6px; font-size: 0.98rem; cursor: pointer; }
.combo-op:hover, .combo-op.activa { background: var(--primary-soft); color: var(--primary); }
.combo-vacio { padding: 10px 12px; color: var(--muted); font-size: 0.94rem; }

/* ================================================================ panel del dueno */

.score-pend { background: var(--warn-soft); border-color: #ecd28a; }
.score-pend b { color: #8a6300; }
.tabla-panel td { vertical-align: middle; }
.tabla-panel tr.row-pend td { background: #fffcf0; }
.tabla-panel form.inline { display: inline; }
.panel-uso { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 0.82rem; white-space: nowrap; }
.panel-uso dt { color: var(--muted); }
.panel-uso dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.estado { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.estado-activa { background: var(--match-soft); color: var(--match); }
.estado-pendiente { background: var(--warn-soft); color: #8a6300; }
.estado-baja { background: #f1f3f6; color: var(--muted); }

/* Pantallas bajas (notebooks): la barra lateral entra entera sin scroll. */
@media (min-width: 901px) and (max-height: 960px) {
  .sidebar { padding-top: 16px; padding-bottom: 10px; }
  .wordmark { padding-bottom: 14px; }
  .inmo { padding: 9px 12px; margin-bottom: 10px; }
  .nav a { padding-top: 7px; padding-bottom: 7px; }
  .nav-sep { margin: 6px 12px; }
  .sidebar-foot { padding-top: 8px; }
  .sidebar-user { padding: 8px 12px; margin-bottom: 2px; }
}
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================================================================ ficha del ingreso estilo portal (2026-10-20) */

/* galeria: una foto grande y hasta cuatro chicas, como Zonaprop */
.galeria {
  position: relative; display: grid; gap: 6px; height: 400px; margin-bottom: 22px;
  border-radius: var(--radius-lg); overflow: hidden; background: var(--line);
}
.galeria-5, .galeria-4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.galeria-4 .galeria-foto:nth-child(4) { grid-column: span 2; }  /* ver tambien abajo */
.galeria-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.galeria-2 { grid-template-columns: 1fr 1fr; }
.galeria-1 { grid-template-columns: 1fr; }
.galeria-foto {
  all: unset; position: relative; display: block; overflow: hidden; cursor: zoom-in; background: #dfe3e8; min-height: 0;
}
.galeria-foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.galeria-foto:hover img { transform: scale(1.03); }
/* despues de .galeria-foto (que hace all: unset y borraria la ubicacion en la grilla) */
.galeria .galeria-principal { grid-row: span 2; }
.galeria-2 .galeria-principal, .galeria-1 .galeria-principal { grid-row: auto; }
.galeria-4 .galeria-foto:nth-child(4) { grid-column: span 2; }
.galeria-foto:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.galeria-foto.rota img { visibility: hidden; }
.galeria-todas {
  position: absolute; right: 14px; bottom: 14px; min-height: 40px; padding: 0 14px;
  background: rgba(255, 255, 255, 0.95); color: var(--text); border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.galeria-todas:hover { background: #fff; color: var(--primary); border: 0; }

/* dos columnas: datos + contacto fijo */
.aviso { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; margin-bottom: 34px; }
.aviso-main {
  padding: 24px 26px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.aviso-linea { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.aviso-precio { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 14px; }
.aviso-op { font-size: 1.15rem; font-weight: 600; color: var(--text-2); }
.aviso-valor { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.aviso-dir { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 1.05rem; font-weight: 600; }
.aviso-dir .icon { color: var(--primary); }
.aviso-mapa { height: 260px; margin: 0 0 6px; }

.carac {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 10px;
  list-style: none; margin: 20px 0 0; padding: 20px 0 4px; border-top: 1px solid var(--line);
}
.carac li { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 0.95rem; font-weight: 600; }
.carac .icon { color: var(--text-2); }

.aviso-seccion { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.aviso-seccion h2 { font-size: 1.12rem; margin-bottom: 12px; }
.amenities { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; }
.amenities li { display: inline-flex; align-items: center; gap: 7px; font-size: 0.98rem; }
.amenities .icon { color: var(--match); }
.aviso-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.aviso-datos dt { font-size: 0.82rem; color: var(--muted); }
.aviso-datos dd { margin: 2px 0 0; font-weight: 600; }

/* tarjeta de contacto (queda fija al bajar) */
.aviso-contacto { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; }
.contacto-card {
  display: flex; flex-direction: column; gap: 10px; padding: 20px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.contacto-titulo { margin: 0 0 2px; font-size: 1.05rem; font-weight: 700; }
.contacto-quien { display: flex; align-items: center; gap: 12px; }
.contacto-quien b { display: block; font-size: 1.02rem; }
.contacto-quien div span { display: block; font-size: 0.86rem; color: var(--muted); }
.contacto-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 1.1rem;
}
.contacto-tel { display: flex; align-items: center; gap: 7px; margin: 2px 0 4px; font-size: 1.02rem; font-weight: 600; color: var(--text-2); }
.contacto-card .btn { justify-content: center; }
.contacto-match {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px; text-decoration: none; font-weight: 700; color: var(--match);
  background: var(--match-soft); border: 1px solid var(--match-line); border-radius: var(--radius-lg);
}
.contacto-match:hover { text-decoration: underline; text-underline-offset: 3px; }

/* visor de fotos a pantalla completa */
.visor {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 20, 0.92);
}
.visor[hidden] { display: none; }
.visor-img { max-width: calc(100vw - 160px); max-height: calc(100vh - 100px); object-fit: contain; border-radius: 6px; }
.visor button {
  position: absolute; min-height: 0; width: 52px; height: 52px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); border: 0; color: #fff; font-size: 2rem; font-weight: 400; line-height: 1;
}
.visor button:hover { background: rgba(255, 255, 255, 0.24); border: 0; }
.visor-cerrar { top: 20px; right: 20px; }
.visor-ant { left: 24px; top: 50%; transform: translateY(-50%); }
.visor-sig { right: 24px; top: 50%; transform: translateY(-50%); }
.visor-cuenta { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: #dfe4ea; font-size: 0.95rem; }

@media (max-width: 1100px) {
  .aviso { grid-template-columns: 1fr; }
  .aviso-contacto { position: static; }
}
@media (max-width: 900px) {
  .galeria { height: 260px; }
  .galeria-5, .galeria-4, .galeria-3 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .galeria .galeria-foto:not(.galeria-principal) { display: none; }
  .galeria .galeria-principal { grid-row: auto; }
  .aviso-main { padding: 18px; }
  .aviso-valor { font-size: 1.6rem; }
  .aviso-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visor-img { max-width: 100vw; }
  .visor-ant { left: 8px; } .visor-sig { right: 8px; }
}
.prop-foto { width: 132px; height: 96px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; background: #dfe3e8; }
.prop-con-foto .prop-body { flex: 1; min-width: 0; }
@media (max-width: 900px) { .prop-foto { width: 100%; height: 170px; } }
.aviso-datos-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .aviso-datos-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ================================================================ celular (2026-10-20): menu con nombres, tablas como tarjetas */

/* En la compu: la barra lateral de siempre. */
.topbar { display: block; }
.menu-toggle, .f-abrir, .solo-movil { display: none; }
.sidebar-menu { display: flex; flex-direction: column; flex: 1; min-height: 0; }

@media (max-width: 900px) {
  /* Barra de arriba: marca + boton "Menu" (con texto). El menu se despliega
     con todas las opciones y sus nombres, en vez de una fila de iconos. */
  .sidebar {
    position: sticky; top: 0; z-index: 50; height: auto; overflow: visible;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 0;
  }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
  .topbar .wordmark { padding: 0; }
  .topbar .wordmark-logo { height: 26px; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px;
    background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.98rem; font-weight: 600;
  }
  .menu-toggle:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.2); }
  .menu-icono { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
  .menu-icono span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .15s, opacity .15s; }
  .menu-abierto .menu-icono span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-abierto .menu-icono span:nth-child(2) { opacity: 0; }
  .menu-abierto .menu-icono span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .sidebar-menu { display: none; }
  .sidebar.menu-abierto .sidebar-menu {
    display: flex; max-height: calc(100vh - 64px); overflow-y: auto; padding: 4px 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sidebar-menu .inmo { display: block; margin-top: 10px; }
  .sidebar-menu .nav-sep { display: block; }
  .sidebar-menu .sidebar-user { display: block; }
  .sidebar-menu .nav { flex-direction: column; flex-wrap: nowrap; }
  .sidebar-menu .nav a { padding: 12px 12px; font-size: 1.02rem; }
  .sidebar-menu .nav a span { display: inline; }
  .sidebar-menu .nav a.active::before { display: block; left: -14px; }
  .sidebar-menu .sidebar-foot { margin: 0; padding-top: 10px; }
  body.sin-scroll { overflow: hidden; }

  .page-header { gap: 14px; margin-bottom: 18px; }
  .page-header > .btn { width: 100%; }
  h1 { font-size: 1.5rem; }
}

@media (max-width: 700px) {
  /* resumen numerico en dos columnas compactas */
  .scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .score { padding: 12px 14px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .score b { font-size: 1.6rem; }

  /* filtros: buscador y Venta/Alquiler a lo ancho; el resto detras de "Filtros" */
  .filters { gap: 10px; }
  .filters .seg { width: 100%; }
  .filters .seg button { flex: 1; }
  .f-abrir { display: inline-flex; min-height: 40px; padding: 0 14px; margin-left: auto; }
  .f-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
         border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.8rem; }
  .f-n[hidden] { display: none; }
  .filters-count { margin-left: 0; }
  .filters-2 { display: none; }
  .filters-2.abierto { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .filters-2 .f-campo select, .filters-2 .f-campo input { width: 100%; }
  .filters-2 .f-precio { grid-column: 1 / -1; }
  .f-precio-inputs { display: grid; grid-template-columns: auto 1fr 1fr; }
  .f-precio-inputs input { width: 100%; }

  /* tablas de Consultar: cada fila es una tarjeta con sus datos etiquetados */
  .table-wrap:has(.tabla-c) { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  .tabla-c, .tabla-c tbody { display: block; }
  .tabla-c thead { display: none; }
  .tabla-c tr {
    position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    margin-bottom: 10px; padding: 14px 16px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  }
  .tabla-c tr[hidden] { display: none; }
  .tabla-c tr.row-match { background: #f4faf6; border-color: var(--match-line); box-shadow: inset 4px 0 0 var(--match), var(--shadow); }
  .tabla-c tr.fila-link:hover td, .tabla-c tr.row-match td, .tabla-c tr.row-match:hover td { background: transparent; }
  .tabla-c tr.row-match td:first-child { box-shadow: none; }
  .tabla-c td {
    display: block; padding: 0; border: 0; text-align: left; white-space: normal;
    min-width: 0; max-width: none; width: auto; font-size: 0.95rem;
  }
  .tabla-c td.c-num, .tabla-c td.c-centro { text-align: left; }
  .tabla-c td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 1px;
    font-size: 0.76rem; font-weight: 600; color: var(--muted);
  }
  .tabla-c td.c-titulo { grid-column: 1 / -1; order: -2; padding-right: 64px; max-width: none; min-width: 0; }
  .tabla-c td.c-titulo .t-principal { font-size: 1.05rem; }
  .tabla-c td.c-match { position: absolute; top: 14px; right: 14px; width: auto; }
  .tabla-c td.c-match:has(.nd) { display: none; }
  .tabla-c td.c-match .solo-movil { display: inline; font-weight: 600; }
  .tabla-c td.c-titulo { padding-right: 120px; }
  .tabla-c td.c-asesor { max-width: none; }
  .tabla-c td.c-asesor:first-child { grid-column: 1 / -1; order: -1; }
  .tabla-c td.c-valor { font-size: 1.05rem; white-space: normal; overflow-wrap: anywhere; }
  .tabla-c td.c-ir { display: none; }
  .tabla-c td.c-acc { position: absolute; right: 8px; bottom: 8px; width: auto; padding: 0; }
  .tabla-c td.c-fecha { color: var(--text-2); }
  .table-wrap .empty { border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }

  /* ficha: botones y datos comodos con el pulgar */
  .ficha-datos, .ficha-datos.ficha-2 { grid-template-columns: 1fr 1fr; }
  .carac { grid-template-columns: repeat(3, 1fr); }
  .zona-acciones { width: 100%; }
  .zona-acciones .btn { flex: 1; }
  .form-actions button, .form-actions .btn { flex: 1 1 100%; }
}
@media (max-width: 700px) {
  /* pares minimo / maximo lado a lado */
  .fs-fields .row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .fs-fields .row-radio { grid-template-columns: 1fr; }
  .fs { padding: 18px 16px; margin-bottom: 12px; }
  /* modos de zona: dos arriba y el tercero a lo ancho */
  .zona-busqueda .seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .zona-busqueda .seg button:last-child { grid-column: 1 / -1; }
  .radio-line span { flex: 1 1 auto; }
  .radio-line label { width: 100%; justify-content: center; }
}
@media (max-width: 700px) {
  /* ficha del ingreso: contacto en una barra fija abajo, siempre a mano */
  .aviso-contacto { position: static; }
  .contacto-card {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    flex-direction: row; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-radius: 0; border-width: 1px 0 0; box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.10);
  }
  .contacto-titulo, .contacto-quien, .contacto-tel, .contacto-nota { display: none; }
  .contacto-card .btn { flex: 1; min-height: 48px; padding: 0 8px; font-size: 0.9rem; width: auto; }
  .contacto-card .btn .icon { display: none; }
  .contacto-card .btn-wa .icon { display: inline-block; }
  body:has(.contacto-card) .content { padding-bottom: 96px; }
}
@media (max-width: 700px) { .solo-compu { display: none; } }

/* ================================================================ planes */
.plan-form select { height: 38px; width: auto; padding: 0 6px 0 10px; font-size: 0.88rem; }
.uso-tope { color: var(--danger); font-weight: 700; }
.score b small { font-size: 0.55em; font-weight: 600; color: var(--muted); }
.score-plan b { font-size: 1.3rem; }
.cupo { margin: -8px 0 18px; color: var(--text-2); font-size: 0.94rem; }
.tabla-panel td:first-child { min-width: 170px; }
.tabla-panel td:nth-child(2) { min-width: 150px; overflow-wrap: anywhere; }
.tabla-panel th { white-space: normal; line-height: 1.25; }
.tabla-panel th, .tabla-panel td { padding-left: 9px; padding-right: 9px; }
.panel-copias { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-estado > * { display: block !important; width: fit-content; margin: 0 0 8px auto; }
.panel-estado > :last-child { margin-bottom: 0; }
.plan-form { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.plan-cambiar[hidden] { display: none; }
.plan-cambio { display: flex; align-items: stretch; gap: 18px; margin-bottom: 18px; }
.plan-caja {
  flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 20px 22px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.plan-caja b { font-size: 1.5rem; }
.plan-caja span { color: var(--text-2); }
.plan-caja .plan-etq { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.plan-caja-nuevo { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.plan-caja-nuevo.plan-baja { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.plan-flecha { align-self: center; font-size: 2rem; color: var(--muted); }
.plan-uso { margin: 0 0 18px; color: var(--text-2); }
.btn-peligro-lleno { background: var(--danger); border-color: var(--danger); }
.btn-peligro-lleno:hover { background: #962821; border-color: #962821; }
@media (max-width: 700px) { .plan-cambio { flex-direction: column; } .plan-flecha { transform: rotate(90deg); } }
.plan-cambiar { white-space: nowrap; }

/* cartel mientras se guarda un ingreso y se mandan los avisos */
.enviando {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(22, 33, 46, 0.55); backdrop-filter: blur(2px);
}
.enviando[hidden] { display: none; }
.enviando-caja {
  display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; padding: 32px 36px; text-align: center;
  background: var(--bg); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(16, 24, 40, 0.3);
}
.enviando-caja b { font-size: 1.2rem; }
.enviando-caja span:not(.spinner) { color: var(--text-2); font-size: 0.95rem; line-height: 1.45; }
.spinner-grande { width: 40px; height: 40px; border-width: 4px; margin-bottom: 6px; }

/* ================================================================ pantallas de error (404 / 500) */
.error-caja { max-width: 560px; margin: 40px auto; padding: 36px; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.error-caja .form-actions { justify-content: center; }
.error-icono { display: inline-flex; padding: 14px; margin-bottom: 14px; border-radius: 50%; background: var(--warn-soft); color: #8a6300; }
.error-publico { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--canvas); }

/* ================================================================ panel: datos de cada inmobiliaria (2026-11-11) */
.panel-datos { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
button.link-btn, button.link-btn:hover {
  background: none; border: 0; padding: 0; min-height: 0; box-shadow: none;
  font: inherit; font-size: 0.8rem; font-weight: 500; color: var(--primary);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
button.link-btn.link-peligro { color: var(--danger); }
.btn-sin-corte { white-space: nowrap; }

/* ================================================================ informe con filtros (2026-11-16) */
.informe-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin: 0 0 22px; }
.informe-filtros label { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.informe-filtros select, .informe-filtros input { height: 42px; min-width: 0; }
.informe-filtros select { width: auto; }
.informe-precio small { font-weight: 400; color: var(--muted); }
.informe-precio-campos { display: flex; gap: 6px; }
.informe-precio-campos select { width: 92px; flex-shrink: 0; }
.informe-precio { white-space: nowrap; }
.informe-precio-campos input { width: 130px; }
.informe-filtros-acciones { display: flex; gap: 8px; }
.informe-filtros-acciones button, .informe-filtros-acciones .btn { height: 42px; }
.simulacion { margin-bottom: 22px; }
.valores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.valor { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-right: 1px solid var(--line); }
.valor:last-child { border-right: 0; }
@media (max-width: 900px) {
  .informe-filtros label { flex: 1 1 140px; }
  .informe-filtros select { width: 100%; }
  .informe-precio { flex-basis: 100% !important; }
  .informe-precio-campos input { flex: 1; width: auto; }
  .valores { grid-template-columns: 1fr; }
  .valor { border-right: 0; border-bottom: 1px solid var(--line); }
  .valor:last-child { border-bottom: 0; }
}
.kpis-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) and (min-width: 901px) { .kpis-5 { grid-template-columns: repeat(3, 1fr); } .kpis-5 .kpi:nth-child(3) { border-right: 0; } .kpis-5 .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 900px) { .kpis-5 { grid-template-columns: 1fr 1fr; } .informe-filtros .informe-precio-campos select { width: 92px; } .kpis-5 .kpi:nth-child(4) { border-right: 0; } .kpis-5 .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--line); } .kpis-5 .kpi:nth-child(odd) { border-right: 1px solid var(--line); } .kpis-5 .kpi:nth-child(5) { grid-column: span 2; border-right: 0; } }

/* Segundo factor del Panel */
.qr-caja { width: 200px; max-width: 100%; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line, #ddd); }
.qr-caja svg { display: block; width: 100%; height: auto; }
.qr-clave { font-size: 13px; word-break: break-all; user-select: all; }
.codigos-recuperacion { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.codigos-recuperacion code { font-size: 16px; letter-spacing: .04em; }
.fs-fields form + form { margin-top: 18px; }


/* Contacto de quien busca (ficha de una busqueda ajena) */
.contacto-busca { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; margin: 0 0 22px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.contacto-busca-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.contacto-nota { margin: 0 0 4px; font-size: 0.92rem; color: var(--text-2); line-height: 1.45; }
.c-asesor-wa { margin-top: 6px; width: max-content; }
@media (max-width: 700px) {
  .contacto-busca-acc { width: 100%; }
  .contacto-busca-acc .btn { flex: 1; justify-content: center; }
}


/* Cargar busqueda: dos opciones (texto o a mano) y el texto original al revisar */
.modos.modos-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .modos.modos-2 { grid-template-columns: 1fr; } }
.texto-original { margin: 0 0 20px; padding: 12px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.texto-original summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.texto-original p { margin: 10px 0 0; white-space: pre-wrap; color: var(--text-2); }


/* Equipo: uso del plan con medidores */
.plan-uso-caja { margin: -4px 0 26px; padding: 20px 24px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.plan-uso-cabecera { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.plan-uso-cabecera > div { display: flex; align-items: baseline; gap: 10px; }
.plan-uso-etq, .plan-uso-mes { font-size: 0.82rem; color: var(--muted); }
.plan-uso-etq { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.plan-uso-cabecera b { font-size: 1.15rem; }
.medidores { display: grid; grid-template-columns: minmax(0, 320px); gap: 28px; }
.medidor { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.medidor-titulo { font-size: 0.86rem; font-weight: 600; color: var(--text-2); }
.medidor-cifra { display: flex; align-items: baseline; gap: 6px; }
.medidor-cifra b { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.medidor-cifra span { font-size: 0.95rem; color: var(--muted); }
.medidor-barra { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.medidor-barra span { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.medidor-alto span { background: var(--warn); }
.medidor-lleno span { background: var(--danger); }
.medidor-nota { font-size: 0.82rem; color: var(--muted); }
.plan-uso-sin-duenio { margin: -14px 0 24px; }
@media (max-width: 700px) {
  .medidores { grid-template-columns: 1fr; gap: 18px; }
  .plan-uso-caja { padding: 16px 18px; }
}

/* ================================================================ negocio (solo el dueño, 2026-11-24) */
.neg-tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: -10px 0 28px; border-bottom: 1px solid var(--line-2); }
.neg-tabs a { padding: 10px 0 9px; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--text-2); text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.neg-tabs a:hover { color: var(--text); }
.neg-tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.neg-vencida { color: var(--danger); font-weight: 600; }
.neg-etapa { background: var(--primary-soft); color: var(--primary); }
.neg-cliente { background: var(--match-soft); color: var(--match); }
.neg-prueba, .neg-propuesta { background: var(--warn-soft); color: #8a6300; }
.neg-no, .neg-baja { background: #f1f3f6; color: var(--muted); }
.neg-select { width: auto; height: 44px; font-size: 0.96rem; }
.neg-tareas, .neg-historial { list-style: none; margin: 0; padding: 0; }
.neg-tareas li { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); }
.neg-tareas li:first-child { border-top: 0; padding-top: 0; }
.neg-tareas a, .neg-item a, .neg-cobrar a, .tabla a.cell-title { text-decoration: none; }
.neg-tareas a:hover, .neg-item a:hover, .neg-cobrar a:hover, .tabla a.cell-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.neg-cuando { font-size: 0.84rem; font-weight: 700; color: var(--text-2); }
.neg-u-vencida { color: var(--danger); }
.neg-u-hoy { color: var(--ok); }
.neg-u-aviso { color: #8a6300; }
.neg-embudo { display: flex; flex-direction: column; gap: 4px; }
.neg-embudo .bar-row { grid-template-columns: 160px 1fr 34px; padding: 5px 0; text-decoration: none; }
.neg-embudo .bar-row b { text-align: right; }
.neg-embudo .bar-row:hover .bar-label { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.neg-meses td, .neg-meses th { padding-left: 10px; padding-right: 10px; }
.neg-paso { grid-template-columns: 1fr 190px; }
.neg-paso-2 { grid-template-columns: 190px 1fr; }
.neg-check { padding: 12px 0 0; font-size: 0.92rem; }
.neg-check:hover, .neg-check:has(input:checked) { background: none; color: var(--text); font-weight: 400; }
.neg-historial { margin-top: 26px; border-top: 1px solid var(--line); }
.neg-historial li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.neg-historial li.neg-futuro { background: var(--side); margin: 0 -14px; padding: 14px; }
.neg-hist-cab { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.neg-hist-cab > span { color: var(--text-2); font-size: 0.9rem; }
.neg-hist-cab form { margin-left: auto; }
.neg-texto { margin-top: 4px; white-space: pre-line; overflow-wrap: anywhere; font-size: 0.95rem; }
.neg-linea { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.neg-linea input { height: 36px; font-size: 0.9rem; padding: 0 10px; min-width: 0; }
.neg-linea input[type=date], .neg-linea input[type=time] { width: auto; }
.neg-linea button { flex-shrink: 0; }
.neg-item { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.neg-item:first-of-type { border-top: 0; }
.neg-item-que { min-width: 0; flex: 1; }
.neg-item .neg-linea { margin-top: 0; }
.neg-cobrar { display: grid; grid-template-columns: minmax(150px, 1fr) 110px 170px 160px auto; gap: 12px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line); }
.neg-cobrar:first-of-type { border-top: 0; }
.neg-cobrar label { margin: 0; font-size: 0.8rem; }
.neg-cobrar label input, .neg-cobrar label select { height: 38px; padding: 0 10px; font-size: 0.92rem; margin-top: 4px; }
.neg-cobrar-que { align-self: center; }
.neg-cobrar-botones { display: flex; gap: 8px; }
.fs-fields .neg-cobrar { grid-template-columns: 1fr 1fr 1fr; }
.fs-fields .neg-cobrar-que, .fs-fields .neg-cobrar-botones { grid-column: 1 / -1; }
.fs-fields .neg-cobrar + .tabla { margin-top: 18px; }
.neg-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.94rem; }
.neg-dl dt { color: var(--muted); }
.neg-dl dd { margin: 0; }
.neg-mas { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.neg-mas summary { cursor: pointer; color: var(--text-2); font-size: 0.92rem; font-weight: 600; }
.neg-credito { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; margin-bottom: 20px; background: var(--match-soft); border: 1px solid var(--match-line); border-radius: var(--radius-lg); }
.neg-credito b { font-size: 1.35rem; }
.neg-credito span { color: var(--text-2); }
.neg-credito-ya { background: #fdf3f2; border-color: #ecc4c0; }
.neg-gasto { margin-top: 6px; }
.neg-ajustes { grid-template-columns: repeat(4, 1fr); align-items: end; }
@media (max-width: 900px) {
  .neg-tabs { margin-top: 0; gap: 0 18px; }
  .neg-tabs a { padding: 8px 0 7px; }
  .neg-cobrar, .fs-fields .neg-cobrar { grid-template-columns: 1fr 1fr; }
  .neg-cobrar-que, .neg-cobrar-botones { grid-column: 1 / -1; }
  .neg-item { flex-direction: column; align-items: stretch; gap: 10px; }
  .neg-ajustes { grid-template-columns: 1fr 1fr; }
  .neg-paso, .neg-paso-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .neg-seccion .kpi { padding: 14px; min-width: 0; }
  .neg-seccion .kpi-value { font-size: 1.35rem; }
  .neg-seccion .tabla-simple { display: block; overflow-x: auto; }
  .neg-tareas li { grid-template-columns: 62px 1fr; }
  .neg-embudo .bar-row { grid-template-columns: 130px 1fr 24px; }
  .neg-tabla thead { display: none; }
  .neg-tabla, .neg-tabla tbody { display: block; }
  .neg-tabla tr { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .neg-tabla tr:last-child { border-bottom: 0; }
  .neg-tabla td { padding: 0; border: 0; }
  .neg-tabla td:has(> .nd), .neg-tabla td.neg-ultimo { display: none; }
}
