/* ==========================================================================
   Panel Técnico — soporte, bandeja de tickets y conexión con CODE.
   Solo variables de color del sistema (tokens.css); mezclas con color-mix().
   ========================================================================== */

/* ---------- Piezas pequeñas ---------- */
.tk-pill {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 11px;
  font-weight: 700;
}
.tk-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink-2);
  white-space: nowrap;
}
.tk-num.lg {
  font-size: 12.5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  cursor: copy;
}
.tk-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.tk-cdot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--neutral));
}
.tk-prio svg {
  margin-right: -2px;
}
.tk-sla {
  --c: var(--neutral);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 11%, transparent);
}
.tk-sla.is-ok {
  --c: var(--success);
}
.tk-sla.is-soon {
  --c: var(--warning);
}
.tk-sla.is-breached,
.tk-sla.is-late {
  --c: var(--danger);
}
.tk-sla.is-breached svg {
  animation: tk-tick 1.4s ease-in-out infinite;
}
.tk-sla.is-paused {
  --c: var(--ws-hanil);
}
.tk-sla.is-met {
  --c: var(--success);
  background: transparent;
  padding: 0;
}
@keyframes tk-tick {
  0%,
  100% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(-14deg);
  }
  40% {
    transform: rotate(12deg);
  }
  60% {
    transform: rotate(0);
  }
}
.tk-rated {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ws-hanil);
}
.tk-rated svg {
  fill: currentColor;
}
.tk-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.tk-when {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.tk-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  padding: 0 10px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--success-soft);
}
.tk-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.8s ease-out infinite;
}

/* ---------- Dashboard ---------- */
.tk-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 26px;
  margin-bottom: 18px;
  border-radius: var(--r-xl);
  border: 1px solid var(--accent-line);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--surface)) 0%, var(--surface) 62%);
  box-shadow: var(--shadow-xs);
}
.tk-hero > * {
  position: relative;
  z-index: 1;
}
.tk-hero-glow {
  position: absolute !important;
  z-index: 0 !important;
  right: -80px;
  top: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%);
  pointer-events: none;
}
.tk-hero h2 {
  font-size: var(--fs-2xl);
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.tk-hero p {
  color: var(--ink-2);
  margin-top: 4px;
}
.tk-alert {
  align-items: center;
  text-decoration: none !important;
  color: var(--ink);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.tk-alert:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.tk-status-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tk-sbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none !important;
  transition: background var(--t);
}
.tk-sbar:hover {
  background: var(--surface-2);
}
.tk-sbar .progress {
  margin-top: 6px;
}
.tk-sbar-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  flex-shrink: 0;
}
.tk-qitem {
  position: relative;
  padding-left: 16px !important;
  border-radius: 10px;
  transition: background var(--t);
}
.tk-qitem:hover {
  background: var(--surface-2);
}
.tk-qstripe {
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--c);
}
.tk-stars-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tk-stars-inline svg {
  color: var(--ws-hanil);
  fill: var(--ws-hanil);
}
.tk-sla-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.tk-sla-cell {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tk-sla-cell b {
  font-family: var(--font-display);
  font-size: 17px;
}
.tk-sla-cell small {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.3;
}
.tk-donut-wrap {
  display: grid;
  place-items: center;
}
.tk-cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tk-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none !important;
}
.tk-cat-row:hover {
  background: var(--surface-2);
}
.tk-cat-row i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.tk-code-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--brand-teal);
  background: color-mix(in srgb, var(--brand-teal) 13%, transparent);
}
.tk-bill-big {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-teal) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand-teal) 25%, transparent);
}
.tk-bill-big strong {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.02em;
}
.tk-billing-card .stat-row svg {
  display: inline;
  vertical-align: -2px;
  margin-right: 4px;
  color: var(--ink-3);
}

