/**
 * Cards de listado de tickets — diseño moderno compacto.
 * Revertir: en home.blade.php usa $ticketCardStyle = 'legacy'
 */

.contCards .tk-card {
  --tkc-border: rgba(35, 91, 78, 0.12);
  --tkc-bg: #ffffff;
  --tkc-ink: #0f172a;
  --tkc-muted: #64748b;
  --tkc-soft: #f4f7f6;
  --tkc-accent: #235B4E;
  --tkc-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
  padding: 0.65rem 0.75rem 0.6rem;
  border: 1px solid var(--tkc-border);
  border-radius: 12px;
  background: var(--tkc-bg);
  box-shadow: var(--tkc-shadow);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
  overflow: hidden;
}

.contCards .tk-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--tkc-accent), rgba(35, 91, 78, 0.35));
  opacity: 0.85;
}

.contCards .tk-card.card_focus:hover,
.contCards .tk-card:hover {
  color: inherit;
  background-color: #ffffff;
  border-color: rgba(35, 91, 78, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.contCards .tk-card:focus {
  outline: none;
  border-color: rgba(35, 91, 78, 0.45);
  box-shadow:
    0 0 0 2px rgba(35, 91, 78, 0.15),
    0 8px 20px rgba(15, 23, 42, 0.1);
}

/* Header */
.tk-card__header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
  padding-left: 0.25rem;
}

.tk-card__id-wrap {
  flex: 0 0 auto;
}

.tk-card__check {
  min-height: auto;
  padding-left: 1.4rem;
  margin: 0;
}

.tk-card__check .custom-control-label::before,
.tk-card__check .custom-control-label::after {
  top: 0.15rem;
}

.tk-card__id {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--tkc-accent);
  font-variant-numeric: tabular-nums;
}

.tk-card__header .tk-chip--prio-baja,
.tk-card__header .tk-chip--prio-media,
.tk-card__header .tk-chip--prio-alta,
.tk-card__header .tk-chip--prio-neutral {
  margin-left: auto;
}

.tk-card__timer {
  position: static !important;
  right: auto !important;
  top: auto !important;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tkc-ink);
  background: rgba(35, 91, 78, 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-height: 1.15rem;
  border: 1px solid rgba(35, 91, 78, 0.12);
}

.tk-card__timer:empty {
  display: none;
}

.tk-card__timer.parpadeo {
  background: rgba(159, 34, 65, 0.1);
  border-color: rgba(159, 34, 65, 0.18);
  color: #9F2241;
}

/* Body */
.tk-card__body {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  padding-left: 0.25rem;
}

.tk-card__avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #2f6f60, #235B4E 55%, #1a443a);
  box-shadow: 0 4px 10px rgba(35, 91, 78, 0.22);
  text-transform: uppercase;
}

.tk-card__main {
  min-width: 0;
  flex: 1 1 auto;
}

.tk-card__asunto {
  margin: 0 0 0.28rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--tkc-ink);
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tk-card__persona {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.25rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--tkc-muted);
  margin-bottom: 0.35rem;
  min-width: 0;
}

.tk-card__persona-name {
  color: #334155;
  font-weight: 600;
}

.tk-card__email {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tk-card__sep {
  color: #94a3b8;
  padding: 0 0.05rem;
}

.tk-card__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

/* Chips / badges profesionales */
.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 14rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tk-chip i {
  font-size: 0.6rem;
  opacity: 0.9;
  flex: 0 0 auto;
}

.tk-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
}

.tk-chip--soft {
  background: rgba(35, 91, 78, 0.07);
  border-color: rgba(35, 91, 78, 0.12);
  color: #1f4d42;
}

.tk-chip--soft i {
  color: var(--tkc-accent);
}

.tk-chip--ghost {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
  color: #64748b;
  font-weight: 600;
}

.tk-chip--assign {
  background: rgba(35, 91, 78, 0.08);
  border-color: rgba(35, 91, 78, 0.14);
  color: #1a443a;
  max-width: 12rem;
}

.tk-chip--assign i {
  color: var(--tkc-accent);
}

/* Estado */
.tk-chip--estado-info {
  background: rgba(14, 116, 144, 0.1);
  border-color: rgba(14, 116, 144, 0.18);
  color: #0e7490;
}

.tk-chip--estado-warning {
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.18);
  color: #b45309;
}

.tk-chip--estado-muted {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.2);
  color: #475569;
}

.tk-chip--estado-primary {
  background: rgba(35, 91, 78, 0.12);
  border-color: rgba(35, 91, 78, 0.2);
  color: #1a443a;
}

.tk-chip--estado-danger {
  background: rgba(159, 34, 65, 0.1);
  border-color: rgba(159, 34, 65, 0.18);
  color: #9f2241;
}

.tk-chip--estado-success {
  background: rgba(21, 128, 61, 0.1);
  border-color: rgba(21, 128, 61, 0.18);
  color: #166534;
}

.tk-chip--estado-pending,
.tk-chip--estado-neutral {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.18);
  color: #475569;
}

/* Prioridad */
.tk-chip--prio-baja {
  background: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.2);
  color: #1e7a36;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tk-chip--prio-media {
  background: rgba(217, 160, 0, 0.12);
  border-color: rgba(184, 134, 11, 0.22);
  color: #9a6b00;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tk-chip--prio-alta {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.2);
  color: #b42334;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tk-chip--prio-neutral {
  background: var(--tkc-soft);
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--tkc-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Footer */
.tk-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.25rem 0 0.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.tk-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.68rem;
  color: var(--tkc-muted);
  line-height: 1.3;
  min-width: 0;
}

.tk-card__meta--end {
  justify-content: flex-end;
  text-align: right;
  margin-left: auto;
}

.tk-card__date {
  white-space: nowrap;
  color: var(--tkc-muted);
}

.tk-card__date i {
  color: var(--tkc-accent);
  margin-right: 0.2rem;
  font-size: 0.65rem;
}

@media (max-width: 767.98px) {
  .tk-card__header .tk-chip--prio-baja,
  .tk-card__header .tk-chip--prio-media,
  .tk-card__header .tk-chip--prio-alta,
  .tk-card__header .tk-chip--prio-neutral {
    margin-left: 0;
  }

  .tk-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .tk-card__meta--end {
    margin-left: 0;
    text-align: left;
    justify-content: flex-start;
  }

  .tk-card__asunto {
    font-size: 0.88rem;
  }

  .tk-chip {
    max-width: 100%;
  }
}
