/* ============================================================================
   Portal del cliente — rediseño "nexus-dark" (mismo lenguaje que el login
   Keycloak: deploy/keycloak-themes/legacyhunt). Tokens en lh-tokens.css.
   Sin frameworks ni CDNs: CSS propio + fuentes self-hosted (fonts/).
   ========================================================================== */

/* ── Fuentes self-hosted (variable fonts: un woff2 cubre todos los pesos) ── */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/dm-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--lh-font);
  font-size: 15px;
  color: var(--lh-text-body);
  background-color: var(--lh-bg);
  /* grid táctico 32px + glows lima/teal — marca nexus-dark */
  background-image:
    linear-gradient(to right, var(--lh-grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--lh-grid-line) 1px, transparent 1px),
    radial-gradient(ellipse at 18% 0%, rgba(124, 255, 77, 0.07) 0%, transparent 42%),
    radial-gradient(ellipse at 82% 100%, rgba(20, 233, 200, 0.08) 0%, transparent 42%);
  background-size: 32px 32px, 32px 32px, 100% 100%, 100% 100%;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(20, 233, 200, 0.32); }

a { color: var(--lh-teal); text-decoration: none; }
a:hover { color: var(--lh-primary); text-decoration: underline; text-underline-offset: 3px; }

button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--lh-teal); outline-offset: 2px; }

.mono { font-family: var(--lh-mono); }
.muted { color: var(--lh-text-3); }
.hidden { display: none !important; }

