/* =====================================================================
   Consola de WhatsApp — hoja de estilos

   Paleta tomada del vocabulario clínico: papel frío azulado, tinta
   marina, y tres colores de triaje que NO son decorativos: cada uno
   dice quién atiende la conversación.

     teal    la IA responde sola
     ámbar   nadie la ha tomado
     ladrillo hay una persona a cargo
     granate la ventana de 24 h está por vencer
   ===================================================================== */

:root {
  --ink:        #0f1e2b;
  --ink-soft:   #2b3d4a;
  --slate:      #55666f;
  --slate-pale: #8b9aa2;
  --paper:      #e9eef1;
  --panel:      #ffffff;
  --rule:       #ccd7dd;
  --rule-soft:  #e3eaee;

  --ai:         #2f7d8c;
  --ai-wash:    #e2f0f2;
  --wait:       #a8761f;
  --wait-wash:  #f7eeda;
  --human:      #b8562f;
  --human-wash: #f7e8e0;
  --alert:      #9c2a3c;

  --bubble-in:  #ffffff;
  --bubble-out: #dfe9ed;

  --font-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body:  "Public Sans", system-ui, -apple-system, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, Menlo, monospace;

  --rail: 3px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mono { font-family: var(--font-mono); font-size: 0.92em; }
.dot  { color: var(--slate-pale); margin: 0 6px; }


/* ---------------------------------------------------------------
   Botones y campos
   --------------------------------------------------------------- */
.btn {
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 9px 16px;
  cursor: pointer;
  background: none;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
  transition: background-color .12s ease, border-color .12s ease;
}
.btn:focus-visible { outline: 2px solid var(--ai); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--ink-soft); }

.btn--solid { background: var(--ai); color: #fff; }
.btn--solid:hover:not(:disabled) { background: #266673; }

.btn--ghost { border-color: var(--rule); color: var(--slate); background: var(--panel); }
.btn--ghost:hover:not(:disabled) { border-color: var(--slate); color: var(--ink); }

.btn--small { padding: 5px 10px; font-size: 13px; }
.btn--block { display: block; width: 100%; }

.field { display: block; margin-bottom: 14px; }
.field--tight { margin: 12px 0; }

.field__label {
  display: block;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 5px;
}

.field__input,
.select,
.search,
.notes {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 9px 10px;
}
.field__input:focus,
.select:focus,
.search:focus,
.notes:focus {
  outline: none;
  border-color: var(--ai);
  box-shadow: 0 0 0 3px var(--ai-wash);
}
.notes { resize: vertical; font-size: 13.5px; }


/* ---------------------------------------------------------------
   Login
   --------------------------------------------------------------- */
.auth-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth {
  width: 100%;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 32px 28px;
}

.auth__mark { display: flex; gap: 4px; margin-bottom: 22px; }
.auth__bar { height: 4px; flex: 1; }
.auth__bar--ai     { background: var(--ai); }
.auth__bar--human  { background: var(--human); }
.auth__bar--wait   { background: var(--wait); }

.auth__title {
  font-family: var(--font-label);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 4px;
}

.auth__sub {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--slate);
}

.auth__error {
  margin: 0 0 16px;
  padding: 9px 11px;
  background: var(--human-wash);
  border-left: var(--rail) solid var(--alert);
  color: var(--alert);
  font-size: 13.5px;
}

.auth__form .btn { margin-top: 6px; }


/* ---------------------------------------------------------------
   Estructura de tres columnas
   --------------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 280px;
  height: 100vh;
  height: 100dvh;
}

.inbox,
.panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.inbox { border-right: 1px solid var(--rule); }
.panel { border-left: 1px solid var(--rule); overflow-y: auto; }


/* ---------------------------------------------------------------
   Bandeja
   --------------------------------------------------------------- */
.inbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}

.inbox__brand { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }

