/* ═══════════ TIMELINE — componente reutilizável ═══════════
   Usado por B4 (ocorrências), B5 (caderno do professor), A6 (parecer)
   e qualquer histórico vertical em estilo "feed cronológico".
   Renderizado por renderTimeline() em js/ui.js.
*/

.tl-wrap {
  padding: 4px 0;
}

.tl-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  background: var(--bg3);
  border: 1px dashed var(--border2);
  border-radius: 8px;
}

.tl-day-hd {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 0 4px 12px;
  margin-top: 10px;
}
.tl-day-hd:first-child { margin-top: 0; }

.tl {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

/* Linha vertical da timeline */
.tl::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--border2), transparent 95%);
  border-radius: 1px;
}

.tl-item {
  position: relative;
  padding: 6px 0 10px 38px;
  /* --tl-color é definido inline pelo renderTimeline() quando item.color é passado */
}

.tl-item.tl-compact { padding: 4px 0 6px 38px; }

.tl-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--tl-color, var(--border2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  z-index: 1;
  box-shadow: 0 0 0 3px var(--bg);
}

.tl-card {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--tl-color, var(--teal));
  border-radius: 7px;
  padding: 8px 12px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.tl-item:hover .tl-card { border-color: var(--tl-color, var(--teal)); }

.tl-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.tl-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--fg);
  flex: 1;
  min-width: 0;
}

.tl-ts {
  font-size: 0.66rem;
  color: var(--muted2);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.tl-body {
  font-size: 0.78rem;
  color: var(--fg);
  line-height: 1.45;
  margin: 4px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.tl-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  min-height: 18px;
}

.tl-meta {
  font-size: 0.66rem;
  color: var(--muted2);
  font-style: italic;
}

.tl-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Variantes compactas para timelines em modais ou sidebars */
.tl-compact .tl-card { padding: 5px 9px; }
.tl-compact .tl-title { font-size: 0.76rem; }
.tl-compact .tl-body { font-size: 0.72rem; }
.tl-compact .tl-dot { width: 22px; height: 22px; font-size: 0.7rem; top: 3px; }
.tl-compact::before { left: 10px; }
.tl-compact .tl-item { padding-left: 32px; }

/* Mobile */
@media (max-width: 600px) {
  .tl-card-hd { flex-direction: column; gap: 2px; }
  .tl-foot { flex-direction: column; align-items: flex-start; }
}