svg.ic { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ── Shell: header + main ────────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 20, 40, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--lh-border);
}
.hdr-in {
  /* Mismo ancho que main.wrap: si la cabecera se queda en 64rem, en un monitor
     de 24" la marca y el menú quedan flotando sobre un contenido más ancho. */
  max-width: min(100rem, calc(100vw - 3rem)); margin: 0 auto; padding: 0.65rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.brand-btn { display: flex; align-items: center; gap: 0.6rem; background: none; border: none; cursor: pointer; text-align: left; padding: 0; }
.brand-shield {
  width: 34px; height: 34px; border-radius: var(--lh-radius-md);
  display: grid; place-items: center;
  background: rgba(124, 255, 77, 0.12);
  border: 1px solid rgba(124, 255, 77, 0.25);
  box-shadow: 0 0 20px -6px var(--lh-glow-primary);
  color: var(--lh-primary);
}
.brand-shield img { max-width: 26px; max-height: 26px; object-fit: contain; }
.brand-title { font-size: 0.9rem; font-weight: 700; color: var(--lh-text); line-height: 1.15; display: block; }
.brand-org { font-family: var(--lh-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lh-text-3); display: block; }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: transparent; border: 1px solid transparent; cursor: pointer;
  border-radius: var(--lh-radius-md); padding: 0.42rem 0.75rem;
  font-size: 0.85rem; font-weight: 600;
  /* Antes --lh-text-2 (#A3B8D9): sobre la cabecera oscura las opciones del menú
     se perdían. --lh-text-body es el token pensado para texto sostenido sobre
     fondo oscuro y llega a AA sin encender de más la barra. */
  color: var(--lh-text-body);
  transition: color .15s, background-color .15s, border-color .15s;
}
.nav-btn:hover { color: var(--lh-text); background: rgba(20, 233, 200, 0.08); }
.nav-btn.active { color: var(--lh-teal); border-color: rgba(20, 233, 200, 0.35); background: rgba(20, 233, 200, 0.08); }
.nav-btn .nv-badge {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  display: inline-grid; place-items: center;
  font-family: var(--lh-mono); font-size: 0.62rem; font-weight: 600;
  background: rgba(255, 183, 77, 0.18); color: var(--lh-warning);
  border: 1px solid rgba(255, 183, 77, 0.4);
}
.nav-btn.primary {
  color: #07120a; font-weight: 600;
  background: linear-gradient(180deg, #8dff66 0%, var(--lh-primary) 100%);
  box-shadow: 0 0 0 1px rgba(124, 255, 77, 0.45), 0 0 20px -6px var(--lh-glow-primary);
}
.nav-btn.primary:hover { filter: brightness(1.08); color: #07120a; }

/* 64rem (1024 px) fijos dejaban media pantalla vacía en un monitor de 24"
   (1920 px), y el carril de servicios más la bandeja competían por el mismo
   ancho angosto. Ahora crece con la ventana hasta 100rem y respira más a los
   lados, sin dejar que las líneas de texto se vuelvan incómodas de leer: los
   bloques de prosa siguen acotados por su propio contenedor. */
main.wrap {
  width: 100%;
  max-width: min(100rem, calc(100vw - 3rem));
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
/* El hilo de un ticket es lectura sostenida: por encima de cierto ancho las
   líneas se vuelven difíciles de seguir, así que ahí sí se pone un techo. */
.thread-scroll { max-width: 62rem; }

/* ── Componentes base ────────────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--lh-card-2) 0%, var(--lh-card) 100%);
  border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-lg);
  box-shadow: inset 0 0 0 1px rgba(20, 233, 200, 0.05), 0 12px 40px -18px rgba(0, 0, 0, 0.6);
}
.card.accent { position: relative; overflow: hidden; }
.card.accent::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--lh-primary) 30%, var(--lh-teal) 70%, transparent);
  opacity: 0.9;
}
.pad { padding: 1.25rem 1.4rem; }

h1, h2, h3 { color: var(--lh-text); margin: 0; }
.sec-label {
  font-family: var(--lh-mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--lh-text-3);
  margin: 1.6rem 0 0.6rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font-weight: 600; font-size: 0.9rem; cursor: pointer;
  border-radius: var(--lh-radius-md); padding: 0.6rem 1rem;
  /* Borde TRANSPARENTE en vez de `none`: .btn-ghost y .btn-warn sí llevan
     borde, así que sin esto los botones de una misma fila (Ejecutada / Diferir
     / Aceptar el riesgo) quedaban con 2px de diferencia de altura y los radios
     no coincidían. Reservar la caja del borde para todos los iguala. */
  border: 1px solid transparent;
  min-height: 2.25rem;
  line-height: 1.2;
  transition: filter .15s, box-shadow .15s, transform .05s, border-color .15s, color .15s, background-color .15s;
}
/* El SVG es inline y arrastra el line-height del texto: sin esto la flecha de
   "Enviar" queda un par de píxeles por debajo del centro óptico del botón. */
.btn .ic { flex: none; display: block; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  /* Texto MUY oscuro sobre el verde de marca: el verde es claro (#7CFF4D), así
     que texto blanco encima daría ~1.6:1 y reprobaría WCAG AA. Con este tono el
     contraste queda sobre 12:1. `-webkit-text-fill-color` blinda el caso de un
     `color` heredado que pinte el texto de blanco igual. */
  color: #041007;
  -webkit-text-fill-color: #041007;
  background: linear-gradient(180deg, #8dff66 0%, var(--lh-primary) 100%);
  box-shadow: 0 0 0 1px rgba(124, 255, 77, 0.45), 0 0 24px -6px var(--lh-glow-primary);
  letter-spacing: 0.02em;
}
.btn-primary .ic { stroke: #041007; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { filter: saturate(0.4) brightness(0.7); cursor: wait; }
.btn-ghost { color: var(--lh-text-2); background: transparent; border: 1px solid var(--lh-border); }
.btn-ghost:hover { border-color: rgba(20, 233, 200, 0.5); color: var(--lh-text); }
.btn-warn {
  color: var(--lh-warning); background: rgba(255, 183, 77, 0.1);
  border: 1px solid rgba(255, 183, 77, 0.4);
}
.btn-warn:hover { background: rgba(255, 183, 77, 0.18); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }

label.fld { display: block; margin: 0.9rem 0 0.35rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--lh-text-2); }
.input, textarea.input, select.input {
  width: 100%; padding: 0.62rem 0.8rem;
  font-family: var(--lh-font); font-size: 0.95rem; color: var(--lh-text);
  background: rgba(10, 20, 40, 0.75);
  border: 1px solid var(--lh-border); border-radius: var(--lh-radius-md);
  outline: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--lh-text-3); }
.input:focus { border-color: rgba(20, 233, 200, 0.65); box-shadow: 0 0 0 3px rgba(20, 233, 200, 0.14), 0 0 16px -4px var(--lh-glow-teal); }
.input[aria-invalid="true"] { border-color: rgba(255, 77, 110, 0.65); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(255, 77, 110, 0.14); }
select.input {
  -webkit-appearance: none; appearance: none;
  background-color: #0d1b33; color: var(--lh-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3B8D9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 14px;
  padding-right: 2.2rem;
}
select.input option { background: #0d1b33; color: var(--lh-text); }
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0d1b33 inset;
  -webkit-text-fill-color: var(--lh-text);
  caret-color: var(--lh-text);
  transition: background-color 9999s ease-in-out 0s;
}

.err-msg { margin-top: 0.5rem; font-size: 0.82rem; color: var(--lh-danger); }

/* alertas con tinte semántico (patrón del tema KC) */
.alert {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.7rem 0.85rem; margin: 0.8rem 0;
  border-radius: var(--lh-radius-md); font-size: 0.85rem;
  border: 1px solid var(--lh-border); background: rgba(10, 20, 40, 0.6); color: var(--lh-text-2);
}
.alert.ok { border-color: rgba(124, 255, 77, 0.35); background: rgba(124, 255, 77, 0.08); color: #c2ffa8; }
.alert.error { border-color: rgba(255, 77, 110, 0.4); background: rgba(255, 77, 110, 0.09); color: #ffb3c2; }
.alert.info { border-color: rgba(111, 168, 255, 0.4); background: rgba(111, 168, 255, 0.09); color: #bcd6ff; }

/* ── Badges de estado (semánticos de marca) ──────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.16rem 0.55rem; border-radius: 999px;
  font-family: var(--lh-mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid;
}
.st-ABIERTO           { color: var(--lh-blue);    background: rgba(111,168,255,.1);  border-color: rgba(111,168,255,.4); }
.st-EN_ATENCION       { color: var(--lh-teal);    background: rgba(20,233,200,.08);  border-color: rgba(20,233,200,.4); }
.st-ESPERANDO_CLIENTE { color: var(--lh-warning); background: rgba(255,183,77,.1);   border-color: rgba(255,183,77,.4); }
.st-RESUELTO          { color: var(--lh-primary); background: rgba(124,255,77,.08);  border-color: rgba(124,255,77,.35); }
.st-REABIERTO         { color: #ff8fa5;           background: rgba(255,77,110,.1);   border-color: rgba(255,77,110,.35); }
.st-CERRADO           { color: var(--lh-text-3);  background: rgba(95,115,150,.1);   border-color: rgba(95,115,150,.35); }

.prio { font-family: var(--lh-mono); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; padding: 0.1rem 0.4rem; border-radius: 0.3rem; border: 1px solid; }
.prio-URGENT { color: #ff8fa5; border-color: rgba(255,77,110,.5); background: rgba(255,77,110,.12); }
/* "Alta" tenía el naranja de advertencia pero con un borde muy tenue, así que
   junto a la insignia de estado se leía como un chip gris más. Con el borde y
   el fondo firmes la criticidad se distingue de un vistazo. */
.prio-HIGH   { color: #ffcf8a; border-color: rgba(255,183,77,.75); background: rgba(255,183,77,.2); font-weight: 700; }
.prio-MEDIUM { color: var(--lh-text-2); border-color: var(--lh-border); background: transparent; }
.prio-LOW    { color: var(--lh-text-3); border-color: var(--lh-border); background: transparent; }

.chip-actions {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 600; color: var(--lh-warning);
  background: rgba(255,183,77,.12); border: 1px solid rgba(255,183,77,.4);
  border-radius: 999px; padding: 0.14rem 0.55rem;
}

/* Responsable del lado cliente (mig 214): chip en la bandeja y barra en el detalle. */
.chip-assignee {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 600; color: var(--lh-text-2);
  border: 1px solid var(--lh-border); border-radius: 999px; padding: 0.14rem 0.55rem;
  max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.assignee-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.5rem 1.1rem; border-bottom: 1px solid var(--lh-border);
  font-size: 0.85rem; color: var(--lh-text-body);
}
.assignee-bar select.input { width: auto; max-width: 100%; padding: 0.35rem 0.6rem; font-size: 0.82rem; }
.assignee-msg { font-size: 0.78rem; color: var(--lh-text-3); }

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; }
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-shield {
  width: 52px; height: 52px; margin: 0 auto 0.9rem; border-radius: var(--lh-radius-lg);
  display: grid; place-items: center;
  background: rgba(124, 255, 77, 0.12); border: 1px solid rgba(124, 255, 77, 0.25);
  box-shadow: 0 0 32px -6px var(--lh-glow-primary); color: var(--lh-primary);
}
.login-shield svg.ic { width: 26px; height: 26px; }
.login-shield img { max-width: 40px; max-height: 40px; object-fit: contain; }
.login-title { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.01em; color: var(--lh-text); }
.login-tag {
  margin-top: 0.45rem; font-family: var(--lh-mono); font-size: 0.65rem; font-weight: 500;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--lh-text-2);
}
.login-card { width: 100%; max-width: 420px; padding: 1.9rem 2rem 2rem; }
.login-sub { font-size: 0.85rem; color: var(--lh-text-2); text-align: center; margin: 0 0 0.4rem; }
.login-page .console-line {
  margin-top: 1.25rem; font-family: var(--lh-mono); font-size: 0.625rem;
  letter-spacing: 0.18em; color: var(--lh-text-3);
}
details.org-alt { margin: 0.7rem 0 0.2rem; }
details.org-alt summary { cursor: pointer; font-size: 0.75rem; color: var(--lh-text-3); }

/* ── Home ────────────────────────────────────────────────────────────────── */
.hero { padding: 2.2rem 1.5rem; text-align: center; }
.hero h1 { font-size: 1.5rem; }
.hero p { color: var(--lh-text-2); font-size: 0.9rem; margin: 0.35rem 0 1.1rem; }
.hero-search { display: flex; gap: 0.5rem; max-width: 34rem; margin: 0 auto; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-top: 1rem; }
.stat { padding: 0.95rem 1.1rem; cursor: pointer; border: 1px solid var(--lh-border); background: linear-gradient(180deg, var(--lh-card-2), var(--lh-card)); border-radius: var(--lh-radius-lg); text-align: left; transition: border-color .15s; }
.stat:hover { border-color: rgba(20, 233, 200, 0.45); }
.stat b { display: block; font-family: var(--lh-mono); font-size: 1.7rem; font-weight: 600; color: var(--lh-text); }
.stat.warn b { color: var(--lh-warning); }
.stat.teal b { color: var(--lh-teal); }
.stat span { font-size: 0.75rem; color: var(--lh-text-2); }

.cat-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  border: 1px solid var(--lh-border); border-radius: 999px; padding: 0.35rem 0.8rem;
  background: rgba(15, 31, 58, 0.6); color: var(--lh-text-2); font-size: 0.82rem;
  transition: border-color .15s, color .15s;
}
.cat-chip:hover { border-color: rgba(20, 233, 200, 0.5); color: var(--lh-text); }
.cat-chip .n { font-family: var(--lh-mono); font-size: 0.68rem; color: var(--lh-text-3); }

.art-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.art-card { padding: 1rem 1.1rem; cursor: pointer; text-align: left; border: 1px solid var(--lh-border); background: linear-gradient(180deg, var(--lh-card-2), var(--lh-card)); border-radius: var(--lh-radius-lg); transition: border-color .15s, box-shadow .15s; }
.art-card:hover { border-color: rgba(20, 233, 200, 0.5); box-shadow: 0 0 24px -10px var(--lh-glow-teal); }
.art-card .cat { font-family: var(--lh-mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lh-text-3); }
.art-card .ttl { display: block; margin-top: 0.3rem; font-weight: 600; color: var(--lh-text); font-size: 0.92rem; }
.art-card .exc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0.3rem; font-size: 0.8rem; color: var(--lh-text-2); }

.cta-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cta-row .t { font-weight: 600; color: var(--lh-text); }
.cta-row .s { font-size: 0.82rem; color: var(--lh-text-2); }

.empty {
  border: 1px dashed var(--lh-border); border-radius: var(--lh-radius-lg);
  padding: 2.2rem 1rem; text-align: center; font-size: 0.85rem; color: var(--lh-text-3);
}

/* ── Mis tickets (bandeja) ───────────────────────────────────────────────── */
.tk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--lh-text-2);
  border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.82rem; font-weight: 500;
  transition: color .15s, border-color .15s, background-color .15s;
}
.tab:hover { color: var(--lh-text); }
.tab.active { color: var(--lh-teal); border-color: rgba(20, 233, 200, 0.4); background: rgba(20, 233, 200, 0.08); }
.tab.attention.active { color: var(--lh-warning); border-color: rgba(255, 183, 77, 0.45); background: rgba(255, 183, 77, 0.08); }
.tab .n { font-family: var(--lh-mono); font-size: 0.66rem; color: var(--lh-text-3); }
.tab.attention .n { color: var(--lh-warning); }
/* Mejora #5 — punto de color por estado en cada tab (mismo idioma que el riel) */
.tab .tab-dot { flex: none; width: 7px; height: 7px; border-radius: 999px; background: var(--lh-text-3); }
.tab.t-atencion  .tab-dot { background: var(--lh-warning); }
.tab.t-abiertos  .tab-dot { background: var(--lh-blue); }
.tab.t-resueltos .tab-dot { background: var(--lh-primary); }
.tab.t-cerrados  .tab-dot { background: rgba(95, 115, 150, 0.7); }
.tab.t-todos     .tab-dot { background: var(--lh-teal); }
.tab.status-link .tab-dot { display: none; }
/* "Estado de la plataforma": no filtra la cola, abre /estado en otra pestaña.
   Se separa de los tabs de filtro (a la derecha) y usa el acento de marca. */
