/* =========================================================
   Lavin · CRM con IA (tablero tipo Kommo / Trello)
   ========================================================= */

:root {
  --navy: #0a3478;
  --ink: #16202e;
  --ink-soft: #4a5568;
  --ivory: #faf8f4;
  --sand: #f1ece4;
  --mist: #e8eef2;
  --champagne: #b5966a;
  --line: rgba(22, 32, 46, .12);
  --white: #fff;
  --board: #eef2f6;
  --ok: #1f9d55;
  --warn: #d97706;
  --hot: #e0533d;

  --serif: "Marcellus", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.7; color: var(--ink-soft); background: var(--ivory); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 4.2vw, 3.5rem); max-width: 16em; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
h3 { font-size: 1.2rem; }
h1 em, h2 em { font-style: normal; color: var(--champagne); }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.wrap { width: min(1140px, 100% - 48px); margin-inline: auto; }
.wrap--wide { width: min(1400px, 100% - 48px); }
.eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 1.1em; font-size: .72rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--champagne); }
.eyebrow::before { content: ""; width: 32px; height: 1px; background: currentColor; }
section { padding: 100px 0; }
.head { max-width: 660px; margin-bottom: 50px; }
.head--center { margin-inline: auto; text-align: center; }
.head--center .eyebrow { justify-content: center; }
.icon { width: 40px; height: 40px; fill: none; stroke: var(--champagne); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 22px; }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 40px; }
.lead { font-size: 1.12rem; max-width: 42em; }

