/* =========================================================
   Forwardontics · Centro de atención — demo
   Paleta: teal (respiración/salud) + azul profundo
   ========================================================= */

:root {
  --band-h: 36px;
  --topbar-h: 68px;
  --sidebar-w: 256px;

  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-2: #f8fafa;
  --line: #e3eaea;
  --line-2: #d3dddd;

  --ink: #0c2a31;
  --ink-2: #3c5163;
  --muted: #6b7f8e;

  --teal-50: #eef6f4;
  --teal-100: #d9ebe8;
  --teal-300: #8fbcb5;
  --teal-500: #528a82;
  --teal-600: #45766e;
  --teal-700: #375f59;

  --navy-50: #e6eef2;
  --navy-500: #2b5f8a;
  --navy-700: #0d4a57;
  --navy-900: #08333d;

  --c-cursos: #2f63c8;
  --c-cursos-bg: #e8effc;
  --c-disp: #45766e;
  --c-disp-bg: #e5f0ee;
  --c-sop: #8a5a2b;
  --c-sop-bg: #f7eee3;

  --hot: #c4552a;
  --warm-accent: #e8774a;
  --hot-bg: #fcece4;
  --warm: #b97a0b;
  --warm-bg: #fdf3dd;
  --cold: #5a7389;
  --cold-bg: #edf1f5;

  --ok: #16a36a;
  --ok-bg: #e5f6ee;
  --danger: #c93a2b;

  --wa: #1fa855;
  --ig: #d6336c;
  --fb: #2d64d8;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 36, 64, .05);
  --shadow: 0 1px 2px rgba(13, 36, 64, .04), 0 6px 20px -8px rgba(13, 36, 64, .12);
  --shadow-lg: 0 20px 50px -18px rgba(13, 36, 64, .35);

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .85em; background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; border-radius: 6px; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic--sm { width: 16px; height: 16px; }
.ic--xs { width: 13px; height: 13px; }

.skip-link { position: absolute; left: 12px; top: -40px; z-index: 200; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: calc(var(--band-h) + 8px); }

/* ---------- Banda demo ---------- */
.demo-band {
  position: fixed; inset: 0 0 auto 0; height: var(--band-h); z-index: 100;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 16px;
  background: linear-gradient(90deg, var(--navy-900), var(--navy-700) 70%, #0b5a63);
  color: #dbe7f3; font-size: 12.5px; letter-spacing: .01em;
}
.demo-band strong { color: #fff; font-weight: 600; }
.demo-band .sep { margin: 0 8px; opacity: .5; }
.demo-band__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-300); box-shadow: 0 0 0 3px rgba(111, 202, 192, .25); }
.demo-band__link {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 500;
  transition: background .2s var(--ease);
}
.demo-band__link:hover { background: rgba(255,255,255,.22); }

/* ---------- Embed (iframe en la propuesta) ---------- */
.is-embed { --band-h: 0px; }
.is-embed .demo-band { display: none; }

/* ---------- Shell ---------- */
.app {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh; height: 100dvh; padding-top: var(--band-h);
}

.sidebar {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 14px 14px; overflow-y: auto; min-height: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 14px; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--teal-500), var(--navy-500));
  box-shadow: 0 6px 14px -6px rgba(82, 138, 130, .6);
}
.brand__mark svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.brand__text { display: flex; flex-direction: column; gap: 4px; line-height: 1.2; }
.brand__logo { display: block; width: 172px; height: auto; }
.brand__name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.brand__sub { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; padding-left: 2px; }
.sidebar__close { display: none; margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 11px;
  min-height: 40px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav__item .ic { color: var(--muted); transition: color .18s var(--ease); }
.nav__item:hover { background: var(--surface-2); color: var(--ink); }
.nav__item.is-active { background: var(--teal-50); color: var(--teal-700); }
.nav__item.is-active .ic { color: var(--teal-600); }
.nav__item.is-active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal-500); }
.nav__badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warm-accent); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }

