/* =========================================================
   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__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; }

.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: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; align-items: start; }
.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 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; }

/* 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); }
.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 { height: 100%; 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); }

/* 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; }
  .plan--featured { transform: none; }
  .nav__links { display: none; }
  .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; }
}