/* ---------- App del CRM ---------- */
.crm-wrap { padding: 10px 0 100px; }
.app {
  border-radius: 18px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 50px 100px -50px rgba(22, 32, 46, .45);
  font-weight: 400;
}
.app__bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; background: var(--ink); color: var(--white); }
.app__brand { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.app__brand strong { font-weight: 500; }
.tabs { display: inline-flex; padding: 4px; border-radius: 30px; background: rgba(255, 255, 255, .08); }
.tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 30px; font-size: .8rem; color: rgba(255, 255, 255, .7); transition: .3s var(--ease); }
.tabs button.is-active { background: var(--white); color: var(--ink); }
.app__actions { display: flex; gap: 8px; margin-left: auto; }
.btn-ai {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border: 0; border-radius: 30px;
  background: linear-gradient(120deg, var(--champagne), #d4b98d);
  color: var(--ink); font-size: .8rem; font-weight: 500;
  transition: transform .2s, box-shadow .3s;
}
.btn-ai:hover { box-shadow: 0 8px 20px -8px rgba(181, 150, 106, .8); }
.btn-ai:active { transform: scale(.97); }
.btn-ai svg { width: 15px; height: 15px; fill: currentColor; }
.btn-ai--full { width: 100%; padding: 11px; }
.btn-ghost { padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 30px; background: none; color: rgba(255, 255, 255, .8); font-size: .8rem; }
.btn-ghost:hover { border-color: var(--white); color: var(--white); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stat { padding: 14px 18px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat span { display: block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.stat strong { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; color: var(--ink); }

/* Tablero */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--board);
  overflow-x: auto;
  min-height: 560px;
  scrollbar-width: thin;
}
.col { display: flex; flex-direction: column; min-width: 0; padding: 0; border-radius: 12px; background: rgba(255, 255, 255, .55); }
.col__head { padding: 12px 12px 10px; border-top: 3px solid var(--c, var(--navy)); border-radius: 12px 12px 0 0; }
.col__title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.col__count { min-width: 22px; padding: 0 7px; border-radius: 12px; background: var(--white); font-size: .72rem; text-align: center; color: var(--ink-soft); }
.col__sum { font-size: .78rem; color: var(--ink-soft); }
.col__list { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 12px; min-height: 80px; border-radius: 0 0 12px 12px; transition: background .2s; }
.col__list.is-over { background: rgba(10, 52, 120, .06); }
.col__empty { margin: 8px 4px; padding: 18px 10px; border: 1.5px dashed var(--line); border-radius: 10px; font-size: .78rem; text-align: center; color: var(--ink-soft); }

.card {
  position: relative;
  padding: 12px 12px 10px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid rgba(22, 32, 46, .07);
  box-shadow: 0 1px 2px rgba(22, 32, 46, .06);
  cursor: grab;
  user-select: none;
  transition: box-shadow .2s, transform .2s, opacity .2s;
}
.card:hover { box-shadow: 0 8px 20px -10px rgba(22, 32, 46, .35); }
.card:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.card.is-dragging { opacity: .35; }
.card.is-new { animation: arrive 1.6s var(--ease); }
@keyframes arrive {
  0% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(181, 150, 106, .8); }
  30% { transform: scale(1.02); box-shadow: 0 0 0 6px rgba(181, 150, 106, .35); }
  100% { transform: none; box-shadow: 0 1px 2px rgba(22, 32, 46, .06); }
}
.ghost { position: fixed; z-index: 100; pointer-events: none; transform: rotate(2.5deg); box-shadow: 0 24px 40px -16px rgba(22, 32, 46, .5); cursor: grabbing; }
.placeholder { border: 2px dashed rgba(10, 52, 120, .3); border-radius: 10px; background: rgba(10, 52, 120, .04); }

.card__top { display: flex; align-items: center; gap: 9px; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 600; color: var(--white); background: var(--a, var(--navy)); }
.avatar--lg { width: 48px; height: 48px; font-size: 1rem; }
.card__who { min-width: 0; flex: 1; }
.card__name { font-size: .88rem; font-weight: 500; color: var(--ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__company { font-size: .74rem; color: var(--ink-soft); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.channel svg { width: 13px; height: 13px; fill: var(--white); }
.channel--whatsapp { background: #25d366; }
.channel--instagram { background: linear-gradient(45deg, #f9a43a, #e1306c 55%, #833ab4); }
.channel--email { background: #5b6b80; }
.channel--web { background: var(--navy); }
.channel--tel { background: #0ea5a4; }

.card__msg { margin: 8px 0 0; font-size: .78rem; line-height: 1.4; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag { padding: 2px 8px; border-radius: 10px; font-size: .66rem; font-weight: 500; background: var(--mist); color: var(--navy); }
.tag--ai { background: #fbf3e4; color: #8a6a37; }
.tag--hot { background: #fdecea; color: var(--hot); }
.tag--warn { background: #fff4e0; color: var(--warn); }
.card__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(22, 32, 46, .06); font-size: .74rem; }
.card__value { font-weight: 600; color: var(--ink); }
.card__ago { color: var(--ink-soft); }

.hint { margin: 16px 0 0; text-align: center; font-size: .82rem; }

/* ---------- Features ---------- */
.features { background: var(--white); }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feat { padding: 34px 26px; border: 1px solid var(--line); background: var(--ivory); transition: transform .5s var(--ease), border-color .5s var(--ease); }
.feat:hover { transform: translateY(-5px); border-color: var(--champagne); }
.feat p { margin: 0; font-size: .92rem; }

/* ---------- Integraciones ---------- */
.integrations { background: var(--mist); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 64px; }
.chips span { padding: 10px 20px; border-radius: 40px; background: var(--white); border: 1px solid var(--line); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; }
.flow::before { content: ""; position: absolute; top: 21px; left: 0; right: 0; height: 1px; background: var(--line); }
.flow span { position: relative; display: grid; place-content: center; width: 42px; height: 42px; margin-bottom: 20px; border-radius: 50%; border: 1px solid var(--champagne); background: var(--mist); color: var(--champagne); font-size: .76rem; }
.flow h3 { font-size: 1.12rem; }
.flow p { margin: 0; font-size: .9rem; }

/* ---------- Drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(22, 32, 46, .4); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: var(--white);
  font-weight: 400;
  transform: translateX(100%);
  transition: transform .4s var(--ease);
}
.drawer.is-open { transform: none; box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .3); }
.drawer__head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 22px; border-bottom: 1px solid var(--line); }
.drawer__head h3 { margin: 0; font-size: 1.3rem; }
.drawer__head p { margin: 0; font-size: .85rem; }
.x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--mist); font-size: 1.4rem; line-height: 1; }
.drawer__body { padding: 20px 22px 28px; overflow-y: auto; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 20px; font-size: .86rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; }

.ai-box { padding: 18px; border-radius: 14px; background: linear-gradient(160deg, #fbf6ec, var(--ivory)); border: 1px solid rgba(181, 150, 106, .35); font-size: .88rem; }
.ai-box__label { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8a6a37; }
.ai-box__label svg { width: 14px; height: 14px; fill: var(--champagne); }
.ai-box__label--sm { margin-top: 14px; }
.ai-box p { color: var(--ink); }
.ai-box blockquote { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px 12px 12px 2px; background: var(--white); border: 1px solid var(--line); color: var(--ink); line-height: 1.5; }
.move-label { margin: 22px 0 8px; font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.move { display: flex; flex-wrap: wrap; gap: 6px; }
.move button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); font-size: .78rem; transition: .2s; }
.move button:hover { border-color: var(--navy); }
.move button.is-current { background: var(--ink); border-color: var(--ink); color: var(--white); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 20px);
  padding: 12px 20px; border-radius: 30px;
  background: var(--ink); color: var(--white);
  font-size: .85rem; font-weight: 400;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1000px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .flow::before { display: none; }
}
@media (max-width: 760px) {
  section { padding: 70px 0; }
  .wrap, .wrap--wide { width: calc(100% - 32px); }
  .hero { padding: 64px 0 24px; }
  .app__actions { margin-left: 0; width: 100%; }
  .app__actions .btn-ai { flex: 1; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; padding: 12px; min-height: 480px; }
  .col { scroll-snap-align: start; }
}
@media (max-width: 520px) {
  .feat-grid, .flow { grid-template-columns: 1fr; }
}
