#ticketsView {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px calc(68px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

#ticketsView.active {
  display: block;
}

#ticketsView h2 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #222;
}

/* ── Estado (carga / vacío / error) ───────────────── */
.ticketState {
  background: #fff;
  border-radius: 12px;
  padding: 22px 18px;
  margin: 8px 0;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.ticketStateTitulo {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #333;
}

.ticketStateTexto {
  margin: 0 0 14px;
  font-size: 13px;
  color: #777;
}

.ticketStateAccion {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #00c389;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* ── Tarjeta de ticket ───────────────────────────── */
.ticketCard {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #00c389;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ticketCard:active {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.ticketCard.expandido {
  border-left-color: #872f79;
}

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

.ticketNum {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.ticketFecha {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

.ticketChips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.chipCategoria {
  background: #e8f7f1;
  color: #00815c;
}

.chipAsignado {
  background: #fff3d6;
  color: #8a6100;
}

.chipCurso {
  background: #e4ecfb;
  color: #2a4f9b;
}

.chipResuelto {
  background: #e3f6e9;
  color: #1c7a3d;
}

.ticketAfiliado {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #999;
}

/* ── Detalle expandido ───────────────────────────── */
.ticketDetail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.ticketDetalleTexto {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticketDetalleSub {
  margin: 14px 0 4px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #888;
}

.ticketDetalleMotivo {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  overflow-wrap: anywhere;
}

.ticketDetalleMotivo p {
  margin: 0 0 8px;
}

.ticketDetalleMotivo p:last-child {
  margin-bottom: 0;
}

.ticketAviso {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8e1;
  color: #8a6100;
  font-size: 12px;
  font-weight: 700;
}

.ticketMeta {
  margin: 8px 0 0;
  font-size: 12px;
  color: #999;
}

/* ── Paginación ──────────────────────────────────── */
#ticketsPager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

#ticketsPager button {
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  background: #00c389;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#ticketsPager button:disabled {
  background: #dfe5e8;
  color: #9aa5ab;
  cursor: not-allowed;
}

#ticketsPagina {
  font-size: 13px;
  color: #666;
}