/**
 * High 5 Connect CRM — V2 Timeline + Activity Styles
 */

/* ─── Timeline ────────────────────────────────────────────── */
.timeline-section {
  padding: var(--s2) 0;
}

.timeline-section h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--s4);
}

.timeline-current {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3);
  background: var(--navy-whisper);
  border-radius: var(--r-md);
  margin-bottom: var(--s4);
}

.timeline-current-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

.timeline-current-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.timeline-current-age {
  font-size: var(--text-xs);
  color: var(--text-label);
  margin-left: auto;
}

.timeline-track {
  position: relative;
  padding-left: var(--s6);
}

.timeline-entry {
  position: relative;
  padding-bottom: var(--s5);
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: calc(var(--s6) * -1 + 2px);
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: var(--r-full);
  background: var(--border);
  z-index: 1;
}

.timeline-line {
  position: absolute;
  left: calc(var(--s6) * -1 + 7px);
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-entry:last-child .timeline-line {
  display: none;
}

.timeline-entry-latest .timeline-dot {
  width: 14px;
  height: 14px;
  left: calc(var(--s6) * -1 + 1px);
  box-shadow: 0 0 0 3px var(--navy-whisper);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.timeline-date {
  font-size: var(--text-xs);
  color: var(--text-label);
}

.timeline-user {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ─── Activity Log ────────────────────────────────────────── */
.activity-section {
  padding: var(--s2) 0;
}

.activity-section h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--s4);
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  font-size: var(--text-base);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.activity-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-action {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.activity-details {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.activity-meta {
  font-size: var(--text-xs);
  color: var(--text-label);
}

/* ─── Notes ──────────────────────────────────────────────── */
.notes-section {
  padding: var(--s2) 0;
}

.notes-header {
  margin-bottom: var(--s3);
}

.notes-header h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.notes-input-area {
  display: flex;
  gap: var(--s2);
  align-items: flex-end;
  margin-bottom: var(--s4);
}

.notes-textarea {
  flex: 1;
  min-height: 44px;
  resize: vertical;
}

.notes-list {
  display: flex;
  flex-direction: column;
}

.note-item {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
}

.note-item:last-child {
  border-bottom: none;
}

.note-meta {
  display: flex;
  gap: var(--s2);
  margin-bottom: var(--s1);
}

.note-author {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-primary);
}

.note-time {
  font-size: var(--text-xs);
  color: var(--text-label);
}

.note-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ─── Work Orders + Material Orders (shared) ──────────────── */
.wo-section,
.mo-section {
  padding: var(--s2) 0;
}

.wo-header,
.mo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
}

.wo-header h4,
.mo-header h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.wo-card,
.mo-card {
  margin-bottom: var(--s3);
  padding: var(--s4);
}

.wo-card-header,
.mo-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
}

.wo-number {
  font-weight: 700;
  color: var(--text-primary);
  margin-right: var(--s2);
}

.mo-supplier {
  font-weight: 700;
  color: var(--text-primary);
  margin-right: var(--s2);
}

.wo-card-body,
.mo-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.wo-row,
.mo-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.wo-label,
.mo-label {
  color: var(--text-label);
}

.wo-value,
.mo-value {
  color: var(--text-primary);
  font-weight: 600;
}

.wo-card-notes,
.mo-card-notes {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-top: var(--s2);
  border-top: 1px solid var(--border);
  margin-top: var(--s2);
}

/* ─── Line Item Row (shared by WO + MO modals) ──────────── */
.line-item-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 80px 32px;
  gap: var(--s2);
  margin-bottom: var(--s2);
  align-items: center;
}

.line-item-row .input {
  padding: var(--s1) var(--s2);
  font-size: var(--text-sm);
}

@media (max-width: 640px) {
  .line-item-row {
    grid-template-columns: 1fr 50px 50px 60px 28px;
    gap: var(--s1);
  }
}
