/* =========================================================
   Legal Wellness — estilos compartidos (sitio + app)
   ========================================================= */

:root {
  /* Paleta de marca Legal Wellness (validada) */
  --navy: #0F2340;        /* primario · confianza */
  --emerald: #2DC89A;     /* acento · bienestar */
  --emerald-deep: #1A7A5E;/* verde profundo · texto/links sobre claro */

  --ink: #0F2340;         /* texto + superficies oscuras (navy) */
  --ink-soft: #3a4a5c;
  --muted: #5d6b7a;
  --line: #e4e7ec;
  --bg: #F5F4F0;          /* crema · fondo cálido */
  --surface: #ffffff;
  --brand: #0F2340;       /* navy · botones y estructura */
  --brand-600: #0a1830;
  --brand-100: #e3f3ec;   /* menta muy clara · fondos suaves */
  --accent: #2DC89A;      /* verde menta */
  --accent-100: #e3f3ec;
  --ok: #1A7A5E;
  --ok-bg: #e3f3ec;
  --wait: #b9821f;
  --wait-bg: #fbf0d8;
  --danger: #c0492f;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 36, 31, .06), 0 1px 3px rgba(17, 36, 31, .08);
  --shadow: 0 10px 30px -12px rgba(17, 36, 31, .25);
  --shadow-lg: 0 24px 60px -20px rgba(17, 36, 31, .35);

  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.container { width: min(1140px, 92vw); margin-inline: auto; }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-sans); font-weight: 600; font-size: .95rem;
  padding: .65rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-600); box-shadow: var(--shadow); }
.btn--accent { background: var(--emerald); color: var(--navy); box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: #25b88c; box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: #fff; border-color: var(--emerald-deep); color: var(--emerald-deep); }
.btn--block { width: 100%; }
.btn--sm { padding: .45rem .8rem; font-size: .85rem; }

/* ===== Marca ===== */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand__mark {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--emerald); color: var(--navy);
  font-family: var(--font-display); font-weight: 700;
  font-size: .82rem; letter-spacing: .01em;
}
.brand__name { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -.01em; }
.brand__name strong { color: var(--emerald-deep); font-weight: 600; }

.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .12em;
  font-size: .72rem; font-weight: 700; color: var(--emerald-deep);
  background: var(--brand-100); padding: .3rem .65rem; border-radius: 999px;
}

/* =========================================================
   SITIO WEB (landing)
   ========================================================= */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 248, 247, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.nav__links { display: flex; gap: 1.6rem; font-size: .92rem; font-weight: 500; color: var(--ink-soft); }
.nav__links a:hover { color: var(--brand); }
.nav__cta { display: flex; gap: .6rem; }
.nav-cta-btn { display: inline-flex; align-items: center; gap: .45rem; }
.nav-ico { display: block; flex-shrink: 0; }

.hero { padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); letter-spacing: -.02em; margin: 1rem 0; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 34ch; }
.hero__actions { display: flex; gap: .8rem; margin: 1.8rem 0; flex-wrap: wrap; }
.hero__trust { display: flex; gap: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.hero__trust div { display: flex; flex-direction: column; }
.hero__trust strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--brand); }
.hero__trust span { font-size: .82rem; color: var(--muted); }

.hero__art { position: relative; height: 420px; }
.card-float {
  position: absolute; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
  width: 270px;
}
.card-float p { font-size: .98rem; margin: .6rem 0 .35rem; color: var(--ink); }
.card-float small { color: var(--muted); }
.card-float--1 { top: 10px; left: 0; }
.card-float--2 { top: 150px; right: 0; }
.card-float--3 {
  bottom: 8px; left: 40px; width: auto; text-align: center;
  background: var(--brand); color: #fff; border: none;
}
.card-float--3 strong { font-family: var(--font-display); font-size: 2.2rem; display: block; }
.card-float--3 span { font-size: .85rem; opacity: .9; }

.pill {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: .25rem .6rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: .04em;
}
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--wait { background: var(--wait-bg); color: var(--wait); }

.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 2.6rem; }
.section__head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: .8rem 0 .4rem; }
.section__sub { color: var(--ink-soft); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.section--alt .step { background: var(--bg); }
.step__num {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--brand-100); color: var(--brand); font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem;
}
.step h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.step p { color: var(--ink-soft); }