/* ---------- Bandeja ---------- */
.tk-tabs .n.is-hot {
  background: var(--accent);
  color: var(--accent-contrast);
}
.tk-toolbar .chip i {
  margin-right: 1px;
}
.tk-fsel {
  width: auto;
  max-width: 220px;
  height: 34px;
  font-size: 13px;
  border-radius: 10px;
}
.tk-toolbar .chip .n:empty {
  display: none;
}
.tk-list-card {
  overflow: hidden;
}
.tk-list {
  transition: opacity 0.2s;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 12px 14px;
}
/* Cada ticket es una tarjeta con su barra de prioridad resaltada a la izquierda */
.tk-row {
  --c: var(--neutral);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px 14px 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none !important;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.28s var(--ease-out), transform 0.2s var(--ease-out);
}
/* Tinte de prioridad muy sutil en la banda izquierda */
.tk-row::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 9%, transparent), transparent 140px);
  opacity: 0.7;
  transition: opacity 0.2s;
}
.tk-row:hover {
  border-color: color-mix(in srgb, var(--c) 45%, var(--line));
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--c) 60%, transparent), var(--shadow-sm);
  transform: translateX(2px);
}
.tk-row:hover::after {
  opacity: 1;
}
/* Barra de prioridad: píldora redondeada y resaltada con halo */
.tk-row-stripe {
  position: absolute;
  left: 11px;
  top: 14px;
  bottom: 14px;
  width: 5px;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 14%, transparent), 0 4px 10px -3px var(--c);
  z-index: 1;
}
/* El "sin leer" se comunica con el tinte/borde de la tarjeta y el asunto en negrita; el punto sobra. */
.tk-row-dot {
  display: none;
}
.tk-row.is-unread {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.tk-row.is-unread .tk-row-subject {
  font-weight: 700;
}
.tk-row-main,
.tk-row-meta {
  position: relative;
  z-index: 1;
}
.tk-row.is-fresh {
  animation: tk-fresh 2.6s var(--ease-out) 1;
}
@keyframes tk-fresh {
  0% {
    box-shadow: inset 0 0 0 2px var(--accent-line);
    background: var(--accent-soft);
  }
  100% {
    box-shadow: inset 0 0 0 2px transparent;
  }
}
.tk-row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.tk-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}
.tk-row-top .tk-num {
  margin-left: 4px;
}
.tk-chan {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: var(--ink-3);
  background: var(--surface-3);
}
.tk-row-subject {
  font-size: 14.5px;
  font-weight: 600;
  margin-top: 2px;
}
.tk-row-snippet {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.tk-await {
  color: var(--accent-ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.tk-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.tk-row-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tk-skel {
  pointer-events: none;
}
.tk-skel .avatar {
  background: var(--surface-3);
}
@media (max-width: 860px) {
  .tk-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .tk-row-main {
    flex-basis: calc(100% - 60px);
  }
  .tk-row-meta {
    width: 100%;
    align-items: flex-start;
    padding-left: 48px;
  }
  .tk-row-badges {
    justify-content: flex-start;
  }
  .tk-fsel {
    max-width: 100%;
    flex: 1 1 160px;
  }
}

/* ---------- Detalle del ticket ---------- */
.tk-dhead {
  margin-bottom: 18px;
}
.tk-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.tk-back:hover {
  color: var(--accent-ink);
  text-decoration: none;
}
.tk-dhead-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.tk-subject {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
  margin-top: 10px;
  line-height: 1.2;
}
.tk-subject .icon-btn {
  opacity: 0;
  transition: opacity 0.2s;
}
.tk-subject:hover .icon-btn {
  opacity: 1;
}
.tk-dhead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.tk-dhead-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tk-dhead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tk-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
.tk-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.tk-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.tk-side-card .card-head h3 {
  font-size: 14.5px;
}
.tk-side-card .card-body {
  padding-top: 14px;
}
@media (max-width: 1180px) {
  .tk-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .tk-side {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}
.tk-thread-scroll {
  max-height: min(64vh, 760px);
  overflow-y: auto;
  padding: 16px 20px 22px;
  scroll-behavior: auto;
}
@media (max-width: 760px) {
  .tk-thread-scroll {
    max-height: none;
    padding: 14px;
  }
  .tk-thread-scroll .msg {
    max-width: 100%;
  }
}
.tk-day {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tk-day::before,
.tk-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.msg-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.msg.me .msg-col {
  align-items: flex-end;
}
.tk-thread-scroll .msg-meta b {
  color: var(--ink-2);
  font-weight: 600;
}
.tk-thread-scroll .msg-bubble a {
  word-break: break-all;
}
.tk-thread-scroll .msg.system span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  text-align: center;
  line-height: 1.4;
}
.tk-thread-scroll .msg.system em {
  font-style: normal;
  opacity: 0.7;
  margin-left: 2px;
}
.tk-thread-scroll .msg.system.is-internal span {
  background: var(--warning-soft);
  color: var(--ink-2);
}
.tk-internal-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tk-thumb {
  position: relative;
  display: block;
  width: 168px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.tk-thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tk-thumb img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  display: block;
  background: var(--surface-3);
}
.tk-thumb span {
  display: block;
  padding: 6px 9px;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-thread-scroll .file-chip small {
  flex-shrink: 0;
}
.tk-bill-table td.num,
.tk-bill-table td:last-child {
  white-space: nowrap;
}

/* Composer */
.tk-composer {
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.tk-composer:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tk-composer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px 0;
}
.tk-mode button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tk-composer-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tk-composer-body {
  position: relative;
  padding: 10px 14px 4px;
}
.tk-textarea {
  width: 100%;
  min-height: 110px;
  max-height: 360px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
.tk-textarea::placeholder {
  color: var(--ink-4);
}
.tk-drop-overlay {
  position: absolute;
  inset: 6px 10px;
  display: none;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent-ink);
  z-index: 2;
  pointer-events: none;
}
.tk-composer-body.is-over .tk-drop-overlay {
  display: grid;
}
.tk-composer-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.tk-status-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tk-status-pick .select {
  width: auto;
  height: 36px;
  font-size: 13px;
}
.tk-composer.is-internal {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--warning) 55%, transparent);
  background: color-mix(in srgb, var(--warning) 5%, var(--surface));
}
.tk-composer.is-internal .tk-composer-foot {
  background: color-mix(in srgb, var(--warning) 7%, var(--surface));
}
.tk-composer.is-internal:focus-within {
  box-shadow: 0 0 0 4px var(--warning-soft);
}
.tk-composer.is-internal [data-send] {
  background: var(--warning);
  color: var(--accent-contrast);
}

/* Barra lateral */
.tk-manage .field + .field {
  margin-top: 12px;
}
.tk-prio-pick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.tk-prio-pick button {
  --c: var(--neutral);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  transition: all var(--t);
}
.tk-prio-pick button:hover {
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  color: var(--c);
}
.tk-prio-pick button.is-active {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
}
.tk-kv {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 8px 12px;
}
.tk-kv dd span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tk-contact {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.tk-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.tk-contact-row:last-child {
  border-bottom: 0;
}
a.tk-contact-row:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.tk-contact-row > svg {
  color: var(--ink-3);
}
.tk-wa-btn {
  --h: 28px;
  padding: 0 10px;
  font-size: 12px;
  background: var(--success-soft);
  color: var(--success);
}
.tk-wa-btn:hover {
  background: var(--success);
  color: var(--accent-contrast);
}
.tk-site {
  text-decoration: none !important;
}
.tk-site.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* Cronómetro y tiempo */
.tk-timer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.tk-timer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}
.tk-timer-face {
  flex: 1;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.tk-timer.is-running {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.tk-timer.is-running .tk-timer-dot {
  background: var(--danger);
  animation: pulse-dot 1.4s ease-out infinite;
  color: var(--danger);
}
.tk-timer.is-running .tk-timer-face {
  color: var(--accent-ink);
}
.tk-time-form {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.tk-time-form .input {
  height: 36px;
  font-size: 13px;
}
.tk-min .input {
  padding-right: 34px;
}
.tk-time-form .check {
  color: var(--ink-3);
}
.tk-time-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}
.tk-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px dashed var(--line);
}
.tk-time-row:last-child {
  border-bottom: 0;
}
.tk-time-row .icon-btn {
  opacity: 0.4;
}
.tk-time-row:hover .icon-btn {
  opacity: 1;
}
.tk-time-row.is-free b {
  color: var(--ink-3);
}

/* Facturación (línea de avance informada por CODE) */
.tk-btl {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tk-btl::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--line);
}
.tk-btl-step {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--ink-3);
}
.tk-btl-step i {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--line-2);
}
.tk-btl-step b {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
}
.tk-btl-step small {
  font-size: 12px;
}
.tk-btl-step.done i {
  background: var(--success);
  border-color: var(--success);
  color: var(--accent-contrast);
}
.tk-btl-step.done b {
  color: var(--ink);
}
.tk-btl-step.current i {
  border-color: var(--brand-teal);
  color: var(--brand-teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-teal) 15%, transparent);
}
.tk-bill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tk-bill-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.tk-bill-total strong {
  font-family: var(--font-display);
  font-size: 20px;
}
.tk-stars {
  display: flex;
  gap: 4px;
}
.tk-stars span {
  color: var(--line-2);
}
.tk-stars span.on {
  color: var(--ws-hanil);
}
.tk-stars span.on svg {
  fill: currentColor;
}
.tk-quote {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--ws-hanil);
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

