/* Panel de prospección de Farol. Decisión de diseño: vault/01_PROJECTS/prospeccion/2026-10-10-plan-sistema-completo.md */
:root {
  --fondo: #eef1f4;
  --superficie: #fbfcfd;
  --texto: #1b2330;
  --apagado: #4a5566;
  --acento: #0b6e5b;
  --acento-claro: #bfe8dc;
  --barra: #0f8a6c; /* marca de datos: pasa el piso de croma y 3:1 contra la superficie */
  --peligro: #b42318;
  --aviso: #8a5a00;
  --linea: #d5dbe2;
  --radio: 14px;
  --titulo: "Archivo", system-ui, sans-serif;
  --cuerpo: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 16px/1.45 var(--cuerpo); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--titulo); font-stretch: 85%; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 1.05rem; margin: 18px 4px 8px; display: flex; align-items: center; gap: 8px; }
.acento { color: var(--acento); }
.apagado { color: var(--apagado); }
.chica { font-size: 0.82rem; }
.error { color: var(--peligro); min-height: 1.2em; }
[hidden] { display: none !important; }

.entrar { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.entrar form { width: min(360px, 100%); display: grid; gap: 14px; }
.entrar h1 { font-size: 2rem; }
label { display: grid; gap: 6px; font-weight: 500; font-size: 0.92rem; }
input, select, textarea { font: inherit; color: var(--texto); background: var(--superficie); border: 1px solid var(--linea); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

.tarjeta { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; }

.cabecera { position: sticky; top: 0; z-index: 5; background: var(--fondo); padding: max(10px, env(safe-area-inset-top)) 16px 8px; border-bottom: 1px solid var(--linea); }
.meta-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.meta-fila strong { font-family: var(--titulo); font-size: 1.5rem; }
.barra { height: 10px; background: #dfe5ea; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.barra-luz { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--acento), #e0a526); box-shadow: 0 0 12px #e0a52699; transition: width 1.6s cubic-bezier(.2,.8,.2,1); }

main { padding: 8px 16px 96px; max-width: 720px; margin: 0 auto; }
.filtros { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.filtros select { min-height: 40px; padding: 6px 8px; font-size: 0.9rem; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: 20px; min-height: 20px; }

.lista { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.p { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px 14px; display: grid; gap: 8px; }
.p.urgente { border-left: 4px solid var(--aviso); }
.p-cabeza { display: flex; justify-content: space-between; gap: 8px; align-items: start; cursor: pointer; }
.p-nombre { font-family: var(--titulo); font-weight: 700; font-size: 1.08rem; line-height: 1.2; }
.p-sub { color: var(--apagado); font-size: 0.86rem; }
.p-gancho { font-size: 0.9rem; background: #f2f6f4; border-radius: 10px; padding: 8px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #e4e9ee; color: var(--texto); white-space: nowrap; }
.chip.hot { background: #fde2dc; color: #8f1d12; }
.chip.warm { background: #fbecc8; color: #6e4800; }
.chip.ok { background: var(--acento-claro); color: #074536; }
.acciones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.acciones .boton { padding: 8px 4px; font-size: 0.85rem; min-width: 0; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--linea); background: var(--superficie); color: var(--texto); font: 600 0.9rem var(--cuerpo); text-decoration: none; cursor: pointer; }
.boton.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.boton.peligro { color: var(--peligro); }
.boton:active { transform: scale(0.98); }
#mas { width: 100%; margin-top: 12px; }

.pestanas { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--superficie); border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
.pestanas button { min-height: 56px; border: 0; background: none; font: 600 0.95rem var(--cuerpo); color: var(--apagado); }
.pestanas button.activa { color: var(--acento); box-shadow: inset 0 3px 0 var(--acento); }

dialog.hoja { width: 100%; max-width: 720px; max-height: 92dvh; margin: auto auto 0; border: 0; border-radius: 18px 18px 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); background: var(--superficie); color: var(--texto); overflow: auto; }
dialog.hoja::backdrop { background: #1b233066; }
dialog.chica { max-height: 80dvh; }
.hoja h3 { font-size: 1.25rem; margin-bottom: 4px; }
.hoja .cerrar { float: right; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.dato { font-size: 0.88rem; }
.dato b { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--apagado); font-weight: 600; }
.msj { border: 1px solid var(--linea); border-radius: 10px; padding: 10px; display: grid; gap: 8px; font-size: 0.9rem; }
.historial { font-size: 0.85rem; color: var(--apagado); padding-left: 18px; }
.resultados { display: grid; gap: 8px; }
.seccion { margin-top: 14px; display: grid; gap: 8px; }

.aviso { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%) translateY(20px); background: var(--texto); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 20; font-size: 0.9rem; max-width: calc(100% - 32px); }
.aviso.ver { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Números */
.kpis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.kpi { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px; }
.kpi b { display: block; font-family: var(--titulo); font-size: 1.6rem; line-height: 1.1; }
.kpi span { color: var(--apagado); font-size: 0.82rem; }
.barras { display: grid; gap: 6px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px; }
.fila-barra { display: grid; grid-template-columns: 92px 1fr 64px; align-items: center; gap: 8px; font-size: 0.82rem; }
.fila-barra .riel { height: 12px; background: #e4e9ee; border-radius: 4px; position: relative; }
.fila-barra .riel i { position: absolute; inset: 0 auto 0 0; background: var(--barra); border-radius: 0 4px 4px 0; }
.fila-barra .valor { text-align: right; font-variant-numeric: tabular-nums; }
.nota-tabla { font-size: 0.78rem; color: var(--apagado); }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; background: var(--superficie); border-radius: var(--radio); overflow: hidden; }
th, td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--linea); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }

@media (prefers-reduced-motion: reduce) { .barra-luz, .aviso { transition: none; } }
