/* =====================================================================
   APICE — Portal de gestión: mesa de servicio, capacitaciones, admin
   ===================================================================== */

/* ============================ ESTRUCTURA ============================ */
.app {
  display: grid;
  grid-template-columns: 258px 1fr;
  min-height: calc(100vh - var(--header-h));
  align-items: start;
}
@media (max-width: 980px) { .app { grid-template-columns: 1fr; } }

.app__lateral {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column; gap: 4px;
}
@media (max-width: 980px) {
  .app__lateral {
    position: static; height: auto; border-right: 0;
    border-bottom: 1px solid var(--border);
    flex-direction: row; overflow-x: auto; padding: 12px 16px; gap: 6px;
  }
  .app__lateral .lateral__titulo, .app__lateral .lateral__pie { display: none; }
}

.lateral__titulo {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--text-muted); font-weight: 650; padding: 14px 12px 8px;
}
.lateral__link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-md);
  font-family: var(--font-display); font-size: var(--fs-base); font-weight: 550;
  color: var(--text-soft); cursor: pointer; border: 0; background: none;
  width: 100%; text-align: left; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lateral__link:hover { background: var(--surface-3); color: var(--text); }
.lateral__link.is-activo { background: var(--surface-brand); color: var(--on-brand-soft); font-weight: 650; }
.lateral__link svg { width: 18px; height: 18px; flex: none; }
.lateral__link .cuenta {
  margin-left: auto; background: var(--surface-3); color: var(--text-muted);
  border-radius: var(--r-full); padding: 1px 8px; font-size: var(--fs-xs); font-weight: 700;
}
.lateral__link.is-activo .cuenta { background: var(--primary); color: var(--primary-fg); }
.lateral__pie { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }

.app__cuerpo { padding: clamp(20px, 3vw, 34px); min-width: 0; }
.app__cabecera {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  justify-content: space-between; margin-bottom: 26px;
}
.app__cabecera h1 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem); margin: 0 0 4px; }
.app__cabecera p { color: var(--text-muted); margin: 0; font-size: var(--fs-base); }

/* Tarjeta de bienvenida */
.hola {
  background: var(--grad-brand); color: #fff;
  border-radius: var(--r-xl); padding: clamp(22px, 3vw, 32px);
  position: relative; overflow: hidden; margin-bottom: 26px;
}
.hola::before { content: ''; position: absolute; inset: 0; background: var(--grad-hero); }
.hola > * { position: relative; }
.hola h2 { color: #fff; margin: 0 0 6px; font-size: var(--fs-xl); }
.hola p { color: rgba(255, 255, 255, 0.82); margin: 0; font-size: var(--fs-base); }

/* ============================= MÉTRICAS ============================= */
.metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 16px; }
.metrica {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px;
  display: flex; gap: 14px; align-items: flex-start;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.metrica:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.metrica.is-clickable { cursor: pointer; }
.metrica__valor {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.9rem; line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.metrica__texto { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.metrica__ico {
  width: 42px; height: 42px; flex: none; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--surface-brand); color: var(--on-brand-soft);
}
.metrica--peligro .metrica__ico { background: var(--danger-bg); color: var(--danger-fg); }
.metrica--peligro .metrica__valor { color: var(--danger-fg); }
.metrica--alerta .metrica__ico { background: var(--warn-bg); color: var(--warn-fg); }
.metrica--alerta .metrica__valor { color: var(--warn-fg); }
.metrica--ok .metrica__ico { background: var(--ok-bg); color: var(--ok-fg); }
.metrica--ok .metrica__valor { color: var(--ok-fg); }

/* ============================== FILTROS ============================= */
.filtros {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 18px;
}
.filtros .input, .filtros .select { min-height: 38px; padding: 7px 12px; font-size: var(--fs-sm); width: auto; }
.filtros .select { padding-right: 34px; }
.filtros .buscador { flex: 1 1 220px; min-width: 180px; }
.filtros .buscador .input { width: 100%; padding-left: 38px; }
.filtros .input-icon > svg { left: 12px; width: 16px; height: 16px; }

/* ============================== TICKETS ============================= */
.ticket-fila { cursor: pointer; }
.ticket-fila__codigo {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--text-muted); display: block; margin-bottom: 3px;
}
.ticket-fila__titulo {
  font-weight: 600; color: var(--text); display: block;
  max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prio-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 700; font-family: var(--font-display); font-size: var(--fs-sm);
  white-space: nowrap;
}
.prio-tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.prio-tag[data-p="P1"] { color: var(--p1); }
.prio-tag[data-p="P2"] { color: var(--p2); }
.prio-tag[data-p="P3"] { color: var(--p3); }
.prio-tag[data-p="P4"] { color: var(--p4); }

/* Semáforo de SLA */
.sla-pin {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 650; white-space: nowrap;
  padding: 3px 9px; border-radius: var(--r-full);
  border: 1px solid transparent;
}
.sla-pin[data-e="cumplido"]   { background: var(--ok-bg);     color: var(--ok-fg);     border-color: var(--ok-bd); }
.sla-pin[data-e="en_curso"]   { background: var(--info-bg);   color: var(--info-fg);   border-color: var(--info-bd); }
.sla-pin[data-e="por_vencer"] { background: var(--warn-bg);   color: var(--warn-fg);   border-color: var(--warn-bd); }
.sla-pin[data-e="vencido"],
.sla-pin[data-e="incumplido"] { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-bd); }
.sla-pin[data-e="detenido"]   { background: var(--neutral-bg);color: var(--neutral-fg);border-color: var(--neutral-bd); }