.tab.status-link { margin-left: auto; color: var(--lh-teal); border-color: rgba(20, 233, 200, 0.28); }
.tab.status-link:hover { border-color: rgba(20, 233, 200, 0.5); background: rgba(20, 233, 200, 0.08); }

.tk-controls { display: flex; gap: 0.5rem; align-items: center; }
.tk-controls .input { width: 13rem; padding: 0.42rem 0.7rem; font-size: 0.85rem; }
.tk-controls select.input { width: auto; }

.tk-list { margin-top: 0.9rem; overflow: hidden; }
.tk-row {
  position: relative;
  display: flex; gap: 0.8rem; align-items: flex-start; width: 100%;
  text-align: left; cursor: pointer; background: transparent; border: none;
  padding: 0.85rem 1.1rem 0.85rem 1.25rem; border-bottom: 1px solid var(--lh-border);
  transition: background-color .12s;
}
.tk-row:last-child { border-bottom: none; }
.tk-row:hover { background: rgba(20, 233, 200, 0.05); }
/* Mejora #1 — riel de color lateral por estado (scaneo vertical instantáneo) */
.tk-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--tk-rail, transparent);
}
.tk-row.st-ABIERTO           { --tk-rail: var(--lh-blue); }
.tk-row.st-EN_ATENCION       { --tk-rail: var(--lh-teal); }
.tk-row.st-ESPERANDO_CLIENTE { --tk-rail: var(--lh-warning); }
.tk-row.st-RESUELTO          { --tk-rail: var(--lh-primary); }
.tk-row.st-REABIERTO         { --tk-rail: #ff8fa5; }
.tk-row.st-CERRADO           { --tk-rail: rgba(95, 115, 150, 0.5); }
.tk-row.waiting              { --tk-rail: var(--lh-warning); }
.tk-row.waiting::before      { width: 4px; box-shadow: 0 0 10px -3px var(--lh-warning); }

/* Mejora #2 — avatar del último autor (coherente con los avatares del hilo) */
.tk-av {
  position: relative; flex: none; width: 30px; height: 30px; margin-top: 1px;
  border-radius: 999px; display: grid; place-items: center;
  font-size: 0.62rem; font-weight: 600;
}
.tk-av.soc    { background: rgba(124, 255, 77, 0.12); color: var(--lh-primary); border: 1px solid rgba(124, 255, 77, 0.28); }
.tk-av.client { background: rgba(20, 233, 200, 0.14); color: var(--lh-teal);    border: 1px solid rgba(20, 233, 200, 0.3); }
.tk-av.sys, .tk-av.none { background: rgba(95, 115, 150, 0.12); color: var(--lh-text-3); border: 1px solid var(--lh-border); }
.tk-av .ic { width: 15px; height: 15px; }
.tk-row.unread .tk-av::after {
  content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px;
  border-radius: 999px; background: var(--lh-teal);
  border: 2px solid var(--lh-card); box-shadow: 0 0 6px var(--lh-glow-teal);
}
.tk-main { min-width: 0; flex: 1; }
.tk-subj { font-size: 0.92rem; font-weight: 500; color: var(--lh-text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-row.unread .tk-subj { font-weight: 700; color: var(--lh-text); }
.tk-meta { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.25rem; font-size: 0.74rem; color: var(--lh-text-2); flex-wrap: wrap; }
/* Igual que en la cabecera del ticket: el código es el dato que el cliente
   cita, así que se lee sin forzar la vista. */
.tk-meta .ref { font-family: var(--lh-mono); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em; color: var(--lh-text-2); }
.tk-last { margin-top: 0.25rem; font-size: 0.8rem; color: var(--lh-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-last b { font-weight: 600; color: var(--lh-text-2); }
.tk-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.tk-when { font-family: var(--lh-mono); font-size: 0.68rem; color: var(--lh-text-3); }
.unread-pill {
  font-family: var(--lh-mono); font-size: 0.62rem; font-weight: 600;
  color: #04211d; background: var(--lh-teal); border-radius: 999px; padding: 0.08rem 0.42rem;
}
/* Mejora #3 — antigüedad de la espera (ámbar → rojo cuando lleva ≥48h) */
.tk-age {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-family: var(--lh-mono); font-size: 0.6rem; font-weight: 600;
  border-radius: 999px; padding: 0.1rem 0.45rem;
  color: var(--lh-warning); border: 1px solid rgba(255, 183, 77, 0.4); background: rgba(255, 183, 77, 0.1);
}
.tk-age.stale { color: #ff8fa5; border-color: rgba(255, 77, 110, 0.5); background: rgba(255, 77, 110, 0.12); }
.tk-age .ic { width: 12px; height: 12px; }

/* Mejora #5 — encabezados de grupo temporal en la lista */
.tk-group {
  padding: 0.5rem 1.1rem 0.3rem;
  font-family: var(--lh-mono); font-size: 0.58rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--lh-text-3);
  background: rgba(10, 20, 40, 0.35); border-bottom: 1px solid var(--lh-border);
}

/* Mejora #4 — esqueleto de carga (shimmer; se anula con reduced-motion) */
.sk-row {
  height: 58px; border-bottom: 1px solid var(--lh-border);
  background-image: linear-gradient(90deg, rgba(20, 233, 200, 0.03) 25%, rgba(20, 233, 200, 0.09) 50%, rgba(20, 233, 200, 0.03) 75%);
  background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite;
}
.sk-row:last-child { border-bottom: none; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── Detalle de ticket ───────────────────────────────────────────────────── */
/* 1rem dejaba la tarjeta del ticket pegada al panel lateral. 1.4rem separa los
   dos bloques sin que el hilo pierda ancho útil de lectura. */
.ticket-layout { display: flex; gap: 1.4rem; align-items: flex-start; }
.side { width: 15rem; flex: none; display: flex; flex-direction: column; gap: 0.9rem; }
.side .card { padding: 0.8rem 0.9rem; }
.side-clock { text-align: center; }
/* 1.45rem competía con los títulos de los paneles: la hora es contexto, no un
   encabezado. Baja a 1.15rem y pierde algo de peso visual. */
.side-clock b { display: block; font-family: var(--lh-mono); font-size: 1.15rem; font-weight: 600; color: var(--lh-text-body); font-variant-numeric: tabular-nums; }
.side-clock span { font-size: 0.68rem; color: var(--lh-text-3); text-transform: capitalize; }
.side-label { font-family: var(--lh-mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lh-text-3); margin-bottom: 0.5rem; }
.hist-item {
  display: flex; align-items: center; gap: 0.45rem; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  border-radius: var(--lh-radius-md); padding: 0.35rem 0.45rem;
}
.hist-item:hover { background: rgba(20, 233, 200, 0.07); }
.hist-item.active { background: rgba(20, 233, 200, 0.1); box-shadow: inset 0 0 0 1px rgba(20, 233, 200, 0.3); }
.hist-item .d { flex: none; width: 7px; height: 7px; border-radius: 999px; }
.hist-item .t { min-width: 0; flex: 1; }
.hist-item .s { display: block; font-size: 0.75rem; color: var(--lh-text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 0.58rem en --lh-text-3 era ilegible: es el código del ticket, el dato por el
   que el cliente reconoce la fila. */
.hist-item .w { display: block; font-family: var(--lh-mono); font-size: 0.68rem; letter-spacing: 0.02em; color: var(--lh-text-2); }
.hist-scroll { max-height: 15rem; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
/* Aire entre el buscador de la base de conocimiento y el bloque de arriba. */
.side-kb { display: flex; gap: 0.35rem; margin-top: 0.4rem; }
.side-kb .input { padding: 0.4rem 0.6rem; font-size: 0.78rem; min-width: 0; }
.qr-btn {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid var(--lh-border); color: var(--lh-text-2);
  border-radius: var(--lh-radius-md); padding: 0.4rem 0.55rem; font-size: 0.72rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 0.3rem; transition: border-color .15s, color .15s;
}
.qr-btn:hover { border-color: rgba(20, 233, 200, 0.5); color: var(--lh-text); }

.channel { flex: 1; min-width: 0; display: flex; flex-direction: column; height: calc(100dvh - 10.5rem); }
/* flex-start + el mismo padding arriba alinea el título con el indicador de
   estado de la izquierda; con `center` el bloque ref+título quedaba corrido. */
.ch-head { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--lh-border); }
/* El identificador del ticket es lo que el cliente cita al escribirnos: tiene
   que resaltar sobre el asunto, no esconderse debajo. */
.ch-head .ref {
  font-family: var(--lh-mono); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.04em; color: var(--lh-teal); display: block; margin-bottom: 0.12rem;
}
.ch-head h1 { font-size: 0.95rem; font-weight: 500; color: var(--lh-text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-badges { display: flex; align-items: center; gap: 0.4rem; padding-top: 0.15rem; }
.ch-title { min-width: 0; flex: 1; }
.ch-badges { display: flex; align-items: center; gap: 0.4rem; flex: none; }

/* timeline de hitos del ciclo de vida */
.tl { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1.1rem; border-bottom: 1px solid var(--lh-border); overflow-x: auto; }
/* El hito PENDIENTE ("1ª respuesta · en espera del SOC", "Resuelto · pendiente")
   usaba --lh-text-3 (#5f7396), que sobre la tarjeta oscura ronda 3:1 y se lee
   con esfuerzo. Es información de estado, no un hint decorativo: sube a
   --lh-text-2 y crece un punto. */
.tl-step { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--lh-mono); font-size: 0.7rem; color: var(--lh-text-2); white-space: nowrap; }
.tl-step .d { width: 7px; height: 7px; border-radius: 999px; background: var(--lh-border); }
.tl-step.done { color: var(--lh-text-body); }
/* `.muted` global es demasiado tenue acá: lo que rotula es el estado real. */
.tl-step .muted { color: var(--lh-warning); font-style: normal; }
.tl-step.done .d { background: var(--lh-primary); box-shadow: 0 0 6px var(--lh-glow-primary); }
.tl-sep { flex: none; width: 1.4rem; height: 1px; background: var(--lh-border); }

.thread-scroll { flex: 1; overflow-y: auto; padding: 0.9rem 0.9rem; }
.msg-row { display: flex; align-items: flex-start; gap: 0.65rem; border-radius: var(--lh-radius-md); padding: 0.45rem 0.5rem; }
.msg-row:hover { background: rgba(20, 233, 200, 0.04); }
.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center; font-size: 0.66rem; font-weight: 600;
}
.avatar.client { background: rgba(20, 233, 200, 0.14); color: var(--lh-teal); border: 1px solid rgba(20, 233, 200, 0.3); }
.avatar.soc { background: rgba(124, 255, 77, 0.12); color: var(--lh-primary); border: 1px solid rgba(124, 255, 77, 0.28); }
.msg-body { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 0.5rem; }
.msg-head .who { font-size: 0.84rem; font-weight: 600; color: var(--lh-text); }
.msg-head .who.client { color: var(--lh-teal); }
.msg-head .when { font-family: var(--lh-mono); font-size: 0.64rem; color: var(--lh-text-3); }
.msg-text { margin-top: 0.15rem; font-size: 0.88rem; line-height: 1.5; color: var(--lh-text-body); white-space: pre-wrap; word-break: break-word; }
.msg-row.pending { opacity: 0.55; }
.sys-row { display: flex; justify-content: center; padding: 0.3rem 0; }
.sys-pill {
  font-family: var(--lh-mono); font-size: 0.64rem; color: var(--lh-text-3);
  background: rgba(15, 31, 58, 0.8); border: 1px solid var(--lh-border);
  border-radius: 999px; padding: 0.22rem 0.75rem; text-align: center;
}
.msg-attach-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.doc-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer;
  font-size: 0.72rem; font-weight: 600; color: var(--lh-teal);
  background: rgba(20, 233, 200, 0.07); border: 1px solid rgba(20, 233, 200, 0.35);
  border-radius: var(--lh-radius-md); padding: 0.3rem 0.6rem;
}
.doc-btn:hover { background: rgba(20, 233, 200, 0.14); }
.doc-btn.pb { color: var(--lh-primary); border-color: rgba(124, 255, 77, 0.35); background: rgba(124, 255, 77, 0.07); }
.doc-btn.pb:hover { background: rgba(124, 255, 77, 0.13); }

/* composer */
.composer-wrap { border-top: 1px solid var(--lh-border); padding: 0.7rem 0.9rem; }
.composer {
  display: flex; align-items: flex-end; gap: 0.5rem;
  background: rgba(10, 20, 40, 0.75); border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-lg); padding: 0.45rem 0.45rem 0.45rem 0.8rem;
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: rgba(20, 233, 200, 0.6); box-shadow: 0 0 0 3px rgba(20, 233, 200, 0.12); }
.composer textarea {
  /* 2.1rem parecía un campo de una línea y desalentaba escribir. 3.6rem da la
     sensación de caja de redacción sin robarle alto al hilo de mensajes; sigue
     creciendo sola hasta el máximo. */
  flex: 1; min-height: 3.6rem; max-height: 10rem; resize: none;
  background: transparent; border: none; outline: none;
  font-family: var(--lh-font); font-size: 0.9rem; color: var(--lh-text);
  padding: 0.35rem 0;
}
.composer textarea::placeholder { color: var(--lh-text-3); }
.closed-note {
  border: 1px dashed var(--lh-border); border-radius: var(--lh-radius-md);
  padding: 0.7rem; text-align: center; font-size: 0.78rem; color: var(--lh-text-3);
}

/* ── Acciones solicitadas ────────────────────────────────────────────────── */
.ar-card { padding: 1rem 1.1rem; margin-bottom: 0.7rem; }
.ar-head { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.ar-ico {
  flex: none; width: 30px; height: 30px; border-radius: var(--lh-radius-md);
  display: grid; place-items: center;
  background: rgba(20, 233, 200, 0.1); color: var(--lh-teal); border: 1px solid rgba(20, 233, 200, 0.3);
}
.ar-type { font-weight: 600; color: var(--lh-text); font-size: 0.9rem; }
.ar-urg { font-family: var(--lh-mono); font-size: 0.6rem; font-weight: 600; color: #ff8fa5; background: rgba(255,77,110,.1); border: 1px solid rgba(255,77,110,.35); border-radius: 999px; padding: 0.1rem 0.45rem; }
.ar-badge { margin-left: auto; }
.ar-title { margin-top: 0.6rem; font-size: 0.88rem; font-weight: 600; color: var(--lh-text-body); }
.ar-rationale { margin-top: 0.15rem; font-size: 0.84rem; color: var(--lh-text-2); line-height: 1.5; }
.ar-note { margin-top: 0.55rem; font-size: 0.78rem; color: var(--lh-text-3); }
.ar-risknote { margin-top: 0.55rem; font-size: 0.78rem; color: #ffd9a3; background: rgba(255,183,77,.09); border: 1px solid rgba(255,183,77,.3); border-radius: var(--lh-radius-md); padding: 0.45rem 0.6rem; }
.ar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }

.chk {
  margin-top: 0.7rem; border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-md); background: rgba(10, 20, 40, 0.5); padding: 0.7rem 0.85rem;
}
.chk ul { list-style: none; margin: 0.45rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.chk li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.82rem; color: var(--lh-text-body); }
.chk li.done span { text-decoration: line-through; color: var(--lh-text-3); }
.chk input[type="checkbox"] { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--lh-primary); cursor: pointer; }
.chk-progress { font-family: var(--lh-mono); font-size: 0.6rem; color: var(--lh-text-3); float: right; }

.inline-form {
  margin-top: 0.6rem; border: 1px solid rgba(255, 183, 77, 0.35);
  background: rgba(255, 183, 77, 0.06); border-radius: var(--lh-radius-md); padding: 0.75rem 0.85rem;
}
.inline-form p { margin: 0 0 0.5rem; font-size: 0.78rem; font-weight: 600; color: #ffd9a3; }
.inline-form .input { margin-bottom: 0.45rem; font-size: 0.85rem; padding: 0.5rem 0.65rem; }
.inline-form .row-end { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* CSAT */
.csat { padding: 0.9rem 1rem; margin-top: 0.8rem; }
.csat .stars { display: flex; gap: 0.2rem; margin: 0.5rem 0; }
.csat .stars button { background: none; border: none; cursor: pointer; font-size: 1.5rem; color: var(--lh-text-3); padding: 0.1rem; }
.csat .stars button.on { color: var(--lh-warning); }

/* ── KB / artículo ───────────────────────────────────────────────────────── */
.back-link { display: inline-flex; align-items: center; gap: 0.3rem; background: none; border: none; cursor: pointer; color: var(--lh-teal); font-size: 0.82rem; padding: 0; margin-bottom: 0.9rem; }
.back-link:hover { color: var(--lh-primary); }
.kb-prose { margin-top: 1rem; color: var(--lh-text-body); line-height: 1.65; font-size: 0.94rem; }
.kb-prose h1 { font-size: 1.35rem; margin: 1rem 0 0.5rem; }
.kb-prose h2 { font-size: 1.12rem; margin: 1rem 0 0.4rem; }
.kb-prose h3 { font-size: 1rem; margin: 0.8rem 0 0.3rem; }
.kb-prose p { margin: 0.5rem 0; }
.kb-prose ul, .kb-prose ol { margin: 0.5rem 0 0.5rem 1.25rem; padding: 0; }
.kb-prose li { margin: 0.2rem 0; }
.kb-prose code { font-family: var(--lh-mono); font-size: 0.82em; background: rgba(20, 233, 200, 0.08); border: 1px solid rgba(20, 233, 200, 0.18); border-radius: 4px; padding: 1px 5px; color: var(--lh-teal); }
.kb-prose table { border-collapse: collapse; margin: 0.6rem 0; width: 100%; }
.kb-prose th, .kb-prose td { border: 1px solid var(--lh-border); padding: 6px 10px; text-align: left; font-size: 0.88em; }
.kb-prose hr { margin: 1rem 0; border: none; border-top: 1px solid var(--lh-border); }
.kb-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 1rem; }
.kb-tag { font-family: var(--lh-mono); font-size: 0.66rem; color: var(--lh-text-3); background: rgba(95,115,150,.12); border-radius: 999px; padding: 0.15rem 0.55rem; }
.kb-feedback { margin-top: 1.4rem; padding: 0.9rem; text-align: center; border: 1px solid var(--lh-border); border-radius: var(--lh-radius-md); background: rgba(10, 20, 40, 0.5); }

/* ── Integraciones ───────────────────────────────────────────────────────── */
pre.code {
  overflow-x: auto; margin: 0.7rem 0 0;
  background: #060d1d; border: 1px solid var(--lh-border);
  border-radius: var(--lh-radius-md); padding: 0.9rem 1rem;
  font-family: var(--lh-mono); font-size: 0.74rem; line-height: 1.6; color: #c9d8f0;
}

/* ── Modal de documentos (informe / playbook) ────────────────────────────── */
.doc-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(4, 9, 20, 0.75); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.doc-box {
  width: min(900px, 100%); height: min(85dvh, 100%);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--lh-card); border: 1px solid var(--lh-border); border-radius: var(--lh-radius-lg);
}
.doc-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--lh-border); }
.doc-bar .t { font-size: 0.85rem; font-weight: 600; color: var(--lh-text); }
.doc-box iframe { flex: 1; border: 0; width: 100%; background: #fff; }

/* ── Pasada de accesibilidad y UI del portal (2026-08-04) ────────────────── */

/* Comandos y valores técnicos dentro de texto corrido ("buscar lateral
   movement", "SLA: 1h"). Sin tratamiento propio se confundían con la prosa y el
   cliente no sabía qué parte tenía que copiar literalmente. */
code, .cmd {
  font-family: var(--lh-mono); font-size: 0.86em;
  background: rgba(20, 233, 200, 0.08);
  border: 1px solid rgba(20, 233, 200, 0.22);
  border-radius: 0.3rem; padding: 0.06rem 0.34rem;
  color: var(--lh-teal); white-space: nowrap;
}

/* Estado vacío: tenue y en cursiva para que se lea como "acá no hay nada
   todavía" y no como un aviso del sistema. */
.empty-state {
  color: var(--lh-text-3); font-style: italic; font-size: 0.82rem;
  padding: 1.1rem 0.5rem; text-align: center;
}

/* Hover del historial y del hilo: realimentación de que la fila es pulsable. */
.hist-item { transition: background-color .13s; }
.msg-row { transition: background-color .13s; }
.msg-row:hover { background: rgba(20, 233, 200, 0.06); }

/* Barra de desplazamiento discreta. Sin esto las listas laterales muestran la
   barra nativa del sistema, mucho más ancha y clara que el resto del panel. */
.hist-scroll, .thread-scroll, .side, .tk-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(163, 184, 217, 0.28) transparent;
}
.hist-scroll::-webkit-scrollbar,
.thread-scroll::-webkit-scrollbar,
.tk-list::-webkit-scrollbar { width: 8px; height: 8px; }
.hist-scroll::-webkit-scrollbar-track,
.thread-scroll::-webkit-scrollbar-track,
.tk-list::-webkit-scrollbar-track { background: transparent; }
.hist-scroll::-webkit-scrollbar-thumb,
.thread-scroll::-webkit-scrollbar-thumb,
.tk-list::-webkit-scrollbar-thumb {
  background: rgba(163, 184, 217, 0.24); border-radius: 999px;
  border: 2px solid transparent; background-clip: content-box;
}
.hist-scroll:hover::-webkit-scrollbar-thumb,
.thread-scroll:hover::-webkit-scrollbar-thumb,
.tk-list:hover::-webkit-scrollbar-thumb { background: rgba(163, 184, 217, 0.42); background-clip: content-box; }

/* Bloque de acciones rápidas de la cabecera: separa "Portal de Estado" y
   "Abrir ticket" de la navegación, que es otra cosa. */
.nav-actions {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-left: 0.35rem; padding-left: 0.6rem;
  border-left: 1px solid var(--lh-border);
}

/* ── Calendario de feriados (panel lateral) ──────────────────────────────── */
.hol-card { padding: 0.85rem 0.9rem !important; }
.hol-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.hol-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.28rem 0.3rem; border-radius: var(--lh-radius-md); }
/* El próximo se destaca: es el único que cambia una decisión hoy. */
.hol-row.next { background: rgba(20, 233, 200, 0.07); box-shadow: inset 0 0 0 1px rgba(20, 233, 200, 0.2); }
.hol-date {
  flex: none; width: 2.9rem; text-align: center; line-height: 1.1;
  font-family: var(--lh-mono);
}
.hol-date b { display: block; font-size: 0.76rem; font-weight: 700; color: var(--lh-text); }
.hol-date em { display: block; font-style: normal; font-size: 0.56rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lh-text-3); }
.hol-body { min-width: 0; flex: 1; }
.hol-name { display: block; font-size: 0.77rem; color: var(--lh-text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hol-when { display: block; font-size: 0.64rem; color: var(--lh-text-3); }
.hol-row.next .hol-when { color: var(--lh-teal); }
.hol-note { margin-top: 0.6rem; font-size: 0.64rem; line-height: 1.4; color: var(--lh-text-3); }

/* ── Integraciones: pasos + rejilla de tarjetas ──────────────────────────── */
.ig-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem;
  list-style: none; counter-reset: paso; margin: 1rem 0 0; padding: 0;
}
.ig-steps li {
  counter-increment: paso; position: relative;
  border: 1px solid var(--lh-border); border-radius: var(--lh-radius-md);
  background: rgba(10, 20, 40, 0.5); padding: 0.7rem 0.8rem 0.7rem 2.4rem;
}
.ig-steps li::before {
  content: counter(paso); position: absolute; left: 0.7rem; top: 0.68rem;
  width: 1.15rem; height: 1.15rem; border-radius: 999px;
  display: grid; place-items: center;
  font-family: var(--lh-mono); font-size: 0.66rem; font-weight: 700;
  color: var(--lh-teal); background: rgba(20, 233, 200, 0.12);
  border: 1px solid rgba(20, 233, 200, 0.4);
}
.ig-steps b { display: block; font-size: 0.84rem; color: var(--lh-text); }
.ig-steps span { display: block; margin-top: 0.15rem; font-size: 0.76rem; color: var(--lh-text-2); line-height: 1.45; }

.ig-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1rem; }
.ig-card {
  border: 1px solid var(--lh-border); border-radius: var(--lh-radius-lg);
  background: linear-gradient(160deg, rgba(18, 30, 54, 0.9) 0%, rgba(10, 20, 40, 0.85) 100%);
  padding: 1rem 1.05rem;
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.9);
  transition: border-color .16s, box-shadow .16s;
}
.ig-card:hover { border-color: rgba(20, 233, 200, 0.3); box-shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.95); }
.ig-hd { display: flex; align-items: flex-start; gap: 0.6rem; }
.ig-ico { display: inline-flex; color: var(--lh-teal); padding-top: 0.1rem; }
.ig-ico .ic { width: 18px; height: 18px; }
.ig-hd-t h3 { font-size: 0.95rem; font-weight: 700; color: var(--lh-text); }
.ig-lvl {
  display: inline-block; margin-top: 0.25rem;
  font-family: var(--lh-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.1rem 0.42rem; border-radius: 0.3rem; border: 1px solid;
}
.ig-ok  { color: var(--lh-primary); background: rgba(124,255,77,.1);  border-color: rgba(124,255,77,.35); }
.ig-mid { color: var(--lh-teal);    background: rgba(20,233,200,.1);  border-color: rgba(20,233,200,.35); }
.ig-dev { color: var(--lh-warning); background: rgba(255,183,77,.1);  border-color: rgba(255,183,77,.35); }
.ig-what { margin-top: 0.6rem; font-size: 0.83rem; color: var(--lh-text-body); line-height: 1.5; }

/* Ficha técnica en dos columnas: la etiqueta manda el ancho, el dato respira. */
.ig-facts { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.3rem 0.7rem; margin-top: 0.75rem; }
.ig-facts dt {
  font-family: var(--lh-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--lh-text-3); padding-top: 0.12rem;
}
.ig-facts dd { margin: 0; font-size: 0.79rem; color: var(--lh-text-body); line-height: 1.45; word-break: break-word; }

.ig-ex { margin-top: 0.8rem; border-top: 1px solid var(--lh-border); padding-top: 0.6rem; }
.ig-ex summary {
  cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--lh-teal);
  list-style: none; user-select: none;
}
.ig-ex summary::-webkit-details-marker { display: none; }
.ig-ex summary::before { content: "▸ "; }
.ig-ex[open] summary::before { content: "▾ "; }
.ig-ex .code { margin-top: 0.55rem; }