.brand__name {
  font-family: var(--font-label);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand__agent {
  font-size: 12.5px;
  color: var(--slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox__filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.scopes { display: flex; gap: 3px; }

.scope {
  flex: 1;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
  background: none;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  padding: 5px 2px;
  cursor: pointer;
}
.scope:hover { color: var(--ink); }
.scope.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.scope:focus-visible { outline: 2px solid var(--ai); outline-offset: 1px; }

.convs {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.convs__empty {
  padding: 28px 18px;
  color: var(--slate);
  font-size: 13.5px;
  text-align: center;
}

/* --- La franja de triaje: el elemento distintivo del panel --- */
.conv {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  padding: 11px 14px 11px 17px;
  cursor: pointer;
  font-family: inherit;
}
.conv::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--rail);
  background: var(--slate-pale);
}
.conv--ai::before    { background: var(--ai); }
.conv--wait::before  { background: var(--wait); }
.conv--human::before { background: var(--human); }
.conv--urgent::before {
  background: repeating-linear-gradient(
    180deg, var(--alert) 0 5px, var(--human) 5px 10px
  );
}

.conv:hover { background: var(--paper); }
.conv.is-open { background: var(--ai-wash); }
.conv:focus-visible { outline: 2px solid var(--ai); outline-offset: -2px; }

.conv__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conv__name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv__time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-pale);
  flex-shrink: 0;
}

.conv__preview {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--slate);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv__preview em { font-style: normal; color: var(--slate-pale); }

.conv__tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.tag {
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 2px;
}
.tag--ai     { background: var(--ai-wash);    color: var(--ai); }
.tag--wait   { background: var(--wait-wash);  color: var(--wait); }
.tag--human  { background: var(--human-wash); color: var(--human); }
.tag--urgent { background: var(--human-wash); color: var(--alert); }
.tag--account { background: var(--paper); color: var(--slate); }

.badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}


/* ---------------------------------------------------------------
   Conversación
   --------------------------------------------------------------- */
.thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--paper);
}

.thread__placeholder {
  margin: auto;
  text-align: center;
  padding: 32px;
  max-width: 320px;
}
.placeholder__title {
  font-family: var(--font-label);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
}
.placeholder__text { margin: 0; color: var(--slate); font-size: 13.5px; }

.thread__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.thread__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.thread__back { display: none; }

.thread__who { min-width: 0; flex: 1; }

.thread__name {
  font-family: var(--font-label);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread__meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--slate);
}

.thread__state { display: flex; gap: 6px; flex-shrink: 0; }

/* Barra de ventana de 24 h */
.window {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.window__label {
  font-family: var(--font-label);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  white-space: nowrap;
}

.window__track {
  flex: 1;
  height: 3px;
  background: var(--rule-soft);
  overflow: hidden;
}

.window__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ai);
  transition: width .4s ease;
}
.window.is-low   .window__fill { background: var(--wait); }
.window.is-low   .window__label { color: var(--wait); }
.window.is-shut  .window__fill { background: var(--alert); width: 100% !important; }
.window.is-shut  .window__label { color: var(--alert); }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.messages:focus-visible { outline: none; }

.daybreak {
  align-self: center;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  background: var(--panel);
  border: 1px solid var(--rule-soft);
  padding: 2px 10px;
  margin: 10px 0 2px;
}

.msg {
  max-width: 74%;
  padding: 8px 11px 6px;
  border-radius: 3px;
  background: var(--bubble-in);
  border: 1px solid var(--rule-soft);
  align-self: flex-start;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.msg--out {
  align-self: flex-end;
  background: var(--bubble-out);
  border-color: #cfdde3;
}

/* Marca de origen: quién escribió el saliente */
.msg__origin {
  display: block;
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.msg__origin--ia     { color: var(--ai); }
.msg__origin--app    { color: var(--human); }
.msg__origin--panel  { color: var(--slate); }
.msg__origin--sistema{ color: var(--wait); }

.msg__text { margin: 0; white-space: pre-wrap; font-size: 14px; }

.msg__media { margin: 4px 0 2px; }
.msg__media img { max-width: 100%; border-radius: 2px; display: block; }
.msg__media audio { width: 100%; }

.msg__file {
  display: inline-block;
  font-size: 13px;
  color: var(--ai);
  text-decoration: underline;
}

.msg__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--slate-pale);
}
.msg__foot .is-failed { color: var(--alert); }

