/* Viviendas RD — azul de marca para acciones y datos, naranja para lo destacado, negro para el texto */
:root {
  --azul: #0188c9;
  --azul-d: #0172a9;
  --azul-claro: #e7f4fb;
  --naranja: #f0a03d;
  --naranja-d: #b8711a;
  --naranja-claro: #fdf2e3;
  --negro: #121417;
  --ink: var(--azul);
  --ink-2: var(--azul-d);
  --ink-3: var(--azul-claro);
  --brass: var(--naranja);
  --brass-d: var(--naranja-d);
  --bg: #f3f6f9;
  --card: #ffffff;
  --line: #e2e8ee;
  --line-2: #eef2f6;
  --text: #121417;
  --muted: #5f6b77;
  --soft: #97a2ad;
  --ok: #1f8a5b;    --ok-bg: #e6f4ec;
  --warn: #b26a12;  --warn-bg: #fdf1e0;
  --bad: #c0392b;   --bad-bg: #fbe9e7;
  --info: #0172a9;  --info-bg: #e7f4fb;
  --gray-bg: #edf1f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10,40,70,.05), 0 4px 16px rgba(10,40,70,.05);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Carga ---------- */
.pantalla-carga { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--azul); border-radius: 50%; animation: gira .8s linear infinite; }
.cargando { padding: 60px 0; display: grid; place-items: center; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Logo ---------- */
.logo-img { display: block; height: auto; max-width: 100%; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-arte { background: var(--azul); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.login-arte::before { content: ''; position: absolute; right: -60px; bottom: -40px; width: 420px; height: 420px;
  background: rgba(255,255,255,.08);
  clip-path: polygon(50% 0, 100% 38%, 100% 100%, 0 100%, 0 38%); opacity: .9; }
.login-arte::after { content: ''; position: absolute; right: 40px; bottom: 120px; width: 220px; height: 18px; background: var(--naranja); transform: skewY(-32deg); border-radius: 3px; opacity: .9; }
.login-logo { background: #fff; border-radius: 14px; padding: 14px 18px; width: fit-content; max-width: 320px; position: relative; z-index: 1; }
.login-arte h1 { font-size: 40px; line-height: 1.1; font-weight: 800; max-width: 460px; text-wrap: balance; position: relative; z-index: 1; }
.login-arte h1 span { color: var(--negro); background: var(--naranja); padding: 0 8px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.login-arte p { color: #d9eefa; max-width: 400px; position: relative; z-index: 1; }
.login-arte .pie { color: #bfe2f5; position: relative; z-index: 1; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: #fff; }
.login-form form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-form h2 { font-size: 24px; }
.login-form .logo-movil { display: none; max-width: 240px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-arte { display: none; } .login-form .logo-movil { display: block; } }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px 18px; overflow-y: auto; }
.sidebar .marca-lateral { padding: 0 8px 20px; border-bottom: 1px solid var(--line-2); margin-bottom: 8px; }
.sidebar .marca-lateral img { width: 190px; }
.nav { display: grid; gap: 2px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); padding: 16px 12px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; font-weight: 600; color: #3a434d; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: var(--bg); color: var(--negro); }
.nav a.activo { background: var(--azul-claro); color: var(--azul-d); box-shadow: inset 3px 0 0 var(--azul); }
.nav a.activo svg { opacity: 1; }
.nav a .contador { margin-left: auto; background: var(--naranja); color: var(--negro); font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.sidebar-pie { margin-top: auto; border-top: 1px solid var(--line-2); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--azul-claro); color: var(--azul-d); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.sidebar-pie .quien { min-width: 0; flex: 1; }
.sidebar-pie .quien b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-pie .quien span { font-size: 12px; color: var(--muted); }
.btn-salir { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.btn-salir:hover { color: var(--bad); background: var(--bad-bg); }

.contenido { min-width: 0; }
.topbar { display: none; }
.pagina { padding: 28px 24px 60px; max-width: 1400px; margin: 0 auto; }
.pagina-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pagina-cab h1 { font-size: 26px; font-weight: 800; }
.pagina-cab .sub { color: var(--muted); margin-top: 2px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.migas { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.migas a:hover { color: var(--brass-d); }

@media (max-width: 1199px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.abierto { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: var(--negro); padding: 4px; cursor: pointer; }
  .topbar img { width: 150px; }
  .pagina { padding: 20px 16px 50px; }
}

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn:hover { border-color: #cbd5df; background: #f8fafc; }
.btn svg { width: 16px; height: 16px; }
.btn-primario { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primario:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-oro { background: var(--naranja); border-color: var(--naranja); color: var(--negro); }
.btn-oro:hover { background: #e8912a; border-color: #e8912a; color: var(--negro); }
.btn-peligro { color: var(--bad); }
.btn-peligro:hover { background: var(--bad-bg); border-color: #f1c4bd; }
.btn-chico { padding: 5px 10px; font-size: 12px; }
.btn-icono { padding: 7px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-bloque { width: 100%; padding: 11px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 0; }
.card-cab h3 { font-size: 15px; font-weight: 800; }
.card-cuerpo { padding: 16px 18px 18px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-21 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.g-12 { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
@media (max-width: 1100px) { .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-21, .g-12 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .g-2, .g-3 { grid-template-columns: 1fr; } }
.mb { margin-bottom: 16px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; min-width: 0; container-type: inline-size; }
.kpi .et { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 24px; font-size: clamp(16px, 10.5cqi, 24px); font-weight: 800; margin-top: 6px; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
.kpi .val2 { font-size: 15px; font-size: clamp(12px, 7cqi, 15px); font-weight: 700; color: var(--muted); overflow-wrap: anywhere; }
.kpi .pie { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.alerta .val { color: var(--bad); }
.kpi.oro { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi.oro .et { color: #fff; opacity: .85; }
.kpi.oro .val2, .kpi.oro .pie { color: #d9eefa; }
.kpi.oro .barra { background: rgba(255,255,255,.25); }
.kpi.oro .barra > i { background: var(--naranja); }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 11px 9px; border-bottom: 1px solid var(--line); background: #f8fafc; white-space: normal; line-height: 1.3; vertical-align: bottom; }
.tabla td { padding: 12px 9px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr.click { cursor: pointer; }
.tabla tbody tr.click:hover td { background: #f6fafd; }
.tabla .principal { font-weight: 700; }
.tabla .sec { font-size: 12px; color: var(--muted); }
.tabla tfoot td { font-weight: 800; border-top: 1px solid var(--line); background: #f8fafc; }
.vacio { padding: 40px 20px; text-align: center; color: var(--muted); }
.vacio svg { width: 38px; height: 38px; color: var(--soft); margin-bottom: 8px; }

/* ---------- Filtros ---------- */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filtros .buscar { flex: 1; min-width: 200px; position: relative; }
.filtros .buscar svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--soft); }
.filtros .buscar input { padding-left: 34px; }
.filtros select, .filtros input { width: auto; }
.filtros .buscar input { width: 100%; }

/* ---------- Formularios ---------- */
.campo { display: grid; gap: 5px; }
.campo label { font-size: 12px; font-weight: 700; color: #3c4553; }
.campo .ayuda { font-size: 12px; color: var(--muted); }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 11px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(1,136,201,.16); }
textarea { resize: vertical; min-height: 76px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; align-items: start; }
.form-grid .ancho { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.error-form { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.caja-calculo { background: var(--azul-claro); border: 1px dashed #9fd0ea; border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; font-size: 13px; }
.caja-calculo .fila { display: flex; justify-content: space-between; gap: 10px; }
.caja-calculo .total { font-weight: 800; border-top: 1px solid #b9dcef; padding-top: 6px; margin-top: 2px; }
.caja-calculo.mal { background: var(--bad-bg); border-color: #f1c4bd; }
.extras-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.extras-lista { display: grid; gap: 8px; }
.extras-lista:empty { display: none; }
.extra-fila { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.extra-n { font-weight: 800; color: var(--muted); font-size: 12px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--gray-bg); color: #4b5563; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.sin-punto::before { display: none; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-oro { background: var(--naranja-claro); color: var(--naranja-d); }
.b-ink { background: #e9edf1; color: #3a434d; }

/* ---------- Progreso ---------- */
.barra { height: 7px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.barra > i { display: block; height: 100%; background: var(--azul); border-radius: 99px; }
.barra.ok > i { background: var(--ok); }
.barra-grande { height: 12px; }

/* ---------- Etapas (stepper) ---------- */
.etapas { display: flex; gap: 0; overflow-x: auto; padding: 4px 0; }
.etapa { flex: 1; min-width: 96px; text-align: center; position: relative; font-size: 12px; font-weight: 600; color: var(--soft); }
.etapa .pt { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: #fff; margin: 0 auto 7px; display: grid; place-items: center; position: relative; z-index: 1; font-size: 11px; font-weight: 800; }
.etapa::before { content: ''; position: absolute; top: 12px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.etapa:first-child::before { display: none; }
.etapa.hecha { color: var(--text); }
.etapa.hecha .pt { background: var(--azul); border-color: var(--azul); color: #fff; }
.etapa.hecha::before, .etapa.actual::before { background: var(--ink); }
.etapa.actual { color: var(--negro); font-weight: 800; }
.etapa.actual .pt { border-color: var(--naranja); background: var(--naranja); color: var(--negro); box-shadow: 0 0 0 4px rgba(240,160,61,.25); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.activo { color: var(--azul-d); border-color: var(--azul); }
.segmentado { display: inline-flex; background: var(--gray-bg); border-radius: 9px; padding: 3px; }
.segmentado button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 700; font-size: 12px; cursor: pointer; color: var(--muted); }
.segmentado button.activo { background: #fff; color: var(--azul-d); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Kanban CRM ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.columna { background: #e9eef3; border-radius: 12px; padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; }
.columna.sobre { background: var(--azul-claro); outline: 2px dashed var(--azul); }
.columna-cab { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 4px 4px; }
.tarjeta-cli { background: #fff; border-radius: 9px; padding: 10px 12px; border: 1px solid var(--line); cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tarjeta-cli:hover { border-color: #9fd0ea; }
.tarjeta-cli b { display: block; }
.tarjeta-cli .meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; gap: 6px; }
.tarjeta-cli.arrastrando { opacity: .4; }

/* ---------- Línea de tiempo ---------- */
.timeline { display: grid; gap: 0; }
.evento { display: grid; grid-template-columns: 34px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.evento::before { content: ''; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line-2); }
.evento:last-child::before { display: none; }
.evento .ico { width: 34px; height: 34px; border-radius: 50%; background: var(--azul-claro); color: var(--azul-d); display: grid; place-items: center; }
.evento .ico svg { width: 16px; height: 16px; }
.evento .cab { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.evento .cab b { color: var(--text); font-size: 13px; }
.evento .txt { margin-top: 3px; white-space: pre-wrap; }
.evento .prox { margin-top: 8px; font-size: 12px; background: var(--info-bg); color: var(--info); padding: 6px 10px; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; }
.evento .prox.hecho { background: var(--ok-bg); color: var(--ok); text-decoration: line-through; }

/* ---------- Listas compactas ---------- */
.lista { display: grid; }
.lista .item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.lista .item:last-child { border-bottom: 0; }
.lista .item .cuerpo { flex: 1; min-width: 0; }
.lista .item .cuerpo b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista .item .cuerpo span { font-size: 12px; color: var(--muted); }
.datos { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.datos dt { color: var(--muted); font-weight: 600; }
.datos dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---------- Gráficos ---------- */
.grafico svg { width: 100%; height: auto; display: block; }
.grafico .eje { fill: var(--soft); font-size: 11px; font-family: var(--font); }
.grafico .valor { fill: var(--text); font-size: 10px; font-weight: 700; font-family: var(--font); }
.barras-h { display: grid; gap: 10px; }
.barras-h .fila { display: grid; grid-template-columns: 132px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.barras-h .fila .barra { height: 10px; }
.barras-h .fila b { text-align: right; }

/* ---------- Modal ---------- */
.modal-fondo { position: fixed; inset: 0; background: rgba(10,25,40,.45); z-index: 100; display: grid; place-items: center; padding: 20px; animation: aparece .15s; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.ancho { max-width: 760px; }
.modal-cab { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-cab h3 { font-size: 17px; font-weight: 800; }
.modal-cab button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; }
.modal-cuerpo { padding: 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-pie { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes aparece { from { opacity: 0; } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--negro); color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: sube .2s; max-width: 360px; }
.toast.error { background: var(--bad); }
.toast.ok { border-left: 4px solid var(--naranja); }
@keyframes sube { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Desempeño ---------- */
.selector-mes { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 5px; }
.selector-mes b { min-width: 150px; text-align: center; font-size: 15px; }
.selector-mes .btn { border: 0; }
.destacado-quien { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 16px; }
.destacado-quien:hover b { text-decoration: underline; }
.kpi.oro .destacado-quien .avatar { background: #fff; color: var(--azul-d); }
.avatar.puesto { width: 28px; height: 28px; font-size: 12px; background: var(--gray-bg); color: var(--muted); }
.avatar.puesto.oro { background: var(--naranja); color: var(--negro); }
tr.mes-vacio td { color: var(--soft); }
a.card.kpi:hover { border-color: #9fd0ea; }
.nav a .contador.gris { background: var(--gray-bg); color: var(--muted); }

/* ---------- Exclusividad / comisión ---------- */
.badge-exclusiva { background: var(--naranja); color: var(--negro); }
.badge-exclusiva::before { display: none; }
.check-linea { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 600; }
.check-linea input { width: 18px; height: 18px; accent-color: var(--azul); flex: none; }
.comision-caja { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Impresión (estado de cuenta) ---------- */
.solo-impresion { display: none; }
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .no-imprimir, #toasts, .acciones, .tabs { display: none !important; }
  .layout { display: block; }
  .pagina { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .solo-impresion { display: block; }
  .kpi.oro { background: #fff; color: var(--text); border-color: #ddd; }
  .kpi.oro .et, .kpi.oro .val2, .kpi.oro .pie { color: var(--muted); }
}
.btn-mini { background: none; border: 0; padding: 3px; border-radius: 6px; color: var(--soft); cursor: pointer; display: inline-grid; place-items: center; }
.btn-mini:hover { background: var(--bad-bg); color: var(--bad); }
.fila-neto { display: flex; justify-content: space-between; gap: 10px; background: var(--azul-claro); border-radius: 9px; padding: 9px 12px; font-weight: 700; }
.fila-neto b { color: var(--azul-d); }
.btn-mini-txt { background: none; border: 0; padding: 0 2px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: underline; }
.btn-mini-txt:hover { color: var(--bad); }
.btn-mini-txt.accion { color: var(--azul-d); font-size: 12px; margin-top: 4px; padding: 0; }
.btn-mini-txt.accion:hover { color: var(--azul); }
.tabla th:first-child, .tabla td:first-child { padding-left: 16px; }
.tabla th:last-child, .tabla td:last-child { padding-right: 16px; }
.pila { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* ---------- Fotos de perfil ---------- */
img.avatar-foto { object-fit: cover; border-radius: 50%; display: block; flex: none; background: var(--gray-bg); }
.foto-editor { display: flex; align-items: center; gap: 18px; }
.foto-editor .avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); }
.foto-editor input[type=file] { display: none; }
.avatar-boton { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; position: relative; }
.avatar-boton:hover::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--azul); }
.puesto-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--gray-bg); color: var(--muted); flex: none; }
.puesto-num.oro { background: var(--naranja); color: var(--negro); }
.con-foto { display: flex; align-items: center; gap: 10px; min-width: 0; }
.foto-puesto { position: relative; flex: none; }
.foto-puesto .puesto-num { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; font-size: 10px; box-shadow: 0 0 0 2px var(--card); }

/* ---------- Tarjetas de asesor (Desempeño) ---------- */
.tarjetas-asesor { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tarjeta-asesor { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tarjeta-asesor:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(10,40,70,.12); border-color: #9fd0ea; }
.tarjeta-asesor.lider { border: 2px solid var(--naranja); }
.ta-foto { position: relative; aspect-ratio: 1 / 1; max-width: 100%; background: linear-gradient(160deg, var(--azul) 0%, #0b5f8f 100%); overflow: hidden; }
.ta-foto img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.ta-foto::after { content: ''; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(to top, rgba(8,20,32,.82), rgba(8,20,32,0)); pointer-events: none; }
.foto-iniciales { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.92); font-size: 64px; font-weight: 800; letter-spacing: .02em; }
.ta-puesto { position: absolute; top: 12px; left: 12px; z-index: 1; background: rgba(255,255,255,.92); color: var(--negro); font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 99px; }
.tarjeta-asesor.lider .ta-puesto { background: var(--naranja); }
.ta-nombre { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; color: #fff; display: grid; }
.ta-nombre b { font-size: 20px; line-height: 1.15; text-wrap: balance; }
.ta-nombre span { font-size: 12px; opacity: .85; font-weight: 600; }
.ta-cuerpo { padding: 14px 16px 16px; display: grid; gap: 12px; }
.ta-premios { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-premio { display: inline-flex; align-items: center; gap: 5px; background: var(--azul-claro); color: var(--azul-d); font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.chip-premio.oro { background: var(--naranja); color: var(--negro); }
.ta-principal { display: flex; align-items: baseline; gap: 8px; }
.ta-principal b { font-size: 30px; line-height: 1; }
.ta-principal span { color: var(--muted); font-weight: 600; }
.ta-datos { display: grid; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.ta-datos .dato { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ta-datos .dato span { color: var(--muted); }
.ta-datos .dato b { text-align: right; }
.resumen-equipo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.resumen-equipo b { color: var(--text); font-size: 16px; }
.foto-historial { width: 96px; height: 96px; border-radius: 18px; overflow: hidden; flex: none; background: linear-gradient(160deg, var(--azul), #0b5f8f); box-shadow: var(--shadow); }
.foto-historial img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
.foto-historial .foto-iniciales { font-size: 34px; }

/* ---------- Alineación de tablas ----------
   Primera columna (nombres) a la izquierda; números y montos centrados, con su encabezado centrado igual. */
.tabla th, .tabla td { vertical-align: middle; }
.tabla th.right, .tabla td.right { text-align: center; }
.tabla td.right .barra { margin-left: auto; margin-right: auto; }
.tabla td.celda-acciones, .tabla th:last-child:empty { text-align: right; white-space: nowrap; }
.tabla td.right .ta-premios, .tabla td.right .pila { justify-content: center; align-items: center; }

/* ---------- Listas: el texto largo se corta con "…" y la etiqueta de la derecha nunca se sale ---------- */
.lista { grid-template-columns: minmax(0, 1fr); }
.lista .item { min-width: 0; }
.lista .item > .badge, .lista .item > b, .lista .item > .btn, .lista .item > .right, .lista .item > .avatar, .lista .item > img, .lista .item > .puesto-num { flex: none; }
.lista .item .cuerpo span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid > *, .kpis > *, .form-grid > * { min-width: 0; }

/* ---------- Documentos ---------- */
.doc-item { gap: 8px; }
.doc-abrir { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.doc-abrir:hover b { color: var(--azul-d); text-decoration: underline; }
.doc-ico { width: 38px; height: 44px; border-radius: 6px; background: var(--azul-claro); color: var(--azul-d); font-size: 10px; font-weight: 800; display: grid; place-items: center; flex: none; border: 1px solid #cfe6f3; }

/* ---------- Bloqueo de unidad ---------- */
.badge-bloqueo { background: #2b2f36; color: #fff; }
.badge-bloqueo::before { display: none; }
.badge-bloqueo svg { width: 11px; height: 11px; }
.bloqueo-vencido { background: var(--bad-bg); color: var(--bad); }

/* ---------- Captaciones ---------- */
.tarjetas-captacion { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.captacion { padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.captacion h3 { font-size: 16px; text-wrap: balance; }
.captacion .precio { font-size: 22px; font-weight: 800; }
.captacion .ficha { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.captacion .pie-capt { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 10px; font-size: 12px; color: var(--muted); }
.click-card { text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; transition: border-color .15s, box-shadow .15s, transform .15s; }
.click-card:hover { border-color: #9fd0ea; transform: translateY(-1px); box-shadow: 0 8px 22px rgba(10,40,70,.10); }
.click-card:focus-visible, .doc-abrir:focus-visible, .tarjeta-asesor:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* Fotos de proyectos: portada, galería y visor */
.portada-proyecto { position: relative; aspect-ratio: 16 / 5; min-height: 190px; max-width: 100%; border-radius: 16px; background-size: cover; background-position: center; overflow: hidden; box-shadow: var(--shadow); }
.portada-proyecto .portada-ver { position: absolute; inset: 0; background: transparent; border: 0; cursor: zoom-in; }
.portada-proyecto .portada-txt { position: absolute; left: 22px; bottom: 18px; right: 190px; color: #fff; pointer-events: none; display: grid; gap: 2px; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.portada-proyecto .portada-txt b { font-size: 24px; line-height: 1.15; }
.portada-proyecto .portada-txt span { font-size: 13px; opacity: .9; }
.portada-proyecto .portada-btn { position: absolute; right: 16px; bottom: 16px; background: rgba(255,255,255,.92); }
.portada-proyecto.sin-foto { border: 2px dashed rgba(255,255,255,.4); }
.portada-vacia { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: rgba(255,255,255,.85); font-weight: 600; font-size: 14px; padding-bottom: 30px; pointer-events: none; }
.portada-vacia svg { width: 30px; height: 30px; }
.tarjeta-proyecto { overflow: hidden; padding: 0; }
.proy-portada { aspect-ratio: 16 / 8; max-width: 100%; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.55); }
.proy-portada svg { width: 42px; height: 42px; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.galeria-item { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border: 0; padding: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--line-2); }
.galeria-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.galeria-item:hover img { transform: scale(1.04); }
.galeria-portada { position: absolute; left: 8px; top: 8px; background: var(--naranja); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.galeria-mas { position: absolute; inset: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.fotos-previa { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
.fotos-previa img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.visor-foto { position: relative; background: #0d1520; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.visor-foto img { max-width: 100%; max-height: 64vh; display: block; object-fit: contain; }
.visor-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.visor-nav svg { width: 20px; height: 20px; }
.visor-nav.ant { left: 12px; } .visor-nav.sig { right: 12px; }
.visor-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .portada-proyecto { aspect-ratio: 16 / 9; }
  .portada-proyecto .portada-txt { right: 22px; bottom: 60px; }
  .portada-proyecto .portada-txt b { font-size: 20px; }
}

/* Documentos PDF (plan de pago y recibo) */
.pdf-barra { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdf-visor { background: #e9edf1; border-radius: 12px; padding: 14px; display: grid; gap: 14px; justify-items: center; max-height: 68vh; overflow: auto; }
.pdf-pagina { width: 100%; max-width: 900px; height: auto; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); border-radius: 2px; }

/* =====================================================================
   PORTAL DEL CLIENTE (pensado primero para celular)
   ===================================================================== */
.btn-grande { min-height: 48px; font-size: 15px; }
.btn-link { background: none; border: 0; color: var(--azul); font-weight: 700; cursor: pointer; padding: 6px 0; font: inherit; }
.btn-link:disabled { color: var(--soft); cursor: default; }
.btn-wa { background: #1faa59; border-color: #1faa59; color: #fff; }
.btn-wa:hover { background: #17924b; }
.seleccionable { user-select: all; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--azul); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--azul); outline-offset: 2px; }

/* Acceso */
.pt-acceso { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(170deg, var(--azul-claro) 0%, var(--bg) 55%); }
.pt-acceso-caja { width: 100%; max-width: 400px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 22px; display: grid; gap: 14px; text-align: center; }
.pt-acceso-caja h1 { margin: 0; font-size: 22px; }
.pt-acceso-caja p { margin: 0; }
.pt-acceso-caja form { display: grid; gap: 12px; text-align: left; }
.pt-acceso-logo { height: 54px; justify-self: center; object-fit: contain; }
.pt-codigo { font-size: 30px !important; letter-spacing: 12px; text-align: center; font-weight: 800; padding: 12px !important; font-variant-numeric: tabular-nums; }
.pt-acceso-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pt-acceso-pie { text-align: center; }

/* Estructura */
body.modo-portal { background: var(--bg); }
.pt-app { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.pt-cab { position: sticky; top: 0; z-index: 30; background: var(--card); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.pt-cab-in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.pt-logo { height: 34px; object-fit: contain; flex: none; }
.pt-cab-der { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pt-selector { display: flex; align-items: center; gap: 6px; background: var(--azul-claro); color: var(--azul-d); border-radius: 99px; padding: 0 4px 0 10px; min-width: 0; }
.pt-selector svg { width: 16px; height: 16px; flex: none; }
.pt-selector select { border: 0; background: transparent; font-weight: 700; color: var(--azul-d); padding: 7px 4px; width: auto; max-width: 52vw; min-width: 0; text-overflow: ellipsis; }
.pt-unidad-fija { font-size: 13px; font-weight: 700; color: var(--azul-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.pt-yo { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--azul); color: #fff; font-weight: 800; cursor: pointer; flex: none; }
.pt-tabs-escritorio { display: none; }
.pt-main { max-width: 760px; margin: 0 auto; display: grid; gap: 14px;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.pt-main > * { min-width: 0; }
.pt-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
.pt-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; }
.pt-nav a svg { width: 22px; height: 22px; }
.pt-nav a.activo { color: var(--azul); background: var(--azul-claro); }
@media (min-width: 900px) {
  .pt-app { padding-bottom: 30px; }
  .pt-nav { display: none; }
  .pt-tabs-escritorio { display: flex; gap: 4px; max-width: 760px; margin: 0 auto; padding: 0 16px; overflow-x: auto; }
  .pt-tabs-escritorio a { padding: 10px 12px; font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .pt-tabs-escritorio a.activo { color: var(--azul); border-bottom-color: var(--azul); }
  .pt-selector select { max-width: 320px; }
}

/* Piezas */
.pt-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.pt-et { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.pt-hola h1, .pt-titulo h1 { margin: 0; font-size: 24px; }
.pt-hola, .pt-titulo { display: grid; gap: 2px; }
.pt-progreso { grid-template-columns: auto 1fr; align-items: center; gap: 18px; }
.pt-anillo { --p: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--azul) calc(var(--p) * 1%), var(--line-2) 0); }
.pt-anillo > div { width: 86px; height: 86px; border-radius: 50%; background: var(--card); display: grid; place-content: center; text-align: center; }
.pt-anillo b { font-size: 22px; line-height: 1; }
.pt-anillo span { font-size: 11px; color: var(--muted); font-weight: 700; }
.pt-progreso-datos { display: grid; gap: 8px; min-width: 0; }
.pt-progreso-datos b { font-size: 18px; display: block; overflow-wrap: anywhere; }
b.ok, .ok { color: var(--ok); }
.pt-proxima-fila { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.pt-monto { font-size: 28px; font-weight: 800; color: var(--azul-d); line-height: 1.1; }
.pt-comp-estado { display: grid; gap: 6px; background: var(--bg); border-radius: 12px; padding: 12px; justify-items: start; }
.pt-rechazo { display: grid; gap: 8px; background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 12px; }
.pt-rechazo b { display: flex; gap: 6px; align-items: center; }
.pt-rechazo b svg { width: 16px; height: 16px; }
.pt-rechazo span { color: var(--text); font-size: 14px; }
.pt-al-dia { grid-template-columns: auto 1fr; align-items: center; background: var(--ok-bg); }
.pt-al-dia svg { width: 30px; height: 30px; color: var(--ok); }
.pt-al-dia div { display: grid; }
.pt-obra-mini { grid-template-columns: 84px 1fr auto; align-items: center; color: inherit; text-decoration: none; }
.pt-obra-mini > svg { width: 18px; color: var(--soft); }
.pt-obra-img { width: 84px; height: 84px; border-radius: 12px; background: var(--azul-claro) center / cover; }
.pt-obra-txt { display: grid; gap: 4px; min-width: 0; }
.pt-pasos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.pt-pasos i { height: 6px; border-radius: 3px; background: var(--line); }
.pt-pasos i.hecho { background: var(--azul); }
.pt-asesor-mini { grid-template-columns: auto 1fr auto; align-items: center; }
.pt-asesor-mini > div { min-width: 0; }
.pt-asesor-mini b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-foto { border-radius: 50%; object-fit: cover; flex: none; display: block; }
.pt-foto-ini { display: grid; place-items: center; background: var(--azul-claro); color: var(--azul-d); font-weight: 800; }
.pt-resumen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pt-resumen > div { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; min-width: 0; }
.pt-resumen b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.pt-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-botones .btn { justify-content: center; min-height: 44px; }
.pt-seccion { display: grid; gap: 8px; }
.pt-seccion h2 { margin: 6px 0 0; font-size: 16px; }
.pt-lista { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.pt-fila { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; color: inherit; text-decoration: none; }
.pt-fila:last-child { border-bottom: 0; }
.pt-fila-boton { cursor: pointer; }
.pt-fila-boton:hover { background: var(--bg); }
.pt-fila > svg { width: 16px; height: 16px; color: var(--soft); flex: none; }
.pt-fila-actual { background: var(--naranja-claro); }
.pt-fila-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pt-fila-txt b { overflow-wrap: anywhere; }
.pt-fila-txt span { font-size: 13px; color: var(--muted); }
.pt-fila-der { display: grid; justify-items: end; gap: 4px; flex: none; }
.pt-motivo { color: var(--bad) !important; font-weight: 600; }
.pt-doc-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--azul-claro); color: var(--azul-d); display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.pt-ico svg { width: 20px; height: 20px; }
.pt-vacio { justify-items: center; text-align: center; padding: 36px 20px; }
.pt-vacio svg { width: 36px; height: 36px; color: var(--soft); }
.pt-portada { aspect-ratio: 16 / 9; max-width: 100%; border-radius: 16px; background: var(--azul-claro) center / cover; }
.pt-linea { display: grid; }
.pt-hito { display: grid; grid-template-columns: 30px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.pt-hito::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.pt-hito:last-child::before { display: none; }
.pt-hito.hecha::before { background: var(--azul); }
.pt-hito-punto { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; z-index: 1; }
.pt-hito.hecha .pt-hito-punto { background: var(--azul); border-color: var(--azul); color: #fff; }
.pt-hito.hecha .pt-hito-punto svg { width: 16px; height: 16px; }
.pt-hito.actual .pt-hito-punto { border-color: var(--naranja); box-shadow: 0 0 0 4px var(--naranja-claro); }
.pt-hito-cuerpo { display: grid; gap: 4px; padding-top: 4px; min-width: 0; }
.pt-hito:not(.hecha):not(.actual) .pt-hito-cuerpo > b { color: var(--soft); }
.pt-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 4px; }
.pt-fotos-grande { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pt-fotos button { border: 0; padding: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; background: var(--line-2); }
.pt-fotos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-prop { padding: 0; overflow: hidden; gap: 0; }
.pt-prop .pt-portada { border-radius: 0; }
.pt-prop-cuerpo { padding: 16px; display: grid; gap: 6px; }
.pt-prop-cuerpo h2 { margin: 0; font-size: 20px; }
.pt-datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 16px; margin: 10px 0 0; }
.pt-datos dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.pt-datos dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.pt-datos-centro { text-align: center; grid-template-columns: 1fr; }
.pt-asesor { justify-items: center; text-align: center; padding: 26px 18px; }
.pt-asesor h2 { margin: 6px 0 0; font-size: 22px; }
.pt-asesor-botones { display: grid; gap: 8px; width: 100%; max-width: 340px; margin-top: 8px; }
.pt-asesor-botones .btn { justify-content: center; }
.pt-aviso { display: flex; gap: 10px; background: var(--info-bg); color: var(--info); border-radius: 12px; padding: 12px; }
.pt-aviso svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.pt-aviso div { display: grid; gap: 2px; }
.pt-aviso span { color: var(--text); font-size: 14px; }
.pt-aviso-mal { background: var(--bad-bg); color: var(--bad); }
.pt-interruptor { grid-template-columns: 1fr auto; align-items: center; }
.pt-interruptor > div { display: grid; gap: 2px; }
.pt-salir { color: var(--bad); justify-content: center; min-height: 46px; }
.pt-cuota-caja { display: grid; gap: 2px; background: var(--naranja-claro); border-radius: 12px; padding: 12px; }
.pt-nota { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px; font-size: 13px; }
.pt-nota svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
@media (max-width: 380px) {
  .pt-progreso { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .pt-resumen { grid-template-columns: 1fr; }
}
/* En celular, los formularios del modal ocupan toda la pantalla */
@media (max-width: 600px) {
  body.modo-portal .modal-fondo { align-items: flex-end; padding: 0; }
  body.modo-portal .modal { width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
}
.comp-archivo { background: var(--bg); border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 200px; }
.comp-archivo img { width: 100%; max-height: 60vh; object-fit: contain; display: block; }
.badge-portal { background: var(--azul-claro); color: var(--azul-d); }
.btn-mini[data-visible] { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--gray-bg); color: var(--muted); white-space: nowrap; }
.btn-mini[data-visible].activo { background: var(--azul-claro); color: var(--azul-d); }
.btn-mini[data-visible]:hover { background: var(--azul-claro); color: var(--azul-d); }
.pt-logo-icono { display: none; height: 36px; width: 36px; object-fit: contain; flex: none; }
@media (max-width: 600px) {
  .pt-logo { display: none; }
  .pt-logo-icono { display: block; }
  .pt-selector select { max-width: 62vw; }
}
body.modo-portal #toasts { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { body.modo-portal #toasts { bottom: 20px; } }
.pt-resumen b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 480px) { .pt-resumen b { font-size: 16px; } }

/* Cambios de datos pedidos desde el portal */
.solicitudes { display: grid; }
.solicitud { padding: 16px 18px; border-bottom: 1px solid var(--line-2); display: grid; gap: 12px; }
.solicitud:last-child { border-bottom: 0; }
.sol-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sol-cab .principal { font-size: 15px; color: var(--text); text-decoration: none; }
.sol-cab .principal:hover { color: var(--azul); }
.sol-cambios { display: grid; grid-template-columns: 110px minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; gap: 0; background: var(--bg); border-radius: 10px; padding: 4px 14px; max-width: 760px; }
.sol-cambios > span { padding: 8px 0; border-bottom: 1px solid var(--line-2); overflow-wrap: anywhere; }
.sol-cambios > span:nth-last-child(-n+4) { border-bottom: 0; }
.sol-th { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
.sol-campo { font-weight: 700; font-size: 13px; color: var(--muted); }
.sol-antes { color: var(--soft); text-decoration: line-through; }
.sol-flecha { color: var(--soft); text-align: center; }
.sol-nuevo { font-weight: 800; color: var(--azul-d); }
@media (max-width: 600px) {
  .sol-cambios { grid-template-columns: 80px minmax(0, 1fr) 18px minmax(0, 1fr); padding: 4px 10px; }
}
.sol-cab .principal { font-weight: 800; }
.sol-cab .sec { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sol-antes.vacio-dato { text-decoration: none; font-style: italic; }

/* Aviso destacado arriba de una lista */
.aviso-barra { display: flex; align-items: center; gap: 12px; background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; text-decoration: none; }
.aviso-barra svg { width: 18px; height: 18px; flex: none; }
.aviso-barra span { color: var(--text); flex: 1; min-width: 0; }
.aviso-barra .aviso-ir { flex: none; color: var(--warn); font-weight: 800; }
.aviso-barra.mal { background: var(--bad-bg); color: var(--bad); }
.aviso-barra.mal .aviso-ir { color: var(--bad); }
.aviso-venta { display: grid; gap: 10px; border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.aviso-venta.pendiente { background: var(--warn-bg); border: 1px solid #f1d7a6; }
.aviso-venta.rechazada { background: var(--bad-bg); border: 1px solid #f0c3bf; }
.aviso-venta .fila-aviso { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.aviso-venta .fila-aviso > div:first-child { display: grid; gap: 3px; min-width: 0; flex: 1; }
.aviso-venta .fila-aviso > .acciones { flex: none; align-self: center; }
.aviso-venta b.titulo { font-size: 15px; }

/* Co-comprador en el formulario del cliente */
.co-comprador summary { cursor: pointer; font-weight: 700; font-size: 13px; padding: 4px 0; }
.co-comprador[open] { background: var(--bg); border-radius: 10px; padding: 8px 12px 4px; }

/* Captación vendida o en trámite (enlace a la venta) */
.capt-venta { display: grid; gap: 2px; background: var(--ok-bg); border-color: #bfe3cf; color: var(--text); text-decoration: none; }
.capt-venta b { color: var(--ok); }
/* Propiedad de reventa dentro del formulario de venta */
.capt-resumen { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.capt-resumen .ico-capt { width: 38px; height: 38px; border-radius: 10px; background: var(--azul); color: #fff; display: grid; place-items: center; flex: none; }
.capt-resumen .ico-capt svg { width: 20px; height: 20px; }
.badge-reventa { background: #eef4fb; color: var(--azul); }

/* Créditos: derechos de Viviendas RD y firma de Althea Studio */
.creditos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.4; }
.creditos-firma { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.creditos-firma img { width: 14px; height: 14px; object-fit: contain; opacity: .75; }
.creditos-firma b { letter-spacing: .12em; font-weight: 800; color: var(--text); font-size: 10.5px; }
.creditos.oscuro { justify-content: flex-start; color: #bfe2f5; text-align: left; }
.creditos.oscuro .creditos-firma b { color: #fff; }
.creditos.oscuro .creditos-firma img { filter: brightness(0) invert(1); opacity: .9; }
.creditos.compacto { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 12px 4px 2px; margin-top: 10px; border-top: 1px solid var(--line-2); }
.creditos.compacto .creditos-firma b { font-size: 10px; }
.login-creditos { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
@media (min-width: 861px) { .login-creditos { display: none; } }
.pt-creditos { max-width: 760px; margin: 0 auto; padding: 4px 16px 18px; }
.pt-acceso .creditos, .pt-acceso-pie + .creditos { margin-top: 8px; }