@media (max-width: 900px) {
  .ig-grid, .ig-steps { grid-template-columns: 1fr; }
  .ig-facts { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .ig-facts dd { margin-bottom: 0.35rem; }
}
@media (min-width: 1500px) {
  .ig-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Panel de confirmación de cierre dentro del ticket ───────────────────── */
.closure-ask {
  margin-top: 0.9rem; border-radius: var(--lh-radius-lg);
  border: 1px solid rgba(124, 255, 77, 0.35);
  background: linear-gradient(160deg, rgba(124, 255, 77, 0.09) 0%, rgba(10, 20, 40, 0.6) 100%);
  padding: 0.9rem 1rem;
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.9);
}
.closure-ask .ca-hd {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.88rem; font-weight: 700; color: var(--lh-primary);
}
.closure-ask .ca-txt { margin-top: 0.35rem; font-size: 0.83rem; color: var(--lh-text-body); line-height: 1.5; }
.closure-ask .ca-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* ── Realce de tickets que esperan una acción ────────────────────────────── */
/* Un ticket que espera al cliente no puede verse igual que uno en curso: si el
   cliente no lo distingue de un vistazo, la espera se alarga sin que nadie lo
   note. El riel de color ya existía; esto agrega peso real a la fila. */
.tk-row.waiting, .tk-row.act-pending {
  background: linear-gradient(90deg, rgba(255, 183, 77, 0.09) 0%, rgba(255, 183, 77, 0) 55%);
}
.tk-row.waiting:hover, .tk-row.act-pending:hover {
  background: linear-gradient(90deg, rgba(255, 183, 77, 0.15) 0%, rgba(255, 183, 77, 0.02) 55%);
}
.tk-row.waiting .tk-subj, .tk-row.act-pending .tk-subj { font-weight: 700; color: var(--lh-text); }
/* Etiqueta explícita: el color solo no dice QUÉ se espera. */
.tk-flag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-family: var(--lh-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.1rem 0.42rem; border-radius: 0.3rem;
  color: #ffcf8a; background: rgba(255, 183, 77, 0.16); border: 1px solid rgba(255, 183, 77, 0.5);
}
.tk-flag.act { color: #ffb3c2; background: rgba(255, 77, 110, 0.14); border-color: rgba(255, 77, 110, 0.5); }

/* Cerrados: se atenúan para que no compitan con lo que sigue vivo. */
.tk-row.st-CERRADO .tk-subj { color: var(--lh-text-2); font-weight: 400; }
.tk-row.st-CERRADO .tk-av { opacity: 0.5; }
.hist-item.closed { opacity: 0.62; }
.hist-item.closed .s { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: rgba(163, 184, 217, 0.45); }
.hist-item.closed:hover { opacity: 1; }

/* ── Tarjetas flotantes de servicios extra (mig 169) ─────────────────────── */
/* Pentesting, talleres y campañas no generan tickets: sin este carril quedaban
   invisibles en un portal organizado alrededor de la bandeja. */
.tk-page { display: flex; gap: 1.4rem; align-items: flex-start; }
.tk-page-main { min-width: 0; flex: 1; }

.svc-rail { width: 15rem; flex: none; display: flex; flex-direction: column; gap: 0.75rem; }
.svc-rail-hd { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.svc-pill {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center;
  font-family: var(--lh-mono); font-size: 0.62rem; font-weight: 700;
  background: rgba(255, 183, 77, 0.18); color: var(--lh-warning);
  border: 1px solid rgba(255, 183, 77, 0.45);
}

.svc-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--lh-border); border-radius: var(--lh-radius-lg);
  background: linear-gradient(160deg, rgba(18, 30, 54, 0.92) 0%, rgba(10, 20, 40, 0.86) 100%);
  padding: 0.85rem 0.9rem;
  /* La sombra es lo que las despega del fondo y les da el aire "flotante". */
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.svc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -14px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  border-color: rgba(20, 233, 200, 0.35);
}
/* Riel de color a la izquierda: el estado se reconoce antes de leer. */
.svc-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--svc-rail-color, var(--lh-border));
}
.svc-todo { --svc-rail-color: var(--lh-text-3); }
.svc-wait { --svc-rail-color: var(--lh-warning); }
.svc-ok   { --svc-rail-color: var(--lh-teal); }
.svc-done { --svc-rail-color: var(--lh-primary); }