/* ---------- Selector de archivos (compartido con el portal) ---------- */
.tk-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
}
.tk-drop small {
  display: block;
}
.fp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.fp-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 30px 6px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
}
.fp-item img,
.fp-ico {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}
.fp-ico {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.fp-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fp-meta b {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-meta small {
  font-size: 11px;
  color: var(--ink-3);
}
.fp-x {
  position: absolute;
  top: 50%;
  right: 6px;
  margin-top: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  background: var(--surface-3);
}
.fp-x:hover {
  background: var(--danger);
  color: var(--accent-contrast);
}
.lb {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 24px;
}
.lb-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--brand-navy-2) 88%, transparent);
  backdrop-filter: blur(6px);
}
.lb-fig {
  position: relative;
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lb-fig img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}
.lb-fig figcaption {
  color: var(--sb-ink);
  font-size: 13px;
}
.lb-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}
.lb-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sb-ink);
  background: color-mix(in srgb, var(--sb-ink) 14%, transparent);
  text-decoration: none !important;
}
.lb-btn:hover {
  background: color-mix(in srgb, var(--sb-ink) 26%, transparent);
}

/* ---------- Formularios del panel ---------- */
.tk-seg {
  display: flex;
  width: 100%;
}
.tk-seg button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
}

/* ---------- Credenciales ---------- */
.tk-creds-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
}
.tk-cred {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.tk-pass {
  font-size: 13px;
  padding: 5px 9px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink);
  user-select: all;
}
.tk-wa {
  color: var(--success);
}
@media (max-width: 640px) {
  .tk-cred {
    flex-wrap: wrap;
  }
}