/* Tarjeta compacta de ticket (vista móvil) */
.ticket-tarjeta {
  display: block; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; margin-bottom: 12px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ticket-tarjeta:hover { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }

/* ======================= CONVERSACIÓN DEL CASO ===================== */
.hilo { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 13px; }
.msg--propio { flex-direction: row-reverse; }
.msg__avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xs);
  background: var(--surface-3); color: var(--text-soft);
}
.msg--staff .msg__avatar { background: var(--grad-accent); color: #fff; }
.msg__burbuja {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 13px 16px; max-width: min(78%, 640px);
  font-size: var(--fs-base); line-height: 1.62;
}
.msg--propio .msg__burbuja { background: var(--surface-brand); border-color: var(--border-soft); }
.msg--interno .msg__burbuja {
  background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg);
  border-style: dashed;
}
.msg__meta {
  font-size: var(--fs-xs); color: var(--text-muted);
  margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.msg__meta strong { color: var(--text-soft); font-weight: 650; }
.msg--interno .msg__meta { color: var(--warn-fg); opacity: 0.9; }

/* Auditoría */
.auditoria { list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); }
.auditoria li {
  display: flex; gap: 11px; padding: 10px 0;
  border-bottom: 1px solid var(--border-soft); color: var(--text-soft);
}
.auditoria li:last-child { border-bottom: 0; }
.auditoria svg { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--text-muted); }
.auditoria time { color: var(--text-muted); font-size: var(--fs-xs); display: block; margin-top: 2px; }

/* Ficha lateral del caso */
.ficha { display: grid; gap: 0; }
.ficha__dato {
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm);
}
.ficha__dato:last-child { border-bottom: 0; }
.ficha__dato dt { color: var(--text-muted); flex: none; }
.ficha__dato dd { margin: 0; font-weight: 600; text-align: right; }

/* Adjuntos */
.adjunto {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface-2);
  font-size: var(--fs-sm); text-decoration: none; color: var(--text);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.adjunto:hover { border-color: var(--brand-300); background: var(--surface-3); color: var(--text); }
.adjunto svg { width: 17px; height: 17px; flex: none; color: var(--text-muted); }
.adjunto span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adjunto small { color: var(--text-muted); flex: none; }

/* Zona de arrastre */
.soltar {
  border: 2px dashed var(--border-strong); border-radius: var(--r-md);
  padding: 20px; text-align: center; color: var(--text-muted);
  font-size: var(--fs-sm); cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.soltar:hover, .soltar.is-encima { border-color: var(--primary); background: var(--surface-brand); color: var(--on-brand-soft); }

/* ============================== PESTAÑAS =========================== */
.panel-tab { display: none; }
.panel-tab.is-activo { display: block; animation: fade-in 260ms var(--ease); }

/* ============================== GRÁFICOS =========================== */
.barras { display: flex; align-items: stretch; gap: 5px; height: 130px; }
.barras__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; }
.barras__b { border-radius: 3px 3px 0 0; min-height: 2px; transition: height .5s var(--ease); }
.barras__b--a { background: var(--brand-500); }
.barras__b--b { background: var(--accent-500); }
.barras__eje { display: flex; gap: 5px; margin-top: 8px; }
.barras__eje span {
  flex: 1; text-align: center; font-size: 9px; color: var(--text-muted);
  overflow: hidden; white-space: nowrap;
}