.msg--failed { border-color: var(--alert); }
.msg__error { margin: 3px 0 0; font-size: 11.5px; color: var(--alert); }


/* ---------------------------------------------------------------
   Redactor
   --------------------------------------------------------------- */
.composer {
  background: var(--panel);
  border-top: 1px solid var(--rule);
  padding: 11px 18px 14px;
}

.composer__notice {
  margin-bottom: 9px;
  padding: 8px 11px;
  background: var(--wait-wash);
  border-left: var(--rail) solid var(--wait);
  font-size: 13px;
  color: var(--ink-soft);
}
.composer__notice.is-shut {
  background: var(--human-wash);
  border-left-color: var(--alert);
}

.composer__row { display: flex; gap: 9px; align-items: flex-end; }

.composer__input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 9px 11px;
  resize: none;
  max-height: 160px;
  overflow-y: auto;
}
.composer__input:focus {
  outline: none;
  border-color: var(--ai);
  box-shadow: 0 0 0 3px var(--ai-wash);
}
.composer__input:disabled { background: var(--paper); color: var(--slate-pale); }

.composer__send { flex-shrink: 0; }


/* ---------------------------------------------------------------
   Columna de control
   --------------------------------------------------------------- */
.panel__block {
  padding: 16px;
  border-bottom: 1px solid var(--rule-soft);
}

.panel__title {
  font-family: var(--font-label);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 10px;
}

.panel__hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--slate);
  line-height: 1.45;
}

.panel__actions { margin-top: 10px; }
.panel__actions .btn + .btn { margin-top: 7px; }

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.switch__opt {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
  background: var(--panel);
  border: 0;
  padding: 9px 4px;
  cursor: pointer;
}
.switch__opt + .switch__opt { border-left: 1px solid var(--rule); }
.switch__opt:hover:not(.is-on) { background: var(--paper); }
.switch__opt:focus-visible { outline: 2px solid var(--ai); outline-offset: -2px; }
.switch__opt[data-ai="1"].is-on { background: var(--ai); color: #fff; }
.switch__opt[data-ai="0"].is-on { background: var(--ink); color: #fff; }

.assigned {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  background: var(--paper);
  border-left: var(--rail) solid var(--slate-pale);
}
.assigned.is-assigned { border-left-color: var(--human); }
.assigned.is-mine     { border-left-color: var(--ai); }

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  position: relative;
  padding: 0 0 9px 13px;
  font-size: 12.5px;
  color: var(--slate);
  border-left: 1px solid var(--rule);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -3px; top: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--slate-pale);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline__what { color: var(--ink); font-weight: 500; display: block; }
.timeline__when { font-family: var(--font-mono); font-size: 11px; }


/* ---------------------------------------------------------------
   Aviso flotante
   --------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: 2px;
  max-width: 90vw;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(15, 30, 43, .22);
}
.toast.is-error { background: var(--alert); }


/* ---------------------------------------------------------------
   Adaptación a pantallas chicas
   --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 280px minmax(0, 1fr); }
  .panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px;
    z-index: 30;
    box-shadow: -8px 0 24px rgba(15, 30, 43, .12);
  }
}

@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; }

  .inbox  { display: none; }
  .panel  { width: min(300px, 88vw); }

  .shell[data-view="inbox"] .inbox  { display: flex; }
  .shell[data-view="inbox"] .thread { display: none; }
  .shell[data-view="thread"] .thread { display: flex; }

  .thread__back { display: inline-block; }
  .msg { max-width: 88%; }
}

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


/* =====================================================================
   Navegación entre secciones (chats / conocimiento / ajustes)
   ===================================================================== */
.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}

