/* MIND · Panel del equipo (183). Diseño aprobado en la réplica del 20 nov. Oscuro por defecto:
   negro con el azul MIND (#14213D) en el marco; claro: blanco y negro con el mismo marco.
   Tipografías propias de este sitio (Inter y Jost, licencia OFL en /fonts). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/jost.woff2') format('woff2');
}
/* Panel de MIND: navy de marca para el marco, lienzo blanco frío, acento nodo azul; Jost para cifras
   y títulos, Inter para operar. Marco lateral + lienzo de trabajo; en celular, barra inferior. */
/* Oscuro por defecto: negro de fondo con el azul MIND (#14213D) en el marco, las superficies
   elegidas y los gráficos; el azul nodo solo como detalle (en vivo, foco, sin leer). Claro: blanco
   y negro con el mismo marco azul MIND. */
:root {
  --navy: #14213d;
  --node: #6fa0ff;
  --bg: #050608;
  --surface: #0b0d12;
  --surface-2: #10131b;
  --raise: linear-gradient(180deg, rgb(20 33 61 / 0.5), rgb(11 13 18 / 0) 64%);
  --text: #f2f4f8;
  --muted: #a1a8b8;
  --faint: #6c7385;
  --line: #1a1e28;
  --line-strong: #272d3b;
  --accent: #8db4ff;
  --accent-soft: rgb(20 33 61 / 0.8);
  --primary: #f2f4f8;
  --on-primary: #050608;
  --sel: #14213d;
  --on-sel: #ffffff;
  --side: linear-gradient(180deg, #14213d 0%, #0c142a 46%, #050608 100%);
  --bar-a: #14213d;
  --bar-b: #4f7fd9;
  --toast: #0f1a33;
  --ok: #3fc483;
  --ok-soft: rgb(63 196 131 / 0.1);
  --warn: #f0b24a;
  --warn-line: rgb(240 178 74 / 0.45);
  --bad: #ff7468;
  --bad-soft: rgb(255 116 104 / 0.1);
  --shadow:
    0 1px 0 rgb(255 255 255 / 0.03) inset, 0 12px 32px -18px rgb(0 0 0 / 0.8);
  --shadow-lg: 0 30px 80px -24px rgb(0 0 0 / 0.85);
  --display: 'Jost', 'Avenir Next', ui-sans-serif, system-ui, sans-serif;
  --body:
    'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --raise: none;
  --text: #0b0d12;
  --muted: #555c6b;
  --faint: #8a909c;
  --line: #e7e9ee;
  --line-strong: #d7dae2;
  --accent: #2f5fd8;
  --accent-soft: #eef2fb;
  --primary: #0b0d12;
  --on-primary: #ffffff;
  --sel: #14213d;
  --on-sel: #ffffff;
  --side: linear-gradient(180deg, #14213d 0%, #0e1830 60%, #0b0d12 100%);
  --bar-a: #0b0d12;
  --bar-b: #14213d;
  --toast: #0b0d12;
  --ok: #138a52;
  --ok-soft: #e8f6ee;
  --warn: #a96400;
  --warn-line: #f0c46f;
  --bad: #c2372b;
  --bad-soft: #fdeeec;
  --shadow:
    0 1px 2px rgb(11 13 18 / 0.04), 0 10px 28px -16px rgb(11 13 18 / 0.16);
  --shadow-lg: 0 24px 64px -20px rgb(11 13 18 / 0.35);
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--node);
  outline-offset: 2px;
  border-radius: 8px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
svg.i {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Marco */
.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100%;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 14px;
  background: var(--side);
  color: #c3cbdc;
  border-right: 1px solid rgb(255 255 255 / 0.04);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 10px 18px;
}
.brand b {
  font: 600 22px/1 var(--display);
  letter-spacing: 0.06em;
  color: #fff;
}
.brand b i {
  color: var(--node);
  font-style: normal;
}
.brand span {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8796b8;
}
.nav-label {
  margin: 14px 10px 6px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f7fa3;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  padding: 9px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover {
  background: rgb(255 255 255 / 0.06);
  color: #fff;
}
.nav a[aria-current='page'] {
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--node);
}
.nav a .count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fff;
  color: #050608;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}
.nav a .tag {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fb2ff;
  border: 1px solid rgb(143 178 255 / 0.35);
  border-radius: 999px;
  padding: 0 7px;
}
.side-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 12px 10px 0;
  border-top: 1px solid rgb(255 255 255 / 0.08);
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2b3f6e, #14213d);
  border: 1px solid rgb(255 255 255 / 0.14);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  flex: none;
}
.me small {
  display: block;
  color: #8796b8;
  font-size: 12px;
}
.me strong {
  color: #fff;
  font-weight: 600;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--faint);
  text-align: left;
}
.search kbd {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: 11px var(--body);
  color: var(--muted);
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
}
.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgb(34 197 94 / 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgb(34 197 94 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(34 197 94 / 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .live i {
    animation: none;
  }
  * {
    transition: none !important;
  }
}
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}
.icon-btn:hover {
  border-color: var(--line-strong);
}
.icon-btn .dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}
.view {
  padding: 28px 32px 120px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 22px;
  align-content: start;
}