.distrib { display: grid; gap: 12px; }
.distrib__fila { display: grid; grid-template-columns: 130px 1fr 42px; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.distrib__pista { display: block; height: 9px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.distrib__llena { display: block; height: 100%; border-radius: 99px; background: var(--grad-accent); transition: width .6s var(--ease); }
.distrib__n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ========================== AUTENTICACIÓN ========================== */
/* La pantalla de acceso es la primera impresión del portal, así que se
   trabaja con capas de degradado: base de marca, dos focos de luz en
   diagonal y una trama fina enmascarada. El lado del formulario lleva un
   degradado muy tenue para que la tarjeta blanca no quede plana. */
.auth {
  display: grid; grid-template-columns: 1.04fr 1fr; min-height: 100vh;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--surface-brand) 0%, transparent 58%),
    radial-gradient(90% 70% at 88% 100%, var(--accent-bg) 0%, transparent 62%),
    var(--surface-2);
}
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } }

.auth__panel {
  /* El brochure de Apice Travel: verde azulado muy oscuro, un foco de luz
     turquesa arriba a la derecha y la red de puntos. Es siempre oscuro, con
     cualquier tema. */
  background:
    radial-gradient(70% 55% at 88% 0%, color-mix(in srgb, var(--accent-500, #13BEC8) 52%, transparent), transparent 66%),
    radial-gradient(60% 45% at 8% 100%, color-mix(in srgb, var(--primary, #0A5C64) 38%, transparent), transparent 70%),
    linear-gradient(170deg, #0E2F31 0%, #0C2224 46%, #0A1B1D 100%);
  color: #fff;
  padding: clamp(32px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  position: relative; overflow: hidden;
}
/* La red de puntos y lineas */
.auth__panel::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('/assets/img/red-nodos.svg') center / cover no-repeat;
  opacity: .9;
}
.auth__panel > * { position: relative; z-index: 1; }
.auth__panel .logo__img img { height: 44px; width: auto; }
/* El nombre de la agencia ya va como título del panel: junto al logo se repetiría. */
.auth__panel .logo__texto { display: none; }

.auth__cuerpo { margin-top: auto; }
.auth__etiqueta {
  margin: 0 0 22px; font-family: var(--font-display); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.17em; text-transform: uppercase; color: #6DE8F5 !important;
}
.auth__titulo {
  margin: 0 0 20px; color: #fff; font-size: clamp(2.3rem, 1.6rem + 2.6vw, 3.6rem);
  line-height: 1.04; letter-spacing: -0.03em; font-weight: 800;
}
.auth__titulo span { color: #6DE8F5; }
.auth__bajada { max-width: 34em; margin: 0 0 34px; font-size: var(--fs-lg); line-height: 1.55; }
.auth__panel p { color: rgba(255, 255, 255, 0.84); }

/* Tarjetas de vidrio, tres en fila como en el brochure */
.auth__tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.auth__tarjeta {
  padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.auth__tarjeta strong { display: block; margin-bottom: 5px; font-family: var(--font-display); font-size: var(--fs-sm); color: #fff; }
.auth__tarjeta span { display: block; font-size: var(--fs-xs); line-height: 1.5; color: rgba(255, 255, 255, 0.78); }

.auth__pie {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  font-size: var(--fs-xs); color: rgba(255, 255, 255, 0.68);
}
.auth__pie a { color: rgba(255, 255, 255, 0.86); text-decoration: none; }
.auth__pie a:hover { color: #6DE8F5; }
/* Celular y tablet: el panel se vuelve una cabecera de marca sobre el formulario
   (logotipo, etiqueta y título; en tablet también la bajada). Sin tarjetas ni pie. */
@media (max-width: 960px) {
  .auth__panel { padding: 22px 22px 28px; gap: 18px; border-radius: 0 0 var(--r-xl) var(--r-xl); }
  .auth__panel .logo__img img { height: 34px; }
  .auth__cuerpo { margin-top: 0; }
  .auth__etiqueta { margin-bottom: 8px; font-size: 0.66rem; letter-spacing: 0.14em; }
  .auth__titulo { margin-bottom: 0; font-size: clamp(2rem, 8vw, 2.8rem); }
  .auth__bajada { display: none; }
  .auth__tarjetas, .auth__pie { display: none; }
  .auth__forma { padding-top: 26px; justify-content: flex-start; }
}
@media (min-width: 600px) and (max-width: 960px) {
  .auth__bajada { display: block; max-width: 36em; margin: 12px 0 0; font-size: var(--fs-base); }
}

/* ---- Lado del formulario ---- */
.auth__forma {
  padding: clamp(24px, 4vw, 52px);
  display: flex; flex-direction: column; justify-content: center;
  max-width: 580px; width: 100%; margin: 0 auto;
}
/* Cada vista (ingreso / registro) va en tarjeta, con un filo de color arriba */
.auth__forma [data-vista] {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(24px, 3.2vw, 38px);
  box-shadow: var(--shadow-lg);
}
.auth__forma [data-vista]::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-accent);
}
.auth__forma [data-vista] > h1 { letter-spacing: -0.02em; }
/* El botón principal toma el degradado de marca */
.auth__forma [data-vista] .btn--primary {
  background: var(--grad-accent); border-color: transparent; color: #fff;
}
.auth__forma [data-vista] .btn--primary:hover { filter: brightness(1.07); }

/* ============================= REPORTES ============================
   Hoja del reporte: cabecera con logotipo (solo visible al imprimir),
   indicadores, graficos SVG y el cuadro de datos. La misma hoja es lo
   que sale en el PDF. */
.reporte-hoja { display: grid; gap: 18px; }
.reporte-hoja__cab { display: none; align-items: center; gap: 22px; padding-bottom: 12px; border-bottom: 2px solid var(--brand-500); }
.reporte-hoja__logo { width: 150px; height: auto; }
.reporte-hoja__titulo h2 { margin: 0 0 4px; font-size: 20px; }
.reporte-hoja__titulo p { margin: 0; font-size: var(--fs-sm); }
.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.indicador {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 16px; border-left: 4px solid var(--brand-500);
}
.indicador__valor { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.indicador__valor small { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.indicador__texto { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 5px; line-height: 1.3; }
.indicador--ok { border-left-color: var(--ok-fg); } .indicador--ok .indicador__valor { color: var(--ok-fg); }
.indicador--alerta { border-left-color: var(--warn-fg); } .indicador--alerta .indicador__valor { color: var(--warn-fg); }
.indicador--peligro { border-left-color: var(--danger-fg); } .indicador--peligro .indicador__valor { color: var(--danger-fg); }
.reporte-graficos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reporte-grafico {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; min-width: 0; break-inside: avoid;
}
.reporte-grafico h4 { margin: 0 0 12px; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.grafico-svg { display: block; width: 100%; height: auto; font-family: inherit; }
.grafico-svg__rejilla { stroke: var(--border); stroke-width: 1; }
.grafico-svg__eje { font-size: 11px; fill: var(--text-muted); }
.grafico-svg__etq { font-size: 12px; fill: var(--text); }
.grafico-svg__val { font-size: 11.5px; font-weight: 700; fill: var(--text-soft); font-variant-numeric: tabular-nums; }
.grafico-svg__pista { fill: var(--surface-3); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: var(--fs-sm); color: var(--text-soft); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i, .dona__leyenda i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; flex: none; }
.dona { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.dona__svg { width: 150px; height: 150px; }
.dona__centro { font-size: 24px; font-weight: 800; fill: var(--text); }
.dona__sub { font-size: 10px; fill: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.dona__leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); min-width: 0; }
.dona__leyenda li { display: grid; grid-template-columns: 11px 1fr auto auto; gap: 8px; align-items: center; }
.dona__leyenda span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dona__leyenda b { font-variant-numeric: tabular-nums; }
.dona__leyenda em { font-style: normal; color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.table--reporte { font-size: var(--fs-sm); }
.table--reporte th, .table--reporte td { padding: 9px 10px; white-space: nowrap; }
.table--reporte td:nth-child(2) { white-space: normal; min-width: 180px; }
@media (max-width: 760px) {
  .reporte-graficos { grid-template-columns: 1fr; }
  .dona { grid-template-columns: 1fr; justify-items: center; }
}

/* ============================= IMPRESIÓN =========================== */
@media print {
  .site-header, .site-footer, .app__lateral, .vb-respaldo,
  [data-voicebot-launcher], [data-voicebot-panel],
  .toast-host, .edit-bar, .no-imprimir { display: none !important; }
  body { background: #fff !important; }
  .app { grid-template-columns: 1fr; }

  /* La hoja del reporte: cabecera con logotipo, colores de las barras
     conservados y nada que se parta a mitad de un grafico. */
  .reporte-hoja { -webkit-print-color-adjust: exact; print-color-adjust: exact; gap: 12px; font-size: 11px; }
  .reporte-hoja__cab { display: flex; }
  .indicadores { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .indicador { padding: 8px 10px; box-shadow: none; }
  .indicador__valor { font-size: 18px; }
  .indicador__texto { font-size: 10px; }
  .reporte-graficos { gap: 10px; }
  .reporte-grafico { padding: 10px 12px; box-shadow: none; }
  .reporte-hoja .panel { box-shadow: none; break-inside: auto; }
  .reporte-hoja .table-wrap { overflow: visible; }
  /* Diecinueve columnas en una hoja apaisada: letra pequena, celdas que
     parten por palabra y solo el codigo del ticket se mantiene entero. */
  .table--reporte { font-size: 7.5px; table-layout: auto; width: 100%; }
  .table--reporte th, .table--reporte td {
    padding: 3px 2px; white-space: normal; min-width: 6em;
    overflow-wrap: anywhere; hyphens: auto; vertical-align: top;
  }
  .table--reporte th { text-transform: none; letter-spacing: 0; font-size: 7.5px; }
  .table--reporte td:first-child { white-space: nowrap; }
  .table--reporte td:nth-child(2) { min-width: 12em; }
  .table--reporte thead { display: table-header-group; }
  .table--reporte tr { break-inside: avoid; }
  .table--reporte a { color: inherit; text-decoration: none; }
}

/* Aviso de respuestas nuevas del equipo en el portal del cliente (Lecturas). */
.aviso-mensajes {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent-500, #00BCD4) 14%, transparent); color: var(--accent-700, var(--primary));
  border: 1px solid var(--accent-300, var(--brand-300)); font-size: var(--fs-xs); font-weight: 650;
}
.aviso-mensajes svg { width: 13px; height: 13px; }
.aviso-mensajes__punto {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-500, var(--primary));
  box-shadow: 0 0 0 0 var(--accent-500, var(--primary)); animation: latido 1.8s ease-out infinite;
}
@keyframes latido {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-500, #00BCD4) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .aviso-mensajes__punto { animation: none; } }
.ticket-fila--sin-leer .ticket-fila__titulo { font-weight: 750; }
.ticket-fila--sin-leer > td:first-child { box-shadow: inset 3px 0 0 var(--accent-500, var(--primary)); }
.ticket-fila__titulo + .aviso-mensajes { display: flex; width: max-content; }
:root[data-theme="dark"] .aviso-mensajes { color: var(--accent-300, #7FE0EC); border-color: color-mix(in srgb, var(--accent-500, #00BCD4) 45%, transparent); }

/* Respuestas rápidas: menú flotante sobre el cuadro de mensaje, al escribir «/». */
.rapidas-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 70;
  max-height: min(340px, 46vh); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xl);
}
.rapidas-menu[hidden] { display: none; }
.rapidas-menu__op { padding: 11px 18px; cursor: pointer; border-bottom: 1px solid var(--border-soft); }
.rapidas-menu__op:last-of-type { border-bottom: 0; }
.rapidas-menu__op:hover, .rapidas-menu__op.is-activa { background: var(--surface-brand); }
.rapidas-menu__cab { font-size: var(--fs-sm); }
.rapidas-menu__cab code { font-family: var(--font-mono, ui-monospace, Consolas, monospace); font-weight: 700; color: var(--link, var(--primary)); margin-right: 6px; }
.rapidas-menu__cab strong { font-weight: 600; color: var(--text); }
.rapidas-menu__vista { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rapidas-menu__vacio { padding: 16px 18px; font-size: var(--fs-sm); color: var(--text-muted); }
.rapidas-menu__pie {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 11px 18px;
  background: var(--surface-2); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-soft); text-decoration: none;
}
.rapidas-menu__pie:hover { color: var(--primary); }

/* Enlaces largos del pie del menú lateral («Consola de administración»): pasan a dos líneas en vez de cortarse. */
.lateral__pie .lateral__link { white-space: normal; line-height: 1.25; text-align: left; }

/* Sesión de soporte: barra fija abajo, imposible de confundir con el uso normal. */
.barra-soporte {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: #B45309; color: #fff; font-size: var(--fs-sm);
  box-shadow: 0 -4px 18px rgba(0,0,0,.25);
}
.barra-soporte svg { display: inline-block; vertical-align: -3px; }
.barra-soporte .btn { background: #fff; color: #7C2D12; border-color: #fff; font-weight: 700; }
.con-barra-soporte { padding-bottom: 64px; }
