/* ── Activity Section ─────────────────────────────────────────────────────── */

/* display/flex-direction are controlled by .section and .section.active in projectDetail.css
   ID selector must NOT set display here — that would override .section { display: none } */
#section-activity {
  padding: 0;
  background: var(--bg-surface, #fff);
}

#section-activity.section.act-section {
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.act-header {
  /* display: flex; */
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  flex-shrink: 0;
  gap: 12px;
}

.act-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--cde-fs-sm, 12px);
  font-weight: 600;
  color: var(--data-std-text, #24272e);
  min-height: 32px;
}

.act-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 6px 8px;
  border: 1.5px solid var(--data-std-border, #e1e4e8);
  border-radius: 6px;
  background: var(--bg-light);
  border-radius: 10px;
}

.act-filter-sel {
  min-height: 32px;
  padding: 8px 12px;
  font-size: var(--cde-fs-sm, 12px);
  font-weight: 500;
  border: 1.5px solid var(--data-std-border, #e1e4e8);
  border-radius: 6px;
  background: var(--data-std-surface, #ffffff);
  color: var(--data-std-text, #24272e);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235b6575' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 36px;
}

.act-filter-sel:hover {
  border-color: var(--data-std-border-strong, #cdd1d8);
}

.act-filter-sel:focus {
  outline: none;
  border-color: var(--data-std-focus, #1460b8);
  box-shadow: 0 0 0 3px rgba(20, 96, 184, 0.12);
  background-color: var(--data-std-surface, #ffffff);
}

.act-header-right .cs-select {
  min-width: 150px;
}

.act-header-right .cs-select .cs-select__trigger {
  min-height: 32px;
  font-size: var(--cde-fs-sm, 12px);
  font-weight: 500;
  border-radius: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--data-std-border, #e1e4e8);
  background: var(--data-std-surface, #ffffff);
  color: var(--data-std-text, #24272e);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.act-header-right .cs-select .cs-select__trigger:hover {
  border-color: var(--data-std-border-strong, #cdd1d8);
}

.act-header-right .cs-select .cs-select__trigger:focus {
  border-color: var(--data-std-focus, #1460b8);
  box-shadow: 0 0 0 3px rgba(20, 96, 184, 0.12);
}

.act-filter-date {
  min-height: 32px;
  padding: 8px 12px;
  font-size: var(--cde-fs-sm, 12px);
  font-weight: 500;
  min-width: 150px;
}

.act-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--data-std-border, #e1e4e8);
  border-radius: 6px;
  background: var(--data-std-surface, #ffffff);
  color: var(--data-std-text-muted, #5b6575);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}

.act-refresh-btn:hover {
  background: var(--data-std-muted-surface, #f4f6f8);
  color: var(--data-std-focus, #1460b8);
  border-color: var(--data-std-border-strong, #cdd1d8);
}

.act-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 14px;
}

/* Loading */
.act-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 32px 24px;
  color: var(--data-std-text-muted, #5b6575);
  font-size: var(--cde-fs-sm, 12px);
  font-weight: 500;
}

.act-skel-wrap {
  padding: 8px 0 14px;
}

.act-skel-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 20px;
  margin: 0 8px;
}

.act-skel-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}

.act-skel-lines {
  flex: 1;
}

.act-skel-line {
  height: 11px;
  border-radius: 6px;
  margin-bottom: 7px;
}

.act-skel-line:last-child {
  margin-bottom: 0;
}

.act-skel-time {
  width: 42px;
  height: 10px;
  border-radius: 6px;
  margin-top: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { animation: spin 1.2s linear infinite; }

/* Empty */
.act-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 10px;
  color: var(--text-muted, #94a3b8);
  font-size: 0.875rem;
}
.act-empty p { margin: 0; }

/* Date group */
.act-group { padding: 0; }

.act-date-divider {
  display: flex;
  align-items: center;
  padding: 10px 20px 6px;
  gap: 8px;
}
.act-date-divider::before,
.act-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #e2e8f0);
}
.act-date-divider span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  padding: 0 6px;
}

/* Activity item */
.act-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 8px 20px;
  transition: background var(--t-base, 0.18s) ease;
  border-radius: 8px;
  margin: 0 8px;
}
.act-item:hover { background: var(--bg-light, #f8fafc); }

.act-item.is-jumpable {
  cursor: pointer;
}

.act-item.is-jumpable:hover {
  background: #eff6ff;
}

.act-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  margin-right: 10px;
}

.act-line-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.act-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
  opacity: 0.15;
  background: transparent;
  color: inherit;
}
.act-dot svg { opacity: 6.67; /* cancel 0.15 */ width: 11px; height: 11px; }

/* Use color from inline style */
.act-dot { background-color: var(--act-color, #64748b); }

.act-content {
  flex: 1;
  min-width: 0;
}

.act-sentence {
  font-size: 0.8375rem;
  line-height: 1.5;
  color: var(--text-primary, #0f172a);
  flex-wrap: wrap;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.act-user { font-weight: 600; }
.act-company { font-size: 0.75rem; color: var(--text-secondary, #64748b); font-weight: 400; }
.act-verb { color: var(--text-secondary, #64748b); }
.act-target {
  font-weight: 500;
  color: var(--primary-blue, #2563eb);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.act-kind {
  font-size: 0.68rem;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.act-jump-btn {
  border: none;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
}

.act-jump-btn:hover {
  background: #bfdbfe;
}

.act-detail {
  font-size: 0.775rem;
  color: var(--text-secondary, #64748b);
  margin-top: 2px;
  line-height: 1.4;
}

.act-time {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  flex-shrink: 0;
  white-space: nowrap;
  padding-top: 4px;
}

#cde-main-table tbody tr.act-jump-highlight {
  animation: actJumpPulse 1.6s ease-in-out;
  background: #dbeafe !important;
}

@keyframes actJumpPulse {
  0% { box-shadow: inset 0 0 0 999px rgba(191, 219, 254, 0.32); }
  100% { box-shadow: inset 0 0 0 999px rgba(191, 219, 254, 0); }
}

@media (max-width: 960px) {
  .act-header {
    flex-direction: column;
  }

  .act-header-right {
    width: 100%;
    justify-content: flex-start;
  }

  .act-filter-sel {
    flex: 1 1 180px;
    min-width: 150px;
  }

  .act-header-right .cs-select {
    flex: 1 1 180px;
    min-width: 150px;
  }

  .act-filter-date {
    min-width: 130px;
    flex: 1 1 140px;
  }
}