.audience { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.audience__card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.audience__card--accent { background: var(--ink); color: #fff; border-color: var(--ink); }
.audience__card--accent p, .audience__card--accent li { color: #d7e3df; }
.audience__icon { font-size: 1.8rem; margin-bottom: .6rem; }
.audience__card h3 { font-size: 1.4rem; margin-bottom: .5rem; }
.audience__card p { color: var(--ink-soft); margin-bottom: 1rem; }
.audience__card ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .92rem; }
.audience__card li { margin-bottom: .35rem; }

.plans { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 1.4rem; }
.plans .plan { flex: 1 1 300px; max-width: 400px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; text-align: center; }
.plan--featured { border-color: var(--brand); box-shadow: var(--shadow); position: relative; transform: translateY(-8px); }
.plan__tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700;
  padding: .3rem .8rem; border-radius: 999px;
}
.plan h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.plan__price { font-family: var(--font-display); font-size: 2rem; color: var(--brand); margin-bottom: 1rem; }
.plan__price span { font-size: .9rem; color: var(--muted); font-family: var(--font-sans); }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.4rem; color: var(--ink-soft); font-size: .92rem; }
.plan li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.plan li:last-child { border-bottom: none; }

.cta { background: var(--brand); color: #fff; }
.cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: clamp(2.5rem,5vw,4rem) 0; flex-wrap: wrap; }
.cta__actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.cta h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); color: #fff; }
.cta p { color: #d7e9e3; margin-top: .5rem; }
.cta .btn--ghost { border-color: rgba(255,255,255,.4); color: #fff; }
.cta .btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.cta .btn--primary { background: #fff; color: var(--brand); }

.footer { background: var(--ink); color: #cdd9d5; padding: 2.2rem 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand--footer .brand__name, .brand--footer .brand__name strong { color: #fff; }
.footer__note { font-size: .85rem; color: #8aa39c; }

/* Cifras del problema */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.stat-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.6rem 1.3rem; text-align: center; }
.section--alt .stat-card { box-shadow: var(--shadow); }
.stat-num { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 600; color: var(--emerald); display: block; line-height: 1; margin-bottom: .5rem; }
.stat-card p { font-size: .88rem; color: #c4d2e2; }
.stats__src { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 1.2rem; }

/* Causa vs síntoma */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.compare__col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.compare__col--accent { background: var(--navy); color: #fff; border-color: var(--navy); }
.compare__col h3 { font-size: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.compare__col ul { list-style: none; padding: 0; margin: 0; }
.compare__col li { padding: .6rem 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.compare__col--accent li { border-color: rgba(255,255,255,.12); color: #d7e3ef; }
.compare__col li:last-child { border-bottom: none; }
.compare__tag { font-family: var(--font-sans); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .25rem .6rem; border-radius: 999px; background: var(--emerald); color: var(--navy); }
.compare__tag--muted { background: var(--line); color: var(--muted); }
.compare__note { text-align: center; max-width: 60ch; margin: 1.6rem auto 0; color: var(--muted); font-size: .92rem; }

/* Materias */
.materias { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.materia { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .7rem 1.3rem; font-weight: 600; color: var(--navy); }
.materia span { font-size: 1.3rem; }

/* Impacto (contadores + gráfico) */
.impact { background: var(--navy); }
.impact .eyebrow { background: rgba(45,200,154,.16); color: var(--emerald); }
.impact .section__head h2 { color: #fff; }
.impact .section__sub { color: #bccadb; }
.impact-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--emerald); display: block; line-height: 1; white-space: nowrap; }
.impact-pre { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--emerald); margin-bottom: .25rem; }

.impact-stats { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.impact-stats .impact-c2 { flex: 1 1 180px; max-width: 230px; }
.impact-grid2 { display: grid; grid-template-columns: .8fr 1.2fr; gap: 2rem; align-items: center; }
.impact-kpis { display: grid; gap: 1.4rem; }
.impact-c2 { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 1.5rem 1.6rem; text-align: center; }
.impact-c2 p { color: #c4d2e2; margin-top: .5rem; font-size: .95rem; }

.chart-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 1.8rem 2rem; max-width: 900px; margin-inline: auto; }
.chart-title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: #fff; margin-bottom: 1.4rem; }
.chart-row { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; justify-content: center; }
.radar { flex-shrink: 0; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; flex: 1; min-width: 300px; }
.legend li { display: grid; grid-template-columns: 13px 128px 1fr 42px; align-items: center; gap: .7rem; }
.lg-dot { width: 12px; height: 12px; border-radius: 4px; }
.lg-name { color: #cfd9e6; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-bar { height: 8px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.lg-fill { display: block; height: 100%; border-radius: 999px; transition: width .6s ease; }
.lg-pct { text-align: right; font-family: var(--font-display); color: #fff; font-weight: 600; font-size: .92rem; }

/* Extras de planes/modelos */
.plan__icon { font-size: 2rem; margin-bottom: .4rem; }
.plan__msg { font-family: var(--font-display); font-size: 1.02rem; color: var(--emerald-deep); margin-bottom: 1rem; min-height: 2.6em; }
.plan--featured .plan__msg { color: var(--emerald-deep); }
.plans--single { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; }

/* Banda para personas (usuarios que ya tienen el beneficio) */
.persona-band { display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; flex-wrap: wrap; background: var(--brand-100); border: 1px solid #cdeede; border-radius: var(--radius); padding: 2rem clamp(1.4rem, 4vw, 2.4rem); }
.persona-band__text { max-width: 62ch; }
.persona-band__text h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: .4rem 0 .5rem; }
.persona-band__text p { color: var(--ink-soft); }
.persona-band__actions { display: flex; gap: .8rem; flex-wrap: wrap; }

/* Preguntas frecuentes */
.faq { max-width: 760px; margin-inline: auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease; }
.faq details:hover { box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 1.2rem 1.4rem; font-weight: 600; font-size: 1.02rem; color: var(--navy); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--emerald-deep); font-size: 1.3rem; font-weight: 400; line-height: 1; flex-shrink: 0; transition: background .15s ease, color .15s ease; }
.faq summary:hover { color: var(--emerald-deep); }
.faq summary:hover::after { background: var(--emerald); color: #fff; }
.faq details[open] summary { color: var(--emerald-deep); }
.faq details[open] summary::after { content: "\2212"; background: var(--emerald); color: #fff; }
.faq__a { padding: 0 1.4rem 1.4rem; color: var(--ink-soft); font-size: .96rem; line-height: 1.6; }
.faq__a a { color: var(--emerald-deep); }

/* Blog / Perspectivas */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .25s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: linear-gradient(135deg, #1c3556, var(--navy)); }
.article__hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin: 0 0 1.6rem; display: block; }
.post-card__body { padding: 1.3rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.post-card__meta { font-size: .76rem; color: var(--emerald-deep); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .5rem; }
.post-card h3 { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.25; color: var(--navy); margin-bottom: .5rem; }
.post-card p { color: var(--ink-soft); font-size: .9rem; flex: 1; }
.post-card__more { color: var(--navy); font-weight: 600; font-size: .9rem; margin-top: .9rem; }
.post-card:hover .post-card__more { color: var(--emerald-deep); }

/* Artículo */
.article { width: min(760px, 92vw); margin: 2.4rem auto 1rem; }
.breadcrumb { font-size: .85rem; margin-bottom: 1rem; color: var(--muted); }
.breadcrumb a { color: var(--emerald-deep); text-decoration: none; }
.article__meta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.article h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem); color: var(--navy); line-height: 1.15; margin-bottom: 1.2rem; }
.article__lead { font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.article h2 { font-family: var(--font-display); font-size: 1.35rem; color: var(--navy); margin: 1.9rem 0 .6rem; }
.article p { margin-bottom: 1rem; color: var(--ink); }
.article ul { margin: 0 0 1rem 1.2rem; color: var(--ink); }
.article li { margin-bottom: .4rem; }
.article__cta { background: var(--brand-100); border: 1px solid #cdeede; border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 2rem 0 1.4rem; }
.article__cta p { margin-bottom: 1rem; color: var(--ink); }
.article__back { display: inline-block; color: var(--emerald-deep); font-weight: 600; text-decoration: none; margin: 1rem 0 2rem; }

/* Equipo / quiénes somos */
.team { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.team__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow-sm); }
.team__avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--navy); color: var(--emerald); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; margin-bottom: 1rem; }
.team__photo { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; margin-bottom: 1rem; border: 3px solid var(--brand-100); box-shadow: var(--shadow-sm); }
.team__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.team__card h3 { font-size: 1.3rem; color: var(--navy); margin-bottom: .15rem; }
.team__role { color: var(--emerald-deep); font-weight: 600; font-size: .92rem; margin-bottom: .8rem; }
.team__bio { color: var(--ink-soft); font-size: .95rem; }

/* =========================================================
   APLICACIÓN
   ========================================================= */

body.app { background: var(--bg); }
.hidden { display: none !important; }

/* ---- Login ---- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem;
  background: radial-gradient(1200px 600px at 70% -10%, var(--brand-100), transparent),
              var(--bg);
}
.login__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2.4rem; width: min(440px, 92vw); text-align: center;
}
.login__card .brand { justify-content: center; margin-bottom: .4rem; }
.login__title { font-size: 1.6rem; margin: .6rem 0 .3rem; }
.login__sub { color: var(--muted); margin-bottom: 1.6rem; font-size: .95rem; }
.field { text-align: left; margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; color: var(--ink); background: #fff;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100);
}
.login__divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .8rem; margin: 1.4rem 0; }
.login__divider::before, .login__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-error { color: var(--danger); font-size: .85rem; margin-top: .6rem; min-height: 1.1em; }
.login__demo { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); text-align: left; }
.login__demo strong { display: block; color: var(--ink-soft); margin-bottom: .5rem; font-size: .82rem; }
.login__demo div { margin-bottom: .3rem; }
.login__demo span { display: inline-block; min-width: 130px; color: var(--ink); }
.login__demo code { color: var(--emerald-deep); font-size: .78rem; }
.role-picker { display: grid; gap: .6rem; }
.role-btn {
  display: flex; align-items: center; gap: .8rem; text-align: left; width: 100%;
  padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; transition: all .12s ease;
}
.role-btn:hover { border-color: var(--brand); background: var(--brand-100); }
.role-btn .ra-emoji { font-size: 1.4rem; display: inline-grid; place-items: center; width: 1.6rem; }
.ra-lw { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--emerald); color: var(--navy); font-family: var(--font-display); font-weight: 700; font-size: .8rem; }
.persona-login { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.persona-hint { font-size: .78rem; color: var(--muted); margin-top: .6rem; text-align: center; }

/* Portal de la persona: CTA a WhatsApp */
.persona-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.persona-cta .btn { white-space: nowrap; }
.role-btn .ra-name { font-weight: 600; }
.role-btn .ra-desc { font-size: .8rem; color: var(--muted); }

/* ---- Shell de la app ---- */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #cdd9d5; padding: 1.4rem 1rem; display: flex; flex-direction: column; }
.sidebar .brand { padding: .4rem .6rem 1.4rem; }
.sidebar .brand__name, .sidebar .brand__name strong { color: #fff; }
.side-section-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #7f9690; padding: .8rem .8rem .4rem; }
.side-link {
  display: flex; align-items: center; gap: .65rem; padding: .65rem .8rem; border-radius: 10px;
  color: #cdd9d5; font-size: .92rem; font-weight: 500; cursor: pointer; transition: background .12s ease;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.is-active { background: var(--emerald-deep); color: #fff; }
.side-link .si { width: 18px; text-align: center; }
.sidebar__foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.side-user .su-name { font-size: .85rem; color: #fff; font-weight: 600; }
.side-user .su-role { font-size: .75rem; color: #7f9690; }

.main { padding: 1.6rem clamp(1.2rem, 3vw, 2.4rem); overflow-y: auto; max-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.6rem; gap: 1rem; }
.topbar h1 { font-size: 1.7rem; }
.topbar p { color: var(--muted); font-size: .92rem; margin-top: .2rem; }

/* Aviso "modo prototipo" / cambia de vista */
.proto-bar {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: var(--accent-100); border: 1px solid #ecdcae; color: #7a5c14;
  border-radius: var(--radius-sm); padding: .55rem .8rem; font-size: .85rem; margin-bottom: 1.2rem;
}
.proto-bar strong { color: #5e470f; }
.proto-bar select { padding: .35rem .6rem; border-radius: 8px; border: 1px solid #e0cd97; background: #fff; font-family: inherit; }
.proto-reset { margin-left: auto; padding: .35rem .7rem; border-radius: 8px; border: 1px solid #e0cd97; background: #fff; color: #7a5c14; font-family: inherit; font-size: .82rem; cursor: pointer; }
.proto-reset:hover { background: #fff8e8; }

/* Formularios de administración */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); }
.kpi__label { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.kpi__value { font-family: var(--font-display); font-size: 2rem; color: var(--ink); margin-top: .3rem; }
.kpi__trend { font-size: .78rem; margin-top: .2rem; }
.kpi__trend.up { color: var(--ok); }
.kpi__trend.flat { color: var(--muted); }

/* Tarjetas genéricas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm); margin-bottom: 1.4rem; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; }
.card__head h2 { font-size: 1.2rem; }
.card__head p { font-size: .85rem; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }

/* Gráfico de barras simple */
.bars { display: grid; gap: .7rem; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: .8rem; font-size: .88rem; }
.bar-row .bar-label { color: var(--ink-soft); }
.bar-track { background: var(--bg); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 6px; background: linear-gradient(90deg, var(--emerald-deep), var(--emerald)); border-radius: 999px; transition: width .6s ease; }
.bar-row .bar-val { text-align: right; font-weight: 600; color: var(--ink); }

/* Tabla */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
.table td { padding: .75rem .7rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--brand-100); }

.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--brand-100); color: var(--brand-600); }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--wait { background: var(--wait-bg); color: var(--wait); }

/* Lista de consultas (persona) */
.consulta-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin-bottom: .8rem; cursor: pointer; transition: all .12s ease; background: #fff; }
.consulta-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.consulta-item__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; }
.consulta-item__q { font-weight: 600; color: var(--ink); }
.consulta-item__meta { font-size: .8rem; color: var(--muted); }

/* Biblioteca de documentos */
.doc-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .7rem; }
.doc-item__ico { font-size: 1.7rem; flex-shrink: 0; }
.doc-item__body { flex: 1; min-width: 0; }
.doc-item__body h3 { font-size: 1.02rem; color: var(--navy); margin-bottom: .2rem; }
.doc-item__body p { font-size: .88rem; color: var(--muted); }

/* Vacío */
.empty { text-align: center; color: var(--muted); padding: 2.4rem 1rem; }
.empty__emoji { font-size: 2rem; display: block; margin-bottom: .5rem; }

/* Privacidad nota */
.privacy-note { display: flex; gap: .6rem; align-items: flex-start; background: var(--brand-100); border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .85rem; color: var(--brand-600); margin-bottom: 1.4rem; }

/* Modal / detalle */
.modal { position: fixed; inset: 0; background: rgba(17,36,31,.45); display: grid; place-items: center; padding: 1.5rem; z-index: 100; }
.modal__card { background: var(--surface); border-radius: var(--radius); width: min(620px, 96vw); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 1.25rem; }
.modal__close { background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal__body { padding: 1.5rem; }
.qa-block { margin-bottom: 1.2rem; }
.qa-block__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .3rem; }
.qa-block__text { background: var(--bg); border-radius: var(--radius-sm); padding: .9rem 1rem; color: var(--ink); white-space: pre-wrap; }
.qa-block__text--answer { background: var(--brand-100); }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: .8rem 1.3rem; border-radius: 999px; box-shadow: var(--shadow-lg); opacity: 0; transition: all .25s ease; z-index: 200; font-size: .9rem; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Badge de alertas en el menú lateral */
.side-badge { margin-left: auto; background: #e05a3d; color: #fff; font-size: .7rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; }

/* Herramientas de la bandeja (búsqueda + filtros) */
.bandeja-tools { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.bandeja-search { flex: 1; min-width: 220px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: .9rem; }
.bandeja-tools select { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: .9rem; background: #fff; }
.bandeja-search:focus, .bandeja-tools select:focus { outline: none; border-color: var(--emerald-deep); box-shadow: 0 0 0 3px var(--brand-100); }

/* Bandeja agrupada (por persona / organización) */
.group-block { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 1rem; overflow: hidden; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--brand-100); padding: .7rem 1rem; }
.group-head h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--navy); margin: 0; }
.group-sub { font-family: var(--font-sans); font-weight: 400; font-size: .82rem; color: var(--muted); margin-left: .4rem; }
.group-count { font-size: .82rem; color: var(--emerald-deep); font-weight: 600; white-space: nowrap; }
.group-block .table { margin: 0; }
.group-block .table th { background: #fff; }

/* Bloque de seguimiento comercial (modal edición) */
.comercial-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin-bottom: 1rem; background: var(--bg); }
.comercial-box__title { font-weight: 700; font-size: .85rem; color: var(--emerald-deep); margin-bottom: .7rem; }

/* Checkbox de consentimiento */
.consent-check { display: flex; gap: .55rem; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); margin-top: .4rem; }
.consent-check input { margin-top: .2rem; }

/* Acciones del modal (editar/eliminar) */
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.modal-actions .btn { color: var(--muted); }
#del-consulta:hover { border-color: var(--danger); color: var(--danger); }

/* Centro de alertas */
.alert-banner { display: flex; gap: .7rem; align-items: flex-start; background: #fff6e6; border: 1px solid #f0dba8; color: #7a5c14; border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin-bottom: 1.2rem; font-size: .9rem; }
.alert-banner span { font-size: 1.1rem; }
.alerta { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .7rem; cursor: pointer; transition: all .12s ease; }
.alerta:hover { border-color: var(--emerald-deep); box-shadow: var(--shadow-sm); }
.alerta__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.alerta--new { background: var(--brand-100); border-color: #bfe6d6; }
.alerta--new .alerta__dot { background: var(--emerald); }
.alerta__body { flex: 1; min-width: 0; }
.alerta__txt { font-weight: 600; color: var(--ink); }
.alerta__meta { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerta__time { font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero__inner, .grid-2 { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .steps, .audience, .plans, .compare, .team { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .impact-grid2 { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .plan--featured { transform: none; }
  .nav__links { display: none; }
  /* En móvil: los CTA del header son solo íconos (el texto ensanchaba la página) */
  .nav__cta { gap: .5rem; }
  .nav-cta-text { display: none; }
  .nav-cta-btn { padding: 0; width: 42px; height: 42px; justify-content: center; }
  .cta__actions { width: 100%; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem; }
  .sidebar .brand { width: 100%; padding-bottom: .6rem; }
  .side-section-label, .sidebar__foot { display: none; }
  .main { max-height: none; }
}

/* =========================================================
   REPORTES (admin) — documento on-brand + descarga a PDF
   Colores fijos en hex para que el PDF salga idéntico.
   ========================================================= */
.rep-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.rep-controls .field { margin: 0; min-width: 200px; }
.rep-actions { display: flex; gap: .6rem; margin: 1rem 0 1.4rem; }

.rep-scroll { overflow-x: auto; padding-bottom: 4px; }   /* si la ventana es angosta, se desplaza sin aplastar el gráfico */
.rep { width: 794px; margin: 0 auto; background: #fff;
  border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px -20px rgba(17,36,31,.35);
  color: #1c2733; font-family: 'Inter', sans-serif; }
.rep, .rep * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

.rep__hd { background: #0F2340; color: #fff; padding: 30px 44px 26px; }
.rep__hd-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.rep-lw { display: inline-flex; align-items: center; gap: 11px; font-family: 'Fraunces', serif; font-weight: 600; font-size: 22px; }
.rep-lw .mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #2DC89A; color: #0F2340; font-weight: 700; font-size: 15px; font-family: 'Inter', sans-serif; }
.rep__tag { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #2DC89A; text-align: right; line-height: 1.6; }
.rep__title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; }
.rep__cliente { color: #2DC89A; }
.rep__meta { display: flex; gap: 26px; margin-top: 12px; font-size: 12.5px; color: #c4d2e2; flex-wrap: wrap; }
.rep__meta b { color: #fff; }

.rep-body { padding: 26px 44px; }
.rep-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #1A7A5E; margin-bottom: 12px; }

.rep-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.rep-kpi { border: 1px solid #e4e7ec; border-radius: 14px; padding: 18px 20px; }
.rep-kpi .n { font-family: 'Fraunces', serif; font-weight: 600; font-size: 42px; line-height: 1; color: #1A7A5E; }
.rep-kpi .l { font-size: 12.5px; color: #5d6b7a; margin-top: 6px; }
.rep-kpi.acc { background: #0F2340; border-color: #0F2340; }
.rep-kpi.acc .n { color: #fff; }
.rep-kpi.acc .l { color: #bcd; }

.rep-insight { display: flex; gap: 11px; align-items: flex-start; background: #F5F4F0; border-radius: 12px; padding: 14px 18px; font-size: 13.5px; line-height: 1.5; margin-bottom: 24px; }
.rep-insight b { color: #0F2340; }

.rep-cols { display: grid; grid-template-columns: 1fr 1.05fr; gap: 26px; margin-bottom: 8px; }
.rep-sec { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; color: #0F2340; margin-bottom: 16px; }
.rep-card { border: 1px solid #e4e7ec; border-radius: 14px; padding: 22px 24px; }

.rep-donut-wrap { display: flex; align-items: center; gap: 22px; }
.rep-donut { width: 150px; height: 150px; border-radius: 50%; flex-shrink: 0; position: relative; }
.rep-donut::after { content: ""; position: absolute; inset: 26px; background: #fff; border-radius: 50%; }
.rep-donut__c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2; }
.rep-donut__c .t { font-family: 'Fraunces', serif; font-weight: 600; font-size: 32px; color: #0F2340; line-height: 1; }
.rep-donut__c .s { font-size: 10px; color: #5d6b7a; margin-top: 2px; }
.rep-legend { display: flex; flex-direction: column; gap: 12px; }
.rep-lg { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.rep-lg .dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.rep-lg .n { margin-left: auto; font-weight: 700; color: #0F2340; }
.rep-lg .pct { color: #5d6b7a; font-size: 12px; margin-left: 6px; }

.rep-bars { display: flex; flex-direction: column; gap: 14px; }
.rep-brow { display: grid; grid-template-columns: 92px 1fr 66px; align-items: center; gap: 12px; font-size: 13.5px; }
.rep-blabel { color: #1c2733; }
.rep-btrack { background: #F5F4F0; border-radius: 999px; height: 14px; overflow: hidden; }
.rep-bfill { display: block; height: 100%; min-width: 8px; border-radius: 999px; }
.rep-bval { text-align: right; font-weight: 700; color: #0F2340; }
.rep-bval small { font-weight: 500; color: #5d6b7a; }

.rep-orgtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-orgtable th { text-align: left; color: #5d6b7a; font-weight: 600; padding: 8px 6px; border-bottom: 1px solid #e4e7ec; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.rep-orgtable td { padding: 9px 6px; border-bottom: 1px solid #eef0f2; }
.rep-orgtable td.num { text-align: right; font-weight: 700; color: #0F2340; }

.rep-priv { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: #1A7A5E; margin-top: 24px; padding: 12px 16px; background: #F5F4F0; border-radius: 10px; }
.rep-priv b { color: #0F2340; }
.rep-closing { margin-top: 24px; background: #1A7A5E; color: #fff; border-radius: 16px; padding: 24px 30px; }
.rep-closing h3 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 19px; margin-bottom: 8px; }
.rep-closing p { font-size: 13px; line-height: 1.55; color: #d9f2ea; }

.rep-ft { background: #0F2340; color: #9fb1c7; font-size: 11.5px; padding: 14px 44px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rep-ft b { color: #fff; }

.rep-empty { padding: 3rem 1rem; text-align: center; color: #5d6b7a; }

/* Impresión: mostrar SOLO el documento del reporte */
@media print {
  body { background: #fff !important; }
  .sidebar, .proto-bar, .topbar, .rep-controls, .rep-actions, #toast, #modal-root { display: none !important; }
  .app-shell { display: block !important; }
  .main { padding: 0 !important; overflow: visible !important; max-height: none !important; }
  #page { margin: 0 !important; }
  .rep-scroll { overflow: visible !important; }
  .rep { width: 210mm !important; min-height: 297mm; box-shadow: none !important; border-radius: 0 !important; margin: 0 !important; }
  @page { size: A4; margin: 0; }
}
