/* ═══════════════════════════════════════════════════════════════════
   SEMÁFORO DE TICKETS — Custom Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Semáforo icono animado en el header ─────────────────────── */
.semaforo-icon {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 5px;
  width: 24px;
}

.semaforo-icon .light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0.25;
}

.semaforo-icon .light.red   { background: #ef4444; animation: blink-red 3s ease-in-out infinite; }
.semaforo-icon .light.yellow{ background: #eab308; animation: blink-yellow 3s ease-in-out infinite 1s; }
.semaforo-icon .light.green { background: #22c55e; animation: blink-green 3s ease-in-out infinite 2s; }

@keyframes blink-red    { 0%,100%{opacity:.2} 33%{opacity:1} }
@keyframes blink-yellow { 0%,100%{opacity:.2} 33%{opacity:1} }
@keyframes blink-green  { 0%,100%{opacity:.2} 33%{opacity:1} }

/* ─── Avatar círculo por técnico ──────────────────────────────── */
.avatar-circle {
  min-width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ─── Tarjeta de técnico ──────────────────────────────────────── */
.tecnico-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 16px;
  transition: all 0.2s ease;
  animation: slideUp 0.4s ease-out;
}

.tecnico-card:hover {
  border-color: #334155;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.tecnico-card.highlight-ultimo {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b33, 0 8px 24px #f59e0b22;
}

.tecnico-card.highlight-proximo {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f633, 0 8px 24px #3b82f622;
}

/* Barra de carga */
.workload-bar {
  height: 6px;
  background: #1e293b;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.workload-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Badges de estado ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-PEN { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.badge-INI { background: #422006; color: #fcd34d; border: 1px solid #78350f; }
.badge-CON { background: #052e16; color: #86efac; border: 1px solid #14532d; }
.badge-ESP { background: #0c1a4b; color: #93c5fd; border: 1px solid #1e3a8a; }

/* Badge grande para tabla */
.badge-lg {
  padding: 4px 12px;
  font-size: 0.75rem;
}

/* ─── Tabla ───────────────────────────────────────────────────── */
#tickets-tbody tr {
  border-bottom: 1px solid #1e293b;
  transition: background 0.15s;
}

#tickets-tbody tr:hover {
  background: #1e293b55;
}

#tickets-tbody tr:last-child {
  border-bottom: none;
}

.td-cell {
  padding: 12px 16px;
  vertical-align: top;
}

.truncate-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Skeleton loading ────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-card {
  height: 180px;
  border-radius: 16px;
  background: linear-gradient(90deg, #0f172a 25%, #1e293b 50%, #0f172a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-row {
  border-bottom: 1px solid #1e293b;
}

.skeleton-cell {
  height: 40px;
  margin: 8px 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, #0f172a 25%, #1e293b 50%, #0f172a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ─── Refresh icon spin ───────────────────────────────────────── */
.spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Rotation list item ──────────────────────────────────────── */
.rotation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.2s;
}

.rotation-item.is-ultimo {
  background: #422006;
  color: #fcd34d;
}

.rotation-item.is-proximo {
  background: #1e3a8a55;
  color: #93c5fd;
  font-weight: 700;
}

/* ─── Fecha vencida ───────────────────────────────────────────── */
.fecha-vencida {
  color: #f87171;
  font-weight: 600;
}

/* ─── Colores por técnico ─────────────────────────────────────── */
.tc-DIEGOIPA { background: #3730a3; color: #c7d2fe; }
.tc-GABYC    { background: #701a75; color: #f5d0fe; }
.tc-CASTI    { background: #065f46; color: #a7f3d0; }
.tc-WALTER   { background: #7c2d12; color: #fed7aa; }
.tc-IPA      { background: #1e3a5f; color: #bae6fd; }
.tc-BELLING  { background: #4a1d96; color: #ddd6fe; }

/* ─── Slideup animation ───────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Notificaciones: fila de ticket nuevo ───────────────────── */
#tickets-tbody tr.ticket-row-new {
  background: rgba(16, 185, 129, 0.06);
  animation: newTicketFade 0.5s ease-out;
}

#tickets-tbody tr.ticket-row-new td:first-child {
  border-left: 3px solid #10b981;
  padding-left: 13px; /* compensa el borde de 3px */
}

@keyframes newTicketFade {
  from { background: rgba(16, 185, 129, 0.25); }
  to   { background: rgba(16, 185, 129, 0.06); }
}

/* ─── Notificaciones: banner de tickets nuevos ───────────────── */
#new-tickets-banner {
  animation: slideDown 0.35s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Botón de sonido (activo / mudo) ────────────────────────── */
#btn-sound.sound-on {
  background: #052e16;
  border-color: #16a34a;
  color: #4ade80;
}

#btn-sound.sound-off {
  background: #1e293b;
  border-color: #334155;
  color: #64748b;
}

#btn-sound.sound-off:hover {
  border-color: #475569;
  color: #94a3b8;
}

/* ─── Tooltip Custom ──────────────────────────────────────────── */
.custom-tooltip-wrapper {
  position: relative;
  display: block;
}

.custom-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 50;
  bottom: 100%;
  right: 0;
  transform: translateY(2px);
  background: #0f172a;
  color: #f1f5f9;
  border: 1px solid #334155;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 320px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  pointer-events: auto;
}

.custom-tooltip-wrapper:hover .custom-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