.svc-top { display: flex; align-items: center; gap: 0.45rem; }
.svc-ico { display: inline-flex; color: var(--svc-rail-color, var(--lh-text-2)); }
.svc-ico .ic { width: 15px; height: 15px; }
.svc-name { font-size: 0.85rem; font-weight: 600; color: var(--lh-text); }

.svc-state {
  margin-top: 0.5rem; font-family: var(--lh-mono);
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--svc-rail-color, var(--lh-text-2));
}
.svc-detail { margin-top: 0.2rem; font-size: 0.78rem; color: var(--lh-text-body); line-height: 1.4; }
.svc-note { margin-top: 0.35rem; font-size: 0.72rem; color: var(--lh-text-2); font-style: italic; }

.svc-cta {
  margin-top: 0.65rem; width: 100%; cursor: pointer;
  background: rgba(20, 233, 200, 0.07); border: 1px solid rgba(20, 233, 200, 0.28);
  border-radius: var(--lh-radius-md); padding: 0.4rem 0.5rem;
  font-family: var(--lh-font); font-size: 0.76rem; font-weight: 600; color: var(--lh-teal);
  transition: background-color .13s, border-color .13s;
}
.svc-cta:hover { background: rgba(20, 233, 200, 0.14); border-color: rgba(20, 233, 200, 0.5); }