.channels { margin-top: auto; padding-top: 8px; }
.channel { display: flex; align-items: center; gap: 9px; padding: 6px 10px; font-size: 13px; color: var(--ink-2); }
.channel .pill { margin-left: auto; }
.ch { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.ch--wa { background: var(--wa); }
.ch--ig { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.ch--fb { background: var(--fb); }
.ch .ic { stroke-width: 2; }

.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line); margin-top: 10px; }
.me__text { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.me__text span { color: var(--muted); font-size: 12px; }

.main { position: relative; overflow-y: auto; min-width: 0; min-height: 0; scroll-behavior: smooth; }
.main:focus { outline: none; }

.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(244, 247, 247, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.topbar__title h1 { font-size: 19px; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.topbar__title p { font-size: 12.5px; color: var(--muted); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; width: 260px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--muted);
  transition: border-color .18s, box-shadow .18s;
}
.search:focus-within { border-color: var(--teal-300); box-shadow: 0 0 0 3px var(--teal-50); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13.5px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--ok-bg); color: #0e7a4f; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.8); opacity: 0; } }

.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); transition: background .18s; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Vistas ---------- */
.view { display: none; padding: 26px 28px 40px; }
.view.is-active { display: block; animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view > * + * { margin-top: 20px; }

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--soft { background: var(--surface-2); box-shadow: none; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head--pad { padding: 18px 20px 0; margin-bottom: 14px; }
.card__head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card__head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; color: var(--teal-700); font-size: 13px; }
.card__link:hover .ic { transform: translateX(3px); }
.card__link .ic { transition: transform .2s var(--ease); }
.mini-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-700); }
.footnote { font-size: 12px; color: var(--muted); margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease), color .18s;
}
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn--primary { background: var(--teal-600); color: #fff; box-shadow: 0 4px 12px -6px rgba(11, 138, 128, .8); }
.btn--primary:hover { background: var(--teal-700); }
.btn--navy { background: var(--navy-700); color: #fff; box-shadow: 0 4px 12px -6px rgba(22, 58, 99, .8); }
.btn--navy:hover { background: var(--navy-900); }
.btn--ghost { background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--icon { width: 44px; padding: 0; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill--ok { background: var(--ok-bg); color: #0e7a4f; border-color: transparent; }
.pill--wait { background: var(--warm-bg); color: var(--warm); border-color: transparent; }
.pill--navy { background: var(--navy-50); color: var(--navy-700); border-color: transparent; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.badge--Cursos { background: var(--c-cursos-bg); color: var(--c-cursos); }
.badge--Dispositivos { background: var(--c-disp-bg); color: var(--c-disp); }
.badge--Soporte { background: var(--c-sop-bg); color: var(--c-sop); }
.badge--none { background: var(--surface-2); color: var(--muted); }
.badge--hot { background: var(--hot-bg); color: var(--hot); }
.badge--warm { background: var(--warm-bg); color: var(--warm); }
.badge--cold { background: var(--cold-bg); color: var(--cold); }
.badge--lang { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 11px; letter-spacing: .02em; }

.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state--ai { color: var(--teal-600); }
.state--escalated { color: var(--hot); }
.state--human { color: var(--navy-500); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot--cursos { background: var(--c-cursos); }
.dot--dispositivos { background: var(--c-disp); }
.dot--soporte { background: var(--c-sop); }
.dot--ok { background: var(--ok); }

.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #fff; background: var(--navy-500); }
.avatar--me { background: linear-gradient(135deg, var(--navy-500), var(--navy-700)); }
.avatar--ai { background: linear-gradient(135deg, var(--teal-500), var(--teal-700)); }
.avatar--ai .ic { stroke: #fff; }
.avatar--xs { width: 24px; height: 24px; }
.avatar--brand { background: linear-gradient(140deg, var(--teal-500), var(--navy-500)); }
.avatar--brand svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }

.bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); transition: width .9s var(--ease); }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend--wrap { flex-wrap: wrap; gap: 6px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw--ai { background: var(--teal-500); }
.sw--human { background: var(--navy-500); }
.sw--crm { background: #9aa9b8; }
.sw--wa { background: var(--wa); }
.sw--new { background: var(--teal-500); }
.sw--conv { background: var(--navy-50); border: 1px solid #b8c9de; }
.sw--qual { background: var(--teal-500); }

.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; gap: 2px; width: 100%; }
.seg__btn { flex: 1; min-height: 32px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: background .18s, color .18s, box-shadow .18s; white-space: nowrap; }
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line-2); background: var(--surface); white-space: nowrap; transition: all .18s var(--ease); }
.chip:hover { border-color: var(--teal-300); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.table-wrap { overflow-x: auto; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fbfdfd; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-2); border-bottom: 0; }
.table .num { text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.table th.num { font-family: var(--font); font-size: 11.5px; }
.table .strong { font-weight: 600; }
.table .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.tpl-row { cursor: pointer; }
.tpl-row.is-active { background: var(--teal-50) !important; box-shadow: inset 3px 0 0 var(--teal-500); }
.tpl-name { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 150; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow-lg);
  transition: opacity .25s var(--ease), transform .25s var(--ease); max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Inicio ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 12px 24px -16px rgba(13, 36, 64, .35); }
.kpi__top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-600); }
.kpi__icon--hot { background: var(--hot-bg); color: var(--hot); }
.kpi__icon--navy { background: var(--navy-50); color: var(--navy-500); }
.kpi__icon--warm { background: var(--warm-bg); color: var(--warm); }
.kpi__value { font-size: 28px; font-weight: 650; letter-spacing: -.03em; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.kpi__delta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi__delta b { color: var(--ok); font-weight: 600; }
.kpi__delta b.neg { color: var(--hot); }

.grid { display: grid; gap: 16px; }
.grid--home { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card--span2 { grid-column: span 2; }

.hours { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding-top: 8px; }
.hours__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.hours__bar { position: relative; width: 100%; max-width: 34px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.hours__seg { width: 100%; height: 0; transition: height .8s var(--ease); }
.hours__seg--ai { background: var(--teal-500); border-radius: 0 0 5px 5px; }
.hours__seg--human { background: var(--navy-500); border-radius: 5px 5px 0 0; }
.hours__col.is-now .hours__seg--ai { background: var(--teal-300); }
.hours__col.is-now .hours__seg--human { background: #7b9bc4; }
.hours__label { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.hours__col:hover .hours__tip { opacity: 1; transform: translate(-50%, -4px); }
.hours__tip { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 0); background: var(--ink); color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: all .15s; }

.attention li + li { border-top: 1px solid var(--line); }
.attention a { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-radius: 8px; transition: background .15s; }
.attention a:hover { background: var(--surface-2); }
.attention .att__text { min-width: 0; flex: 1; }
.attention strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention span.sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 3px; margin-bottom: 16px; }
.stack span { height: 100%; transition: flex-grow .8s var(--ease); }
.dist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.dist li + li { border-top: 1px dashed var(--line); }
.dist .dist__val { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.dist .dist__pct { width: 44px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dist--compact li { padding: 5px 0; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 132px; height: 132px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--teal-500) 0 64%, var(--navy-500) 64% 100%); }
.donut__hole { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.donut__hole strong { font-size: 24px; letter-spacing: -.02em; }
.donut__hole span { font-size: 11px; color: var(--muted); }
.donut-wrap .dist { flex: 1; }

.countries li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 4px 10px; padding: 6px 0; font-size: 13.5px; }
.countries .flag { font-size: 16px; line-height: 1; }
.countries .bar { grid-column: 2 / 4; height: 6px; }
.countries .val { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.countries .hub { color: var(--muted); font-size: 12px; margin-left: 4px; }

/* ---------- Bandeja ---------- */
.view--inbox { padding: 0; height: calc(100% - var(--topbar-h)); }
.view--inbox.is-active { display: block; }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 320px; height: 100%; min-height: 0; }
.main:has(.view--inbox.is-active) { overflow: hidden; display: flex; flex-direction: column; }
.main:has(.view--inbox.is-active) .view--inbox { flex: 1; min-height: 0; height: auto; }

.inbox__list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.inbox__filters { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.convs { flex: 1; overflow-y: auto; min-height: 0; }
.conv {
  position: relative; display: flex; gap: 11px; width: 100%; text-align: left; padding: 13px 14px;
  border-bottom: 1px solid var(--line); transition: background .15s var(--ease);
  animation: slideIn .35s var(--ease) both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.conv:hover { background: var(--surface-2); }
.conv.is-active { background: var(--teal-50); }
.conv.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--teal-500); }
.conv__av { position: relative; }
.conv__ch { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; color: #fff; border: 2px solid var(--surface); }
.conv__ch .ic { width: 10px; height: 10px; stroke-width: 2.4; }
.conv.is-active .conv__ch { border-color: var(--teal-50); }
.conv__body { flex: 1; min-width: 0; }
.conv__row { display: flex; align-items: center; gap: 6px; }
.conv__name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv__time { margin-left: auto; font-size: 11.5px; color: var(--muted); font-family: var(--mono); flex: none; }
.conv__snippet { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 7px; }
.conv__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.conv__meta .state { margin-left: auto; font-size: 11.5px; }
.conv__unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--teal-600); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.convs__empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.inbox__thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background:
  radial-gradient(circle at 20% 0%, rgba(18, 161, 148, .05), transparent 40%),
  var(--bg); }
.thread__head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 66px; }
.thread__back { display: none; }
.thread__who { min-width: 0; flex: 1; }
.thread__who strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread__who span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.thread__actions { display: flex; align-items: center; gap: 8px; }
.thread__profile-btn { display: none; }

.thread__banner { display: flex; align-items: center; gap: 10px; padding: 9px 18px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.thread__banner--ai { background: var(--teal-50); color: var(--teal-700); }
.thread__banner--escalated { background: var(--hot-bg); color: #9d2f1e; }
.thread__banner--human { background: var(--navy-50); color: var(--navy-700); }
.thread__banner .ic { flex: none; }

.msgs { flex: 1; overflow-y: auto; padding: 22px 22px 10px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.day { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; margin: 4px 0; }
.msg { max-width: min(76%, 560px); display: flex; flex-direction: column; gap: 3px; animation: msgIn .3s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg__bubble { padding: 10px 13px; border-radius: 14px; font-size: 13.8px; line-height: 1.5; box-shadow: var(--shadow-sm); white-space: pre-line; overflow-wrap: anywhere; }
.msg__meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); padding: 0 4px; }
.msg__meta .ic { width: 12px; height: 12px; }
.msg--client { align-self: flex-start; }
.msg--client .msg__bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg--ai, .msg--human { align-self: flex-end; align-items: flex-end; }
.msg--ai .msg__bubble { background: linear-gradient(180deg, #e3f6f3, #d6f0ec); border: 1px solid #c3e7e1; color: #0c3a37; border-top-right-radius: 4px; }
.msg--human .msg__bubble { background: var(--navy-700); color: #fff; border-top-right-radius: 4px; }
.msg--ai .msg__meta { color: var(--teal-700); }
.msg--human .msg__meta { color: var(--navy-500); }
.msg__bubble a, .link { color: var(--teal-700); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(11, 138, 128, .35); text-underline-offset: 2px; }
.msg--human .msg__bubble a { color: #bfe9e4; }
.msg__photo { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.sys { align-self: center; display: inline-flex; align-items: center; gap: 7px; max-width: 92%; text-align: center; font-size: 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; animation: msgIn .3s var(--ease) both; }
.sys .ic { width: 13px; height: 13px; flex: none; }
.sys--escalated { color: #9d2f1e; background: var(--hot-bg); border-color: #f6d0ca; }
.sys--human { color: var(--navy-700); background: var(--navy-50); border-color: #d2deee; }
.sys--ai { color: var(--teal-700); background: var(--teal-50); border-color: var(--teal-100); }

.typing { align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 14px; border-top-right-radius: 4px; background: #e3f6f3; border: 1px solid #c3e7e1; color: var(--teal-700); font-size: 12px; animation: msgIn .25s var(--ease) both; }
.typing--left { align-self: flex-start; border-radius: 14px; border-top-left-radius: 4px; }
.typing__dots { display: inline-flex; gap: 3px; }
.typing__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-500); animation: blink 1.2s infinite ease-in-out; }
.typing__dots i:nth-child(2) { animation-delay: .15s; }
.typing__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.thread__foot { padding: 12px 18px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.takeover { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.takeover p { flex: 1; min-width: 200px; font-size: 12.5px; color: var(--muted); }
.takeover p strong { color: var(--ink); font-weight: 600; }
.suggest { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; padding: 9px 11px; border-radius: 10px; background: var(--teal-50); border: 1px dashed var(--teal-300); font-size: 12.5px; color: var(--teal-700); cursor: pointer; text-align: left; width: 100%; transition: background .15s; }
.suggest:hover { background: var(--teal-100); }
.suggest .ic { margin-top: 1px; }
.suggest b { font-weight: 600; }
.composer { display: flex; align-items: center; gap: 8px; }
.composer input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); outline: 0; font-size: 14px; transition: border-color .18s, box-shadow .18s; }
.composer input:focus { border-color: var(--teal-300); box-shadow: 0 0 0 3px var(--teal-50); }
.composer__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

.thread__empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.thread__empty .ic { width: 40px; height: 40px; color: var(--teal-300); margin-bottom: 10px; }

.inbox__profile { background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.profile__head { padding: 22px 20px 16px; text-align: center; border-bottom: 1px solid var(--line); position: relative; }
.profile__close { display: none; position: absolute; right: 10px; top: 10px; }
.profile__head .avatar { width: 56px; height: 56px; font-size: 18px; margin: 0 auto 10px; }
.profile__head strong { display: block; font-size: 15px; }
.profile__head span { display: block; font-size: 12.5px; color: var(--muted); }
.profile__sec { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.profile__sec:last-child { border-bottom: 0; }
.profile__sec h3 { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.ai-box { border-radius: 12px; padding: 12px; background: linear-gradient(180deg, var(--teal-50), #f3fbfa); border: 1px solid var(--teal-100); }
.ai-box__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-box p { font-size: 12.8px; color: #134a46; margin-top: 8px; line-height: 1.5; }
.score { display: flex; align-items: center; gap: 12px; }
.score__num { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.score__bar { flex: 1; }
.score__bar .bar { height: 8px; }
.score__bar small { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.score--hot .bar > span { background: linear-gradient(90deg, #f0a35c, var(--hot)); }
.score--warm .bar > span { background: linear-gradient(90deg, #f3d27a, var(--warm)); }
.score--cold .bar > span { background: linear-gradient(90deg, #b9c7d4, var(--cold)); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
.note { font-size: 13px; color: var(--ink-2); background: #fffbea; border: 1px solid #f3e7b5; border-radius: 10px; padding: 10px 12px; line-height: 1.5; }

/* ---------- Simulador ---------- */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.sim__chat { padding: 0; display: flex; flex-direction: column; height: calc(100dvh - var(--band-h) - var(--topbar-h) - 66px); min-height: 520px; overflow: hidden; }
.sim__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sim__head div:nth-child(2) { flex: 1; min-width: 0; }
.sim__head strong { display: block; font-size: 14.5px; }
.sim__head span { font-size: 12px; color: var(--muted); }
.sim__body { flex: 1; overflow-y: auto; min-height: 0; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: radial-gradient(circle at 80% 0%, rgba(36, 84, 143, .05), transparent 45%), var(--bg); }
.sim__body .msg--client { align-self: flex-end; align-items: flex-end; }
.sim__body .msg--client .msg__bubble { background: var(--navy-700); color: #fff; border: 0; border-top-left-radius: 14px; border-top-right-radius: 4px; }
.sim__body .msg--ai { align-self: flex-start; align-items: flex-start; }
.sim__body .msg--ai .msg__bubble { border-top-right-radius: 14px; border-top-left-radius: 4px; }
.sim__body .msg__tags { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 2px; }
.sim__suggest { display: flex; gap: 6px; padding: 10px 14px 0; overflow-x: auto; scrollbar-width: none; }
.sim__suggest::-webkit-scrollbar { display: none; }
.sim__suggest .chip { font-size: 12px; }
.composer--sim { padding: 10px 14px 12px; }
.sim__note { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; color: var(--muted); padding: 0 16px 14px; line-height: 1.45; }
.sim__note .ic { margin-top: 2px; }
.sim__panel { display: flex; flex-direction: column; gap: 16px; }
.analysis { display: grid; gap: 14px; margin: 0; }
.analysis > div { display: flex; flex-direction: column; gap: 6px; }
.analysis dt { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.analysis dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.analysis .why { font-size: 12.5px; color: var(--ink-2); }
.flash { animation: flash .8s var(--ease); }
@keyframes flash { 0% { background: var(--teal-100); } 100% { background: transparent; } }
.analysis > div { border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
.kw { font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--navy-50); color: var(--navy-700); }
.tips li { font-size: 12.5px; color: var(--ink-2); padding: 5px 0; }

/* ---------- Campañas ---------- */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.compare__card { border-radius: var(--radius); padding: 20px 22px; border: 1px solid; position: relative; }
.compare__card h2 { font-size: 16px; font-weight: 600; margin: 10px 0 10px; letter-spacing: -.01em; }
.compare__card li { position: relative; padding-left: 20px; font-size: 13.5px; margin: 6px 0; }
.compare__card--before { background: #fbf6f5; border-color: #f0d9d4; color: #5b2b22; }
.compare__card--before li::before { content: "×"; position: absolute; left: 3px; top: -1px; color: var(--hot); font-weight: 700; }
.compare__card--before h2 { text-decoration: line-through; text-decoration-color: rgba(217, 71, 47, .45); text-decoration-thickness: 2px; }
.compare__card--after { background: linear-gradient(160deg, #eaf8f6, #f4fbfb); border-color: var(--teal-100); color: #0d3d39; box-shadow: var(--shadow); }
.compare__card--after li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 6px; border-left: 2px solid var(--teal-600); border-bottom: 2px solid var(--teal-600); transform: rotate(-45deg); }
.compare__tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.compare__card--before .compare__tag { background: var(--hot-bg); color: var(--hot); }
.compare__card--after .compare__tag { background: var(--teal-600); color: #fff; }
.compare__arrow { display: grid; place-items: center; color: var(--teal-600); }
.compare__arrow .ic { width: 28px; height: 28px; }

.quota { display: grid; grid-template-columns: auto 1fr 260px; gap: 18px; align-items: center; background: linear-gradient(90deg, var(--navy-50), #f5f8fc); border-color: #d6e1ef; }
.quota__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-700); color: #fff; }
.quota__text strong { font-size: 14.5px; color: var(--navy-900); }
.quota__text p { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.quota__nums { display: flex; align-items: baseline; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.quota__nums strong { font-size: 20px; color: var(--navy-900); font-family: var(--mono); }
.quota__nums small { font-size: 13px; color: var(--muted); }
.quota .bar > span { background: linear-gradient(90deg, var(--navy-500), var(--teal-500)); }
.quota__quality { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }

.grid--camp { grid-template-columns: minmax(0, 1fr) 340px; }
.tpl-preview { display: flex; flex-direction: column; }
.phone { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #ece5dd; flex: 1; display: flex; flex-direction: column; min-height: 300px; }
.phone__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #0f5e57; color: #fff; font-size: 13px; font-weight: 600; }
.phone__bar .verified { color: #9ff0e3; }
.phone__screen { flex: 1; padding: 14px; background:
  radial-gradient(circle at 10px 10px, rgba(0,0,0,.035) 1.5px, transparent 1.6px) 0 0 / 18px 18px, #efeae2; }
.wa-bubble { background: #fff; border-radius: 10px; border-top-left-radius: 2px; padding: 9px 11px 6px; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: 13.2px; line-height: 1.45; animation: msgIn .3s var(--ease) both; }
.wa-bubble__head { font-weight: 700; margin-bottom: 4px; }
.wa-bubble__foot { font-size: 11.5px; color: #8a8a8a; margin-top: 4px; }
.wa-bubble__time { display: block; text-align: right; font-size: 10.5px; color: #999; margin-top: 2px; }
.wa-var { background: #fff3c4; border-radius: 4px; padding: 0 3px; font-family: var(--mono); font-size: 12px; }
.wa-btns { max-width: 92%; display: grid; gap: 4px; margin-top: 4px; }
.wa-btns span { background: #fff; border-radius: 8px; text-align: center; padding: 8px; color: #0a7cff; font-size: 13px; font-weight: 500; box-shadow: 0 1px 1px rgba(0,0,0,.08); animation: msgIn .3s var(--ease) both; }

.funnel { display: flex; align-items: flex-end; gap: 3px; height: 34px; width: 110px; }
.funnel span { flex: 1; border-radius: 3px 3px 0 0; background: var(--teal-500); opacity: .35; }
.funnel span:nth-child(2) { opacity: .55; }
.funnel span:nth-child(3) { opacity: .75; }
.funnel span:nth-child(4) { opacity: 1; background: var(--navy-500); }
.pct { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------- Historial ---------- */
.grid--hist { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
.steps { position: relative; }
.steps li { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.steps li:last-child { padding-bottom: 0; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 2px; width: 2px; background: var(--teal-100); }
.steps li.is-pending:not(:last-child)::after, .steps li.is-pending::after { background: var(--line); }
.step__icon { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--teal-600); color: #fff; position: relative; z-index: 1; }
.step__icon .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.is-pending .step__icon { background: var(--surface); color: var(--warm); border: 2px dashed #e7c77a; }
.step__body { flex: 1; min-width: 0; padding-top: 4px; }
.step__body strong { font-size: 14px; }
.step__body p { font-size: 12.8px; color: var(--muted); margin-top: 2px; }
.step__body .bar { margin-top: 8px; }

.timeline { position: relative; padding-left: 4px; }
.tl-group { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px 30px; }
.tl-group:first-child { margin-top: 0; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 0 0 14px 0; }
.tl-item::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); margin-top: 2px; position: relative; z-index: 1; }
.tl-dot--crm { background: #9aa9b8; }
.tl-dot--wa { background: var(--wa); }
.tl-dot--new { background: var(--teal-500); box-shadow: 0 0 0 1px var(--teal-300), 0 0 0 5px var(--teal-50); }
.tl-card { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); transition: border-color .15s, transform .15s var(--ease); }
.tl-card:hover { border-color: var(--line-2); transform: translateX(2px); }
.tl-card--crm { background: #f7f9fb; }
.tl-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.tl-card p { font-size: 13.2px; color: var(--ink-2); }
.tl-card p b { color: var(--ink); font-weight: 600; }
.src { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-weight: 600; font-size: 11px; }
.src--crm { background: #eef1f4; color: #55677a; }
.src--wa { background: #e3f6ea; color: #137a3d; }
.src--new { background: var(--teal-50); color: var(--teal-700); }

/* ---------- Pauta ---------- */
.grid--ads { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bars__row { display: grid; grid-template-columns: 190px 1fr; gap: 12px; align-items: center; }
.bars__label { font-size: 12.8px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars__track { position: relative; height: 26px; }
.bars__conv, .bars__qual { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; width: 0; transition: width .9s var(--ease); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-family: var(--mono); font-size: 11.5px; }
.bars__conv { background: var(--navy-50); border: 1px solid #c9d7e8; color: var(--navy-700); }
.bars__qual { background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); color: #fff; top: 4px; bottom: 4px; border-radius: 4px; justify-content: flex-start; padding-left: 7px; padding-right: 0; }

.lines-ads { display: flex; align-items: flex-end; justify-content: space-around; gap: 20px; height: 220px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.la-col { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; flex: 1; max-width: 120px; }
.la-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.la-bar { width: 36px; border-radius: 8px 8px 0 0; height: 0; transition: height .9s var(--ease); position: relative; }
.la-bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.la-bar--Cursos { background: linear-gradient(180deg, #5d8be0, var(--c-cursos)); }
.la-bar--Dispositivos { background: linear-gradient(180deg, var(--teal-300), var(--c-disp)); }
.la-label { font-size: 12.5px; font-weight: 600; padding-bottom: 8px; }
.la-sub { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; text-align: center; }

/* ---------- Conocimiento ---------- */
.kb-head { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; }
.dropzone { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 2px dashed var(--teal-300); border-radius: var(--radius); background: var(--teal-50); color: var(--teal-700); cursor: pointer; transition: background .18s, border-color .18s; }
.dropzone:hover { background: var(--teal-100); border-color: var(--teal-500); }
.dropzone .ic { width: 28px; height: 28px; }
.dropzone strong { display: block; color: var(--ink); }
.dropzone span { font-size: 12.8px; color: var(--ink-2); }
.kb-stat { display: flex; flex-direction: column; justify-content: center; padding: 14px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 150px; }
.kb-stat strong { font-size: 22px; letter-spacing: -.02em; }
.kb-stat span { font-size: 12px; color: var(--muted); }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.doc { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; animation: msgIn .4s var(--ease) both; }
.doc:hover { transform: translateY(-3px); border-color: var(--teal-100); box-shadow: var(--shadow), 0 16px 30px -18px rgba(11, 138, 128, .45); }
.doc__top { display: flex; align-items: flex-start; gap: 12px; }
.doc__icon { width: 40px; height: 46px; flex: none; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: #fff; position: relative; }
.doc__icon--pdf { background: linear-gradient(160deg, #e0685a, #c0392b); }
.doc__icon--doc { background: linear-gradient(160deg, #4f84d9, #2b5cb0); }
.doc__icon--xls { background: linear-gradient(160deg, #3fb57b, #1f8a55); }
.doc__icon--web { background: linear-gradient(160deg, var(--teal-500), var(--teal-700)); }
.doc__title { font-weight: 600; font-size: 13.8px; line-height: 1.35; }
.doc__desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.doc__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.doc__foot .pill--ok { margin-left: auto; }
.rules__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.checks li { position: relative; padding: 6px 0 6px 26px; font-size: 13.5px; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 0; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--teal-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b7a75' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.checks--warn li::before { background: var(--navy-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b5f8a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 10px no-repeat; }

/* ---------- Propiedad ---------- */
.own-hero { display: flex; align-items: center; gap: 28px; padding: 26px 28px; border-radius: 18px; color: #e6f1f6; background:
  radial-gradient(circle at 90% 10%, rgba(111, 202, 192, .25), transparent 40%),
  linear-gradient(135deg, var(--navy-900), var(--navy-700) 55%, #0b5560); box-shadow: var(--shadow-lg); }
.own-hero h2 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; color: #fff; margin: 8px 0 8px; line-height: 1.25; }
.own-hero p { font-size: 14.5px; max-width: 680px; color: #c8dbe6; line-height: 1.6; }
.own-hero .eyebrow { color: var(--teal-300); }
.own-hero__ring { position: relative; width: 128px; height: 128px; flex: none; }
.own-hero__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--teal-300); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 1.4s var(--ease); }
.view.is-active .ring-fg { stroke-dashoffset: 0; }
.own-hero__num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.own-hero__num strong { font-size: 26px; color: #fff; }
.own-hero__num span { font-size: 10.5px; color: #a9c4d3; }

.own-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.own { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: msgIn .4s var(--ease) both; transition: border-color .2s, transform .2s var(--ease); }
.own:hover { border-color: var(--teal-100); transform: translateY(-2px); }
.own__check { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--teal-600); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--teal-50); margin-top: 2px; }
.own__check .ic { width: 14px; height: 14px; stroke-width: 3; }
.own__body { flex: 1; min-width: 0; }
.own__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 14.2px; }
.own__title .ic { color: var(--navy-500); }
.own__body p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.own__owner { margin-top: 8px; }

.handover__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; counter-reset: s; }
.handover__steps li { display: flex; gap: 12px; }
.handover__steps li > span { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-weight: 700; background: var(--navy-50); color: var(--navy-700); }
.handover__steps strong { font-size: 13.8px; }
.handover__steps p { font-size: 12.8px; color: var(--muted); margin-top: 3px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1360px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr); }
  .inbox__profile {
    position: fixed; top: var(--band-h); right: 0; bottom: 0; width: min(360px, 92vw); z-index: 60;
    box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .3s var(--ease);
  }
  .inbox.show-profile .inbox__profile { transform: none; }
  .thread__profile-btn { display: inline-flex; }
  .profile__close { display: grid; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .grid--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--ads, .grid--hist, .grid--camp { grid-template-columns: minmax(0, 1fr); }
  .sim { grid-template-columns: minmax(0, 1fr); }
  .sim__panel { display: grid; grid-template-columns: 1fr 1fr; }
  .quota { grid-template-columns: auto 1fr; }
  .quota__meter { grid-column: 1 / -1; }
  .handover__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { width: 200px; }
}

@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--band-h); left: 0; bottom: 0; width: min(300px, 86vw); z-index: 80;
    transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .sidebar__close { display: grid; }
  .scrim { position: fixed; inset: var(--band-h) 0 0 0; z-index: 70; background: rgba(13, 36, 64, .35); backdrop-filter: blur(2px); animation: fade .2s ease; }
  @keyframes fade { from { opacity: 0; } }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar__menu { display: grid; margin-left: -6px; }
  .view { padding: 20px 16px 32px; }
  .search { display: none; }
  .compare { grid-template-columns: 1fr; }
  .compare__arrow { transform: rotate(90deg); padding: 0; height: 20px; }
  .own-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --topbar-h: 60px; }
  .demo-band { font-size: 11.5px; gap: 6px; padding: 0 10px; justify-content: space-between; }
  .demo-band__text .hide-sm { display: none; }
  .demo-band .sep { margin: 0 4px; }
  .demo-band__link { margin-left: 0; padding: 3px 9px; flex: none; }
  .demo-band__dot { display: none; }
  .topbar__title h1 { font-size: 17px; }
  .topbar__title p { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .live-pill { padding: 0 10px; font-size: 0; gap: 0; width: 32px; justify-content: center; }
  .live-pill .pulse { margin: 0; }

  .kpis, .kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 24px; }
  .grid--home { grid-template-columns: minmax(0, 1fr); }
  .card--span2 { grid-column: auto; }
  .hours { gap: 4px; height: 160px; }
  .hours__label { font-size: 9.5px; }
  .donut-wrap { gap: 16px; }
  .donut { width: 112px; height: 112px; }
  .donut__hole { width: 78px; height: 78px; }

  /* Bandeja: un panel a la vez */
  .inbox { grid-template-columns: minmax(0, 1fr); position: relative; }
  .inbox__thread { position: absolute; inset: 0; z-index: 5; transform: translateX(100%); transition: transform .3s var(--ease); }
  .inbox.show-thread .inbox__thread { transform: none; }
  .thread__back { display: grid; margin-left: -8px; }
  .thread__head { padding: 10px 12px; gap: 8px; }
  .thread__actions .btn span.lbl { display: none; }
  .thread__actions .btn { padding: 0 10px; }
  .msgs { padding: 16px 12px 8px; }
  .msg { max-width: 88%; }
  .thread__foot { padding: 10px 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .thread__banner { padding: 8px 12px; }

  .sim__chat { height: calc(100dvh - var(--band-h) - var(--topbar-h) - 40px); min-height: 460px; }
  .sim__panel { grid-template-columns: 1fr; }
  .quota { grid-template-columns: 1fr; }
  .quota__icon { display: none; }
  .kb-head { grid-template-columns: 1fr 1fr; }
  .dropzone { grid-column: 1 / -1; }
  .rules__grid { grid-template-columns: 1fr; gap: 12px; }
  .bars__row { grid-template-columns: 1fr; gap: 4px; }
  .lines-ads { height: 200px; }
  .own-hero { flex-direction: column; align-items: flex-start; padding: 22px 20px; gap: 18px; }
  .own-hero h2 { font-size: 20px; }
  .handover__steps { grid-template-columns: 1fr; }
  .table td, .table th { padding: 11px 12px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Ajustes tras revisión visual ---------- */
.icon-btn.topbar__menu, .icon-btn.sidebar__close, .icon-btn.thread__back, .icon-btn.thread__profile-btn, .icon-btn.profile__close { display: none; }
@media (max-width: 1360px) {
  .icon-btn.thread__profile-btn, .icon-btn.profile__close { display: grid; }
}
@media (max-width: 899px) {
  .icon-btn.topbar__menu, .icon-btn.sidebar__close { display: grid; }
}
@media (max-width: 760px) {
  .icon-btn.thread__back { display: grid; }
}
.conv__av { position: relative; display: block; width: 36px; height: 36px; flex: none; }
.profile__head .avatar { display: grid; }
.hours { height: 220px; }
.dist--compact .dist__pct { width: 38px; }
.donut-wrap .dist li { gap: 8px; }
@media (min-width: 1200px) { .docs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.la-label { min-height: 58px; text-align: center; }
.profile__head .avatar { color: #fff; font-size: 18px; }
.view.view--inbox { padding: 0; }
.demo-band__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 760px) {
  .demo-band .opt-word { display: none; }
  .demo-band { font-size: 11px; }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .donut__hole span { font-size: 9.5px; }
}
@media (max-width: 1360px) and (min-width: 761px) {
  .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 24px; }
  .kpi__top { gap: 6px; align-items: flex-start; }
  .kpi__icon { flex: none; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .grid--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--home .card--span2 { grid-column: 1 / -1; }
}
@media (max-width: 899px) and (min-width: 761px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Productos con miniatura */
.tag--product { padding: 3px 9px 3px 3px; gap: 7px; background: #fff; }
.tag--product img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