/* ---------- Clientes del portal ---------- */
.tk-cap-num {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.tk-cap-num strong {
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: -0.03em;
  color: var(--accent-ink);
}
.tk-cap-num span {
  font-size: 13px;
  color: var(--ink-3);
}
.tk-inactive td {
  opacity: 0.55;
}
.tk-inactive td:nth-last-child(-n + 2) {
  opacity: 1;
}
.tk-tcount {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-decoration: none !important;
}
.tk-free-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  padding: 4px;
}
.tk-free {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
}
.tk-bulk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
}
.tk-bulk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.tk-bulk:hover {
  border-color: var(--accent-line);
}
.tk-bulk:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.tk-bulk input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.tk-bulk span {
  display: flex;
  flex-direction: column;
}
.tk-bulk.is-off {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Facturación ---------- */
.tk-bsteps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.tk-bsteps i {
  width: 18px;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
}
.tk-bsteps i.on {
  background: var(--success);
}
.tk-bsteps i.on:first-child {
  background: var(--warning);
}
.tk-bsteps i.on:nth-child(2) {
  background: var(--brand-teal);
}
.tk-bsteps i.on:nth-child(3) {
  background: var(--success);
}
.tk-bsteps-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Ajustes ---------- */
.tk-cat-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tk-cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.tk-icon-pick {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px dashed var(--accent-line);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out);
}
.tk-icon-pick:hover {
  transform: scale(1.06);
}
.tk-cat-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tk-input-sm {
  height: 34px;
  font-size: 12.5px;
}
.tk-cat-actions {
  display: flex;
  flex-direction: column;
}
.tk-cat-actions .icon-btn {
  width: 28px;
  height: 26px;
}
.tk-cat-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tk-cat-prev {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 0;
}
.tk-cat-prev span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--brand-teal);
  background: color-mix(in srgb, var(--brand-teal) 13%, transparent);
}
.tk-cat-prev b {
  font-size: 12.5px;
  line-height: 1.3;
}
.tk-cat-prev small {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.3;
}
.tk-icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 36px);
  gap: 4px;
  padding: 8px;
  min-width: 0;
}
.tk-icon-grid button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.tk-icon-grid button:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.tk-icon-grid button.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.tk-sla-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tk-sla-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
}
.tk-sla-name {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  font-size: 15px;
}
.tk-sla-name .tk-cdot {
  width: 10px;
  height: 10px;
}
@media (max-width: 720px) {
  .tk-sla-row {
    grid-template-columns: 1fr;
  }
  .tk-cat-preview {
    grid-template-columns: 1fr;
  }
  .tk-sla-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tk-time-form {
    grid-template-columns: 80px minmax(0, 1fr) auto auto;
  }
}
.tk-canned-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
.tk-canned {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.tk-canned-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent-ink);
  background: var(--accent-soft);
}
