/* Prospección · Estudio LB-IA — mismo sistema visual que estudiolbia.com
   (crema, azul tinta, salvia y naranja; Sora + Inter), en versión herramienta. */

@font-face { font-family: "Sora"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("/assets/sora-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/assets/inter-latin.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --cream: #FBF6EC;
  --cream-2: #F3EADA;
  --paper: #FFFDF8;
  --ink: #0F2B40;
  --ink-2: #1F3A52;
  --ink-deep: #0A1E2E;
  --muted: #5A6A77;
  --orange: #E8963F;
  --amber: #C9853F;
  --sage: #7F998C;
  --line: rgba(15, 43, 64, .12);
  --brand-grad: linear-gradient(115deg, #1F3A52 0%, #5E8079 42%, #D9A560 72%, #E8963F 100%);
  --warm-grad: linear-gradient(120deg, #E8963F, #C9853F 55%, #9AA27F);
  --ok: #2E7D5B;
  --bad: #B04A33;

  --f-display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --radius: 22px;
  --radius-sm: 14px;
  --wrap: 1180px;
  --pad: clamp(16px, 4vw, 40px);
  --shadow: 0 1px 2px rgba(15,43,64,.04), 0 12px 32px -12px rgba(15,43,64,.18);
  --shadow-lg: 0 2px 4px rgba(15,43,64,.05), 0 30px 60px -20px rgba(15,43,64,.28);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 16px/1.55 var(--f-body);
  background: radial-gradient(1100px 520px at 85% -10%, #FFF3DE, transparent 60%), var(--cream);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.1; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--orange); color: var(--paper); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
em { font-style: normal; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.muted { color: var(--muted); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 11.5px/1 var(--f-display); letter-spacing: .26em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--orange); border-radius: 2px; }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px; background: var(--bg); color: var(--fg);
  font: 600 15px/1 var(--f-display); white-space: nowrap;
  transition: transform .4s var(--ease-out), box-shadow .3s, background-position .8s var(--ease-out), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn .arrow { transition: transform .4s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--brand { background: linear-gradient(115deg, var(--ink-2), #3F6570 45%, var(--orange)); background-size: 200% 100%; box-shadow: 0 10px 30px -12px rgba(232,150,63,.6); }
.btn--brand:hover { background-position: 100% 0; }
.btn--ink:hover { box-shadow: 0 10px 28px -10px rgba(15,43,64,.6); }
.btn--ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--soft { --bg: rgba(232,150,63,.14); --fg: #8A4F15; }
.btn--soft:hover { --bg: var(--orange); --fg: var(--paper); }
.btn--sm { padding: 10px 16px; font-size: 13.5px; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- Cabecera ---------- */
.top { position: sticky; top: 0; z-index: 50; padding: 12px 0; background: rgba(251,246,236,.8); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(1px)) { .top { backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); } }
.top__inner { display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; margin-right: auto; }
.brand img { width: 34px; height: auto; }
.brand__text { font: 800 19px/1 var(--f-display); letter-spacing: .01em; display: flex; flex-direction: column; }
.brand__text small { font-size: 9px; font-weight: 700; letter-spacing: .4em; margin-bottom: 4px; color: var(--ink-2); }
.top__actions { display: flex; gap: 8px; }

/* ---------- Búsqueda ---------- */
.intro { padding: clamp(28px, 5vw, 56px) 0 22px; display: grid; gap: 14px; }
.intro h1 { font-size: clamp(28px, 4.2vw, 48px); font-weight: 700; letter-spacing: -.03em; max-width: 22ch; }

.search { display: grid; grid-template-columns: 1.3fr 1fr 130px auto; gap: 14px; align-items: end; padding: clamp(18px, 2.4vw, 26px); }
.search__note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font: 600 12.5px/1 var(--f-display); letter-spacing: .03em; color: var(--ink-2); }
.field input, .field select, .field textarea, .toolbar input, .toolbar select {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--paper);
  font-size: 16px; transition: border-color .25s, box-shadow .25s; resize: vertical; min-width: 0;
}
select { appearance: none; padding-right: 38px !important; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='m1 1.5 5 5 5-5' stroke='%230F2B40' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(232,150,63,.15); }
.search .btn { height: 50px; }

/* ---------- Búsquedas en curso ---------- */
.runs { margin-top: 28px; }
.runs__head h2, .leads__head h2 { font-size: 22px; }
.runs__list { display: grid; gap: 10px; margin-top: 14px; }
.run { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 14px 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.run__title { font: 600 15px/1.3 var(--f-display); }
.run__title button { text-align: left; }
.run__title button:hover { color: var(--amber); }
.run__msg { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run__bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--cream-2); overflow: hidden; }
.run__bar span { display: block; height: 100%; width: var(--p, 0%); background: var(--warm-grad); border-radius: inherit; transition: width .6s var(--ease-out); }
.run__side { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font: 600 12px/1 var(--f-display); background: rgba(15,43,64,.07); color: var(--ink-2); white-space: nowrap; }
.pill--live { background: rgba(232,150,63,.16); color: #8A4F15; }
.pill--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); animation: pulse 1.6s infinite; }
.pill--ok { background: rgba(46,125,91,.12); color: var(--ok); }
.pill--bad { background: rgba(176,74,51,.12); color: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.link-btn { font: 600 13px/1 var(--f-display); color: var(--bad); padding: 6px 4px; }

/* ---------- Lista de negocios ---------- */
.leads { margin: 40px 0 80px; }
.leads__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.leads__head .muted { font-size: 14px; margin-top: 4px; }
.statuses { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,253,248,.7); border: 1px solid var(--line); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.statuses button { padding: 9px 14px; border-radius: 999px; font: 500 13.5px/1 var(--f-display); color: var(--ink-2); white-space: nowrap; transition: background .3s var(--ease-out), color .3s; }
.statuses button:hover { background: rgba(15,43,64,.06); }
.statuses button.is-active { background: var(--ink); color: var(--paper); }
.statuses b { font-weight: 600; opacity: .6; margin-left: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.toolbar input { flex: 1 1 240px; }
.toolbar select { flex: 0 1 auto; width: auto; }
.toolbar input, .toolbar select { padding: 11px 13px; font-size: 14.5px; border-radius: 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--cream-2); font: 500 13.5px/1 var(--f-display); }
.filter-chip button { width: 24px; height: 24px; border-radius: 50%; background: var(--paper); font-size: 12px; }

.list { display: grid; gap: 8px; }
.lead {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line);
  cursor: pointer; transition: box-shadow .35s var(--ease-out), transform .35s var(--ease-out), border-color .3s;
}
.lead.is-new { animation: in .5s var(--ease-out) both; }
.lead:hover { box-shadow: var(--shadow); border-color: rgba(232,150,63,.35); transform: translateY(-1px); }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.lead__main { min-width: 0; display: grid; gap: 6px; }
.lead__name { font: 600 16.5px/1.25 var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead__meta { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead__side { display: grid; justify-items: end; gap: 8px; }
.stars { font: 600 13.5px/1 var(--f-display); white-space: nowrap; }
.stars small { color: var(--muted); font-weight: 500; }

.score { --c: var(--muted); position: relative; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), rgba(15,43,64,.08) 0); }
.score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper); }
.score span { position: relative; font: 700 16px/1 var(--f-display); }
.score--high { --c: var(--orange); }
.score--mid { --c: var(--sage); }
.score--low { --c: rgba(15,43,64,.3); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font: 500 12px/1 var(--f-body); background: rgba(15,43,64,.06); color: var(--ink-2); }
.chip--on { background: rgba(127,153,140,.18); color: #2F5446; }
.chip--warn { background: rgba(232,150,63,.16); color: #8A4F15; }
.chip--off { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: rgba(15,43,64,.4); text-decoration: line-through; }

.empty { padding: 48px 24px; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius); display: grid; gap: 6px; }

/* ---------- Ficha (panel lateral / hoja en móvil) ---------- */
.sheet {
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(560px, 100%); padding: 0; border: 0;
  background: var(--paper); color: var(--ink); box-shadow: -30px 0 80px -20px rgba(10,30,46,.35); overflow-y: auto;
}
.sheet[open] { animation: slideIn .45s var(--ease-out); }
.sheet::backdrop { background: rgba(10,30,46,.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet__inner { padding: 22px clamp(18px, 4vw, 30px) 40px; display: grid; gap: 22px; }
.sheet__head { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; }
.sheet__head .score { width: 64px; height: 64px; }
.sheet__head h2 { font-size: clamp(20px, 3vw, 25px); }
.sheet__head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.close { width: 40px; height: 40px; border-radius: 50%; background: var(--cream); font-size: 15px; transition: transform .4s var(--ease-out); flex: none; }
.close:hover { transform: rotate(90deg); }
.block { display: grid; gap: 10px; }
.block h3 { font: 600 12px/1 var(--f-display); letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }

.facts { display: grid; gap: 2px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.fact { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 14px; background: var(--cream); font-size: 14.5px; }
.fact dt { font: 600 12.5px/1.3 var(--f-display); color: var(--muted); }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.fact dd a { text-decoration: underline; text-decoration-color: rgba(232,150,63,.6); text-underline-offset: 3px; }
.fact dd .none { color: rgba(15,43,64,.35); }
.fact small { display: block; color: var(--muted); font-size: 12px; }
.copy { font: 600 12px/1 var(--f-display); padding: 7px 10px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.copy:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.reasons { display: grid; gap: 6px; }
.reasons li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 12px; border-radius: 10px; background: var(--cream); }
.reasons b { font: 700 13px/1.4 var(--f-display); color: var(--ok); white-space: nowrap; }
.reasons b.neg { color: var(--bad); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 9px 14px; border-radius: 999px; font: 500 13.5px/1 var(--f-display); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .25s, color .25s, box-shadow .25s; }
.seg button:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.seg button.is-active { background: var(--ink); color: var(--paper); box-shadow: none; }

.composer { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--cream-2); }
.composer textarea { width: 100%; min-height: 190px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); font-size: 15px; line-height: 1.55; resize: vertical; }
.composer textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(232,150,63,.15); }
.composer__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.composer__hint { font-size: 12.5px; color: var(--muted); }
.notes { width: 100%; min-height: 80px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); font-size: 15px; resize: vertical; }
.notes:focus { outline: none; border-color: var(--orange); }

/* ---------- Ajustes ---------- */
.modal { width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; border-radius: 26px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); overflow-y: auto; }
.modal[open] { animation: pop .45s var(--ease-out); }
.modal::backdrop { background: rgba(10,30,46,.45); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: clamp(22px, 4vw, 34px); }
.modal__body h2 { font-size: 26px; }
.modal__body .close { position: absolute; top: 16px; right: 16px; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.modal__actions .btn { white-space: normal; text-align: center; }
.ai-state { font-size: 13.5px; padding: 10px 14px; border-radius: 12px; background: var(--cream); }

/* Catálogo de productos (Ajustes) */
.products { min-width: 0; display: grid; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.products h3 { font-size: 19px; }
.products .muted { font-size: 13.5px; }
.products__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.prod { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px; border-radius: 16px; background: var(--cream); border: 1px solid var(--line); }
.prod__row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }
.prod input, .prod select, .prod textarea { width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); font-size: 14.5px; resize: vertical; }
.prod input:focus, .prod select:focus, .prod textarea:focus { outline: none; border-color: var(--orange); }
.prod__tools { display: flex; justify-content: flex-end; gap: 14px; }
.prod__tools button { font: 600 12.5px/1 var(--f-display); color: var(--muted); padding: 4px 2px; }
.prod__tools button:hover { color: var(--ink); }
.prod__tools [data-del]:hover { color: var(--bad); }
@media (max-width: 640px) { .prod__row { grid-template-columns: minmax(0, 1fr); } .prod input, .prod select, .prod textarea { font-size: 16px; } }

/* Producto al redactar */
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.offer select { width: 100%; padding: 11px 38px 11px 13px; border-radius: 12px; border: 1.5px solid var(--line); font-size: 15px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.offer__price { font-size: 12.5px; color: var(--muted); grid-column: 1 / -1; }
.chip--product { background: rgba(31,58,82,.08); color: var(--ink); }
@media (max-width: 640px) { .offer { grid-template-columns: 1fr; } .offer select { font-size: 16px; } }

/* ---------- Aviso ---------- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 13px 20px; border-radius: 999px; background: var(--ink-deep); color: var(--cream); font: 500 14px/1.3 var(--f-display); box-shadow: var(--shadow-lg);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); max-width: calc(100% - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .search { grid-template-columns: 1fr 1fr; }
  .search .btn { grid-column: 1 / -1; }
  .field--small { grid-column: auto; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .top__actions .btn--ghost { padding: 10px 12px; }
  .search { grid-template-columns: 1fr; }
  .toolbar input { flex-basis: 100%; }
  .toolbar input, .toolbar select { font-size: 16px; }
  .toolbar select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .lead { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 13px 14px; }
  .lead .score { width: 46px; height: 46px; }
  .lead .score span { font-size: 14px; }
  .lead__side { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; }
  .sheet { width: 100%; }
  .sheet[open] { animation-name: sheetUp; }
  @keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
  .sheet__head { grid-template-columns: 52px 1fr auto; }
  .sheet__head .score { width: 52px; height: 52px; }
  .fact { grid-template-columns: 1fr auto; }
  .fact dt { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