/* Piezas */
.head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.head h1 {
  font-size: 30px;
}
.head p {
  margin: 4px 0 0;
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 0;
}
.card-h h2 {
  font-size: 17px;
}
.card-b {
  padding: 16px 18px 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--faint);
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn.primary:hover {
  filter: brightness(1.15);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  padding-inline: 8px;
}
.btn.sm {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 9px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.trial {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.pill.trial::before {
  background: var(--node);
}
.pill.paying {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  background: var(--ok-soft);
}
.pill.past_due,
.pill.open {
  color: var(--warn);
  border-color: var(--warn-line);
}
.pill.trial_ended,
.pill.cancelled,
.pill.closed {
  color: var(--faint);
}
.pill.answered {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.pill.nodot::before {
  display: none;
}
.chip {
  display: inline-flex;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
  font-size: 12.5px;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.seg button[aria-pressed='true'] {
  background: var(--sel);
  color: var(--on-sel);
}
.seg button small {
  margin-left: 6px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 12.5px;
  font-weight: 600;
}
.input,
textarea.input,
select.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}
textarea.input {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}
.grid {
  display: grid;
  gap: 16px;
}
.kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.kpi {
  padding: 16px 18px;
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}
button.kpi:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.kpi,
.card {
  background-image: var(--raise);
}
.kpi span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.kpi strong {
  font: 500 30px/1.1 var(--display);
  font-variant-numeric: tabular-nums;
}
.kpi small {
  font-size: 12px;
  color: var(--faint);
}
.kpi small.up {
  color: var(--ok);
}
.kpi small.down {
  color: var(--bad);
}
.split {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: start;
}

/* Atención */
.attn {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.attn li {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.attn li:first-child {
  border-top: 0;
}
.attn .sev {
  align-self: stretch;
  border-radius: 4px;
  background: var(--line-strong);
}
.attn .sev.high {
  background: var(--bad);
}
.attn .sev.mid {
  background: var(--warn);
}
.attn .sev.low {
  background: var(--line-strong);
}
.attn strong {
  display: block;
  font-weight: 600;
}
.attn .acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Embudo */
.funnel {
  display: grid;
  gap: 10px;
}
.fstep {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.fstep .bar {
  height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}
.fstep .bar i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--bar-a), var(--bar-b));
}
.fstep b {
  font: 500 16px var(--display);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fstep:hover .bar i {
  filter: brightness(1.15);
}
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.feed li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
}
.feed .fi {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.feed .fi svg {
  width: 15px;
  height: 15px;
}
.spark {
  width: 100%;
  height: 120px;
  display: block;
}

/* Tabla */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.toolbar .input {
  max-width: 320px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  display: inline-flex;
  gap: 4px;
}
th button[aria-sort] {
  color: var(--text);
}
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr {
  cursor: pointer;
}
tbody tr:hover td {
  background: var(--surface-2);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td small {
  display: block;
  color: var(--faint);
  font-size: 12px;
}
.biz {
  display: flex;
  align-items: center;
  gap: 11px;
}
.biz small {
  display: block;
  color: var(--faint);
  font-size: 12px;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font: 600 13px var(--display);
  color: #fff;
  flex: none;
}
.new-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--node);
  box-shadow: 0 0 0 3px rgb(111 160 255 / 0.18);
}
.steps {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}
.steps i {
  width: 14px;
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
}
.steps i.on {
  background: var(--ok);
}
.health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.health .ring {
  flex: none;
}
.chan {
  display: inline-flex;
  gap: 5px;
}
.chan span {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--faint);
}
.chan span.on {
  color: #fff;
  border-color: transparent;
}
.chan .wa.on {
  background: #1fa855;
}
.chan .ig.on {
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
}
.chan .fb.on {
  background: #1877f2;
}

/* Ficha */
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.ph {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 22px;
}
.ph .logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 20px;
}
.ph h1 {
  font-size: 26px;
}
.ph .acts {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs button {
  border: 0;
  background: none;
  padding: 12px 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--text);
}
.check {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.check li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.check li:last-child {
  border-bottom: 0;
}
.tick {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  color: transparent;
}
.tick.on {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.tick svg {
  width: 13px;
  height: 13px;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  margin: 0;
}
.kv dt {
  color: var(--muted);
  font-size: 13px;
}
.kv dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}
.mods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mod {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 2px;
}
.mod b {
  font-weight: 600;
}
.mod span {
  font-size: 12px;
  color: var(--faint);
}
.mod.on {
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.mod.on span {
  color: var(--ok);
}
.note {
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  display: grid;
  gap: 4px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 14px;
}
.timeline li {
  position: relative;
  padding-left: 12px;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}

/* Tickets */
.inbox {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 300px;
  min-height: 640px;
  overflow: hidden;
}
.inbox > * {
  min-width: 0;
}
.tlist {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.tlist .seg {
  margin: 14px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.tlist .seg button {
  padding: 6px 10px;
  white-space: nowrap;
}
.tlist ul {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px;
  overflow-y: auto;
}
.titem {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
}
.titem:hover {
  background: var(--surface-2);
}
.titem[aria-current='true'] {
  background: var(--surface-2);
  box-shadow: inset 2px 0 0 var(--node);
}
.titem .row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.titem .row strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.titem .row.meta {
  font-size: 12px;
  color: var(--faint);
}
.unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--node);
  flex: none;
}
.sla {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}
.sla.late {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
  background: var(--bad-soft);
}
.sla.soon {
  color: var(--warn);
  border-color: var(--warn-line);
}
.thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.thread-h {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.thread-h h2 {
  font-size: 19px;
}
.thread-h .acts {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: grid;
  gap: 14px;
  align-content: start;
  background: var(--surface-2);
}
.msg {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.msg.staff {
  justify-self: end;
  background: var(--sel);
  border-color: var(--sel);
  color: #eef1f7;
}
.msg.staff header {
  color: #9fb0d3;
}
.msg.internal {
  justify-self: end;
  background: var(--surface);
  border: 1px dashed var(--warn-line);
}
.msg header {
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 4px;
  font-weight: 600;
}
.msg p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.composer {
  border-top: 1px solid var(--line);
  padding: 14px 22px 18px;
  display: grid;
  gap: 10px;
  background: var(--surface);
}
.composer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.composer .row .grow {
  flex: 1;
}
.composer .row {
  justify-content: flex-end;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.switch {
  appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}
.switch:checked {
  background: var(--node);
}
.switch:checked::after {
  transform: translateX(14px);
}
.ctx {
  border-left: 1px solid var(--line);
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
  overflow-y: auto;
}
.ctx h3 {
  font-size: 14px;
  font-family: var(--body);
  font-weight: 600;
}
.macros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.macros button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.macros button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
  justify-items: center;
}
.empty svg {
  width: 34px;
  height: 34px;
  color: var(--faint);
}

/* Ajustes */
.settings {
  display: grid;
  gap: 0;
}
.setrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}
.setrow:first-child {
  border-top: 0;
}
.setrow b {
  font-weight: 600;
  display: block;
}
.channels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.cbox input {
  accent-color: var(--accent);
}

/* Barras, estado, capturas y auditoría */
.bars {
  width: 100%;
  height: 190px;
  display: block;
}
.hbars {
  display: grid;
  gap: 10px;
}
.hbar {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
}
.hbar .bar {
  height: 10px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.hbar .bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--bar-a), var(--bar-b));
}
.hbar b {
  text-align: right;
  font: 500 14px var(--display);
  font-variant-numeric: tabular-nums;
}
.insight {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.insight .fi {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--sel);
  color: #fff;
}
.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  background-image: var(--raise);
}
.banner .big {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
}
.banner.ok .big {
  background: var(--ok-soft);
  color: var(--ok);
}
.banner.warn {
  border-color: var(--warn-line);
}
.banner.warn .big {
  background: var(--surface-2);
  color: var(--warn);
}
.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.svc {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}
.svc header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.svc .lat {
  font-size: 12px;
  color: var(--faint);
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.status-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.status-dot.warn {
  background: var(--warn);
}
.status-dot.bad {
  background: var(--bad);
}
.uptime {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 2px;
}
.uptime i {
  height: 18px;
  border-radius: 2px;
  background: var(--ok);
  opacity: 0.75;
}
.uptime i.w {
  background: var(--warn);
  opacity: 1;
}
.uptime i.b {
  background: var(--bad);
  opacity: 1;
}
.atts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.att {
  width: 118px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  padding: 0;
  text-align: left;
}
.att img {
  display: block;
  width: 100%;
  height: 78px;
  object-fit: cover;
  object-position: top;
}
.att span {
  display: block;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att:hover {
  border-color: var(--line-strong);
}
.pending {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pending span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
}
.pending img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}
.pending button {
  border: 0;
  background: none;
  color: var(--faint);
  padding: 0 4px;
}
.drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}
.drop.over {
  border-color: var(--node);
  background: var(--surface-2);
}
.lightbox img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.crm-frame {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px;
  background: var(--surface-2);
}
.crm-frame .inner {
  background: var(--surface);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 14px;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.who .avatar {
  width: 26px;
  height: 26px;
  font-size: 10px;
}
.who .sys {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.who .sys svg {
  width: 14px;
  height: 14px;
}
.more-list {
  display: grid;
  gap: 4px;
}
.more-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.more-list a:hover {
  background: var(--surface-2);
}
.split-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1180px) {
  .split-3 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .hbar {
    grid-template-columns: 110px minmax(0, 1fr) 54px;
  }
}

/* Capas */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgb(10 16 32 / 0.45);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal {
  width: min(520px, 100%);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  display: grid;
  gap: 16px;
}
.modal h2 {
  font-size: 21px;
}
.modal .acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgb(10 16 32 / 0.3);
}
.drawer {
  position: fixed;
  z-index: 56;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100%);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer ul {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}
.drawer li button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  text-align: left;
  padding: 12px;
  border: 0;
  background: none;
  border-radius: 12px;
}
.drawer li button:hover {
  background: var(--surface-2);
}
.drawer li.unread-n button {
  background: var(--accent-soft);
}
.palette {
  width: min(620px, 100%);
  align-self: start;
  margin-top: 10vh;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.palette input {
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 16px;
  outline: none;
}
.palette ul {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 420px;
  overflow-y: auto;
}
.palette li button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  background: none;
  border-radius: 10px;
  text-align: left;
}
.palette li button[aria-selected='true'],
.palette li button:hover {
  background: var(--accent-soft);
}
.palette .grp {
  padding: 8px 12px 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.toasts {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 84px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100% - 40px));
}
.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border-radius: 14px;
  background: var(--toast);
  border: 1px solid rgb(255 255 255 / 0.08);
  color: #e9eefb;
  box-shadow: var(--shadow-lg);
  animation: rise 0.25s ease-out;
}
.toast .fi {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}
.toast b {
  color: #fff;
  display: block;
}
.toast small {
  color: #a9b6d6;
}
.toast button {
  border: 0;
  background: none;
  color: var(--node);
  font-weight: 600;
}
@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* Barra de revisión de la réplica */