@media (max-width: 900px) {
  .tk-page { flex-direction: column; }
  .svc-rail { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .svc-rail .svc-card { flex: 1 1 13rem; }
  .svc-rail-hd { width: 100%; }
}

/* ── Tabla genérica (repositorio de informes / agenda de servicios) ──────── */
.lh-tbl { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.lh-tbl th {
  text-align: left; font-family: var(--lh-mono); font-size: 0.68rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--lh-text-3);
  font-weight: 600; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--lh-border);
}
.lh-tbl td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--lh-border); vertical-align: top; }
.lh-tbl tbody tr:last-child td { border-bottom: 0; }
.lh-tbl tbody tr:hover { background: rgba(111, 168, 255, 0.04); }
.lh-tbl a.btn { text-decoration: none; }

/* ── Pantallas anchas (24" y más) ────────────────────────────────────────── */
/* Con la página ya ancha, lo que sobra es aire dentro de las grillas: se
   aprovecha metiendo más columnas en vez de estirar tarjetas gigantes. */
@media (min-width: 1500px) {
  .art-grid { grid-template-columns: repeat(3, 1fr); }
  .side, .svc-rail { width: 17rem; }
  .tk-page, .ticket-layout { gap: 1.8rem; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .side { display: none; }
  .channel { height: calc(100dvh - 9.5rem); }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr; }
  .art-grid { grid-template-columns: 1fr; }
  .nav-btn span.lbl { display: none; }
  .tk-controls .input { width: 100%; }
  .tk-toolbar { flex-direction: column; align-items: stretch; }
  .tk-side { display: none; }
}

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