.topnav__brand {
  font-family: var(--font-label);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-right: 18px;
  white-space: nowrap;
}

.topnav__link {
  font-family: var(--font-label);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
  padding: 13px 14px;
  border-bottom: 2px solid transparent;
}
.topnav__link:hover { color: var(--ink); }
.topnav__link.is-active { color: var(--ink); border-bottom-color: var(--ai); }

.topnav__spacer { flex: 1; }

.topnav__tenant {
  font-size: 12.5px;
  color: var(--slate);
  padding-right: 12px;
  white-space: nowrap;
}
.topnav__tenant b { color: var(--ink); font-weight: 600; }

.page {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  height: 100dvh;
}
.page__body { overflow-y: auto; padding: 24px; }
.page__inner { max-width: 1080px; margin: 0 auto; }

.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page__title {
  font-family: var(--font-label);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 3px;
}
.page__sub { margin: 0; color: var(--slate); font-size: 13.5px; max-width: 60ch; }


/* --- Tarjetas de artículos --- */
.kb-list { display: flex; flex-direction: column; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }

.kb-item {
  position: relative;
  background: var(--panel);
  padding: 14px 16px 14px 19px;
}
.kb-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--rail);
  background: var(--ai);
}
.kb-item--off::before    { background: var(--slate-pale); }
.kb-item--pinned::before { background: var(--wait); }
.kb-item--off { background: #fbfbfa; }

.kb-item__top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.kb-item__title { font-size: 15px; font-weight: 600; margin: 0; flex: 1; }
.kb-item--off .kb-item__title { color: var(--slate); }

.kb-item__excerpt {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-item__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-pale);
}
.kb-item__actions { margin-left: auto; display: flex; gap: 6px; }

.kb-empty {
  background: var(--panel);
  border: 1px dashed var(--rule);
  padding: 40px 24px;
  text-align: center;
}
.kb-empty p { margin: 0 0 14px; color: var(--slate); font-size: 13.5px; }


/* --- Panel lateral de edición --- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.drawer.is-open { display: block; }

.drawer__veil {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 43, .32);
}

.drawer__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
}
.drawer__title {
  font-family: var(--font-label);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}

.drawer__body { flex: 1; overflow-y: auto; padding: 20px; }

.drawer__foot {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
}
.drawer__foot .btn { flex: 1; }

.textarea-lg {
  width: 100%;
  min-height: 260px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 11px 12px;
  resize: vertical;
}
.textarea-lg:focus {
  outline: none;
  border-color: var(--ai);
  box-shadow: 0 0 0 3px var(--ai-wash);
}

.checkline { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13.5px; }
.checkline input { width: 16px; height: 16px; accent-color: var(--ai); }

.hint { font-size: 12.5px; color: var(--slate); margin: 5px 0 0; line-height: 1.45; }


/* --- Caja de prueba del asistente --- */
.probe {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 18px;
  margin-top: 22px;
}
.probe__row { display: flex; gap: 8px; margin-bottom: 12px; }
.probe__row .search { flex: 1; }

.probe__out {
  background: var(--ai-wash);
  border-left: var(--rail) solid var(--ai);
  padding: 12px 14px;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.55;
}
.probe__out:empty { display: none; }

.probe__meta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate-pale);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 18px;
  margin-bottom: 16px;
}
.card__title {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 12px;
}

.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat__n {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  display: block;
  line-height: 1.2;
}
.stat__k {
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

table.plain { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.plain th {
  font-family: var(--font-label);
  font-size: 12.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
}
table.plain td { padding: 9px 10px; border-bottom: 1px solid var(--rule-soft); }
table.plain tr:last-child td { border-bottom: 0; }

@media (max-width: 780px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topnav__tenant { display: none; }
  .page__body { padding: 16px; }
}

/* El shell con barra de navegación arriba descuenta su altura */
.shell--nav { height: calc(100vh - 49px); height: calc(100dvh - 49px); }