.mobile-tabs {
  display: none;
}
@media (max-width: 1180px) {
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .inbox {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .ctx {
    display: none;
  }
  /* Cliente, contexto y prioridad pasan debajo de la conversación. */
  .inbox.has-t .ctx {
    display: grid;
    grid-column: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
  .profile {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .side {
    display: none;
  }
  .top {
    padding: 12px 16px;
  }
  .view {
    padding: 20px 16px 150px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .head h1 {
    font-size: 25px;
  }
  .inbox {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .inbox.has-t .tlist {
    display: none;
  }
  .inbox:not(.has-t) .thread {
    display: none;
  }
  .tlist {
    border-right: 0;
  }
  .inbox.has-t .ctx {
    grid-column: 1;
  }
  .fstep {
    grid-template-columns: 110px minmax(0, 1fr) 44px;
  }
  .live span {
    display: none;
  }
  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: #050608;
    border-top: 1px solid #1a1e28;
  }
  .mobile-tabs a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 0;
    color: #9fb0d3;
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 600;
    position: relative;
  }
  .mobile-tabs a[aria-current='page'] {
    color: #fff;
  }
  .mobile-tabs a .count {
    position: absolute;
    top: 0;
    right: 22%;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    background: #fff;
    color: #050608;
    font-size: 10px;
    display: grid;
    place-items: center;
  }
  .toasts {
    bottom: 136px;
  }
  table.resp thead {
    display: none;
  }
  table.resp,
  table.resp tbody,
  table.resp tr,
  table.resp td {
    display: block;
  }
  table.resp tr {
    padding: 10px 4px;
    border-bottom: 1px solid var(--line);
  }
  table.resp td {
    border: 0;
    padding: 4px 12px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  table.resp td::before {
    content: attr(data-l);
    color: var(--faint);
    font-size: 12px;
  }
  table.resp td:first-child::before {
    display: none;
  }
  .ph .acts {
    margin-left: 0;
  }
  .attn li {
    grid-template-columns: 4px minmax(0, 1fr);
  }
  .attn .acts {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* ── Entrada ── */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      1200px 600px at 20% -10%,
      rgb(20 33 61 / 0.9),
      transparent 60%
    ),
    var(--bg);
}
.gate[hidden],
.app[hidden] {
  display: none;
}
.gate-card {
  width: min(400px, 100%);
  display: grid;
  gap: 18px;
  padding: 30px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.gate-card .brand {
  padding: 0;
}
.gate-card h1 {
  font-size: 24px;
}
.gate-card form {
  display: grid;
  gap: 14px;
}
.gate-msg {
  font-size: 13.5px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bad-soft);
  color: var(--bad);
}
.gate-msg.info {
  background: var(--accent-soft);
  color: var(--text);
}
.gate-msg:empty {
  display: none;
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  justify-self: start;
}
.linkish:hover {
  color: var(--text);
}
.captcha:empty {
  display: none;
}
.captcha.off {
  display: none;
}
.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 14px;
}
.side-foot .me {
  cursor: default;
}
.side-foot .out {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}
.banner {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 13.5px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.banner.bad {
  border-color: var(--bad);
  color: var(--bad);
  background: var(--bad-soft);
}
.gate-card .brand b {
  color: var(--text);
}
.gate-card .brand span {
  color: var(--faint);
}
.mobile-tabs[hidden] {
  display: none !important;
}
.live.off i {
  background: var(--bad);
  animation: none;
  box-shadow: none;
}
.boot[hidden] {
  display: none;
}