/* ── Modal de cambio de contraseña (2026-08-04) ──────────────────────────────
   Reusa .doc-overlay/.doc-box del modal de documentos, pero con alto por
   CONTENIDO: .doc-box fija min(85dvh) porque ahí adentro va un iframe que
   necesita ocupar todo; acá el formulario mide lo que mide y estirarlo deja un
   hueco vacío enorme. */
.doc-box.pw-box { height: auto; max-height: min(88dvh, 100%); width: min(30rem, 100%); }
.pw-body { padding: 1.1rem; overflow-y: auto; }

/* Medidor de fuerza: guía visual, no política — la que manda es la del
   servidor (validatePassword en portalCredentials.mjs). */
.pw-meter {
  height: 4px; margin-top: .45rem; border-radius: 999px;
  background: var(--lh-border); overflow: hidden;
}
.pw-meter > span {
  display: block; height: 100%; width: 0%;
  transition: width .18s ease, background-color .18s ease;
}
.pw-meter > span.pw-weak   { background: #ef4444; }
.pw-meter > span.pw-ok     { background: #f59e0b; }
.pw-meter > span.pw-strong { background: #10b981; }

.pw-see {
  display: flex; align-items: center; gap: .4rem;
  margin-top: .7rem; font-size: .75rem; color: var(--lh-muted); cursor: pointer;
}
.pw-see input { cursor: pointer; }

/* ── Vigilancia digital: severidades y cabecera por dominio ──────────────── */
.sev {
  display: inline-flex; align-items: center; padding: 0.12rem 0.45rem; border-radius: 0.3rem;
  font-family: var(--lh-mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; white-space: nowrap; border: 1px solid;
}
.sev-critical { color: #ff8fa5;           background: rgba(255,77,110,.14); border-color: rgba(255,77,110,.55); }
.sev-high     { color: #ffcf8a;           background: rgba(255,183,77,.14); border-color: rgba(255,183,77,.55); }
.sev-medium   { color: #ffe58a;           background: rgba(255,229,77,.08); border-color: rgba(255,229,77,.35); }
.sev-low      { color: var(--lh-blue);    background: rgba(111,168,255,.08); border-color: rgba(111,168,255,.35); }
.sev-info     { color: var(--lh-text-3);  background: rgba(95,115,150,.1);  border-color: rgba(95,115,150,.35); }
.vg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.vg-risk { font-family: var(--lh-mono); font-size: 1.6rem; font-weight: 700; line-height: 1.1; background: none; border: 0; padding: 0; }
.vg-group { border-top: 1px solid var(--lh-border); }
.lh-tbl tr.vg-fam td { background: rgba(111,168,255,.05); padding: 0.5rem 0.9rem; font-size: 0.82rem; }
