/* Activity Log view -- every top-level selector is scoped under #view-activity so it can't
   leak into (or be clobbered by) the other satellite views' CSS, which reuse the same generic
   class names. Nav (.saevo-nav-*), orb (.orb-*/.blob/@keyframes flow*/morph*) and the shared
   stage-confirm-overlay modal are intentionally NOT ported here -- nav lives in the shell
   outside every view container, and the confirm modal styling is in shared/saevo-shared.css. */

#view-activity .bg {
  position: relative;
  width: calc(100 * var(--rvw));
  height: calc(100 * var(--rvh));
  box-sizing: border-box;
  background-image: linear-gradient(to bottom, rgba(var(--c-ink), 0) 0%, rgba(var(--c-ink), 0.05) 100%),
    linear-gradient(rgb(var(--c-cream)), rgb(var(--c-cream)));
  background-size: 100% 200%;
  background-position: 0% 0%;
  animation: activityWaveShift 6.5s ease-in-out infinite alternate;
  overflow: hidden;
}

@keyframes activityWaveShift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 0% 50%; }
}

#view-activity .bg-top-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(50 * var(--rvh));
  background: linear-gradient(to bottom, rgb(var(--c-cream)) 0%, rgb(var(--c-cream)) 40%, rgba(var(--c-cream), 0) 100%);
  pointer-events: none;
}

#view-activity .logo {
  position: absolute;
  top: 20px;
  left: 48px;
  height: 60px;
  width: auto;
}

#view-activity .phone-status {
  position: fixed;
  top: 26px;
  right: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

#view-activity .phone-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgb(var(--c-success));
  box-shadow: 0 0 8px rgba(var(--c-success), 0.7);
}

#view-activity .phone-status-label {
  font-size: 13px;
  color: rgb(var(--c-ink));
  letter-spacing: 0.2px;
}

#view-activity .header-icon-btn {
  position: fixed;
  top: 62px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(var(--c-accent), 0.3);
  background: rgba(var(--c-accent), 0.1);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

#view-activity .header-icon-btn:hover {
  background: rgba(var(--c-accent), 0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

#view-activity .header-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: rgb(var(--c-accent));
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Left-to-right order: call, text, settings, calendar -- calendar sits closest to the edge
   (smallest right offset), call furthest out. #headerSettingsBtn's right:98px lives inline on
   the button itself (see the view's own JS template) for consistency with how it was already
   done before this reorder. */
#view-activity #headerCallBtn { right: 198px; }
#view-activity #headerChatBtn { right: 148px; }
#view-activity #headerCalendarBtn { right: 48px; }

#view-activity .search-bar-wrap {
  position: absolute;
  top: 26px;
  left: 320px;
  right: 320px;
}

#view-activity .search-bar {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(var(--c-ink), 0.15);
  background: rgb(var(--c-cream));
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  color: rgb(var(--c-ink));
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#view-activity .search-bar:focus {
  border-color: rgba(var(--c-accent), 0.5);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(var(--c-accent), 0.12);
}

#view-activity .search-bar::placeholder { color: #8A857C; }

#view-activity .filters-row {
  position: absolute;
  top: 86px;
  left: 48px;
  display: flex;
  gap: 10px;
}

#view-activity .filter-pill {
  position: relative;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(var(--c-ink), 0.18);
  background: rgb(var(--c-cream));
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  color: rgb(var(--c-ink));
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#view-activity .filter-pill:hover { background: rgba(var(--c-accent), 0.1); box-shadow: var(--shadow-md); transform: translateY(-1px); }
#view-activity .filter-pill.active { background: rgb(var(--c-accent)); border-color: rgb(var(--c-accent)); color: #ffffff; }

#view-activity .filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: rgba(var(--c-cream), 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(var(--c-accent), 0.4);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  display: none;
  z-index: 20;
}

#view-activity .filter-dropdown.open { display: block; }

#view-activity .filter-dropdown-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: rgb(var(--c-ink));
  cursor: pointer;
}

#view-activity .filter-dropdown-option:hover { background: rgba(var(--c-accent), 0.12); }

#view-activity .main-area {
  position: absolute;
  top: 140px;
  left: 48px;
  right: 48px;
  bottom: 30px;
  display: flex;
  gap: 20px;
}

#view-activity .activity-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: flex-basis 0.3s ease;
}

#view-activity .activity-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
}

#view-activity .activity-feed-row {
  padding: 16px 22px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: rgb(var(--c-row));
  border: 1.5px solid transparent;
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  color: rgb(var(--c-ink));
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#view-activity .activity-feed-row:hover {
  transition-delay: 0.1s;
}

#view-activity .activity-feed-row:hover,
#view-activity .activity-feed-row.grouped {
  background: #DCDAD5;
  color: #211E19;
  border-color: rgb(var(--c-accent));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

#view-activity .activity-feed-row.selected {
  border-color: rgb(var(--c-ink));
}

#view-activity .activity-feed-row .person-name { font-weight: 700; }

#view-activity .profile-col {
  flex: 0 0 0px;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: flex-basis 0.3s ease, opacity 0.25s ease;
}

#view-activity .profile-col.open {
  flex: 0 0 46%;
  opacity: 1;
}

#view-activity .profile-panel {
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 4px 16px 40px 4px;
}

#view-activity .profile-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

#view-activity .profile-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: rgb(var(--c-ink));
  margin: 4px 0 18px;
}

#view-activity .profile-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--c-ink), 0.4);
  background: transparent;
  color: rgb(var(--c-ink));
  font-size: 15px;
  cursor: pointer;
  flex: 0 0 auto;
}

#view-activity .profile-close-btn:hover { background: rgba(var(--c-ink), 0.08); }

#view-activity .profile-id-card {
  background: rgb(var(--c-row));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 22px;
  text-align: center;
  margin-bottom: 22px;
}

#view-activity .profile-id-label {
  font-size: 12px;
  color: rgba(var(--c-ink), 0.55);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

#view-activity .profile-id-value {
  font-size: 20px;
  color: rgb(var(--c-ink));
  margin: 0 0 16px;
}

#view-activity .profile-action-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}

#view-activity .profile-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgb(var(--c-accent-2));
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#view-activity .profile-icon-btn:hover { background: rgb(var(--c-accent)); box-shadow: var(--shadow-md); transform: translateY(-1px); }

#view-activity .profile-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#view-activity .profile-field-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(var(--c-ink), 0.25);
  font-size: 14px;
}

#view-activity .profile-field-label { color: rgb(var(--c-ink)); font-weight: 600; }
#view-activity .profile-field-value { color: rgb(var(--c-ink)); }
#view-activity .profile-field-value a { color: #2b5fb0; }

#view-activity .profile-boxes-row {
  display: flex;
  gap: 16px;
  margin-top: 22px;
}

#view-activity .profile-box {
  flex: 1 1 50%;
  min-width: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#view-activity .profile-box-header {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 10px 12px;
}

#view-activity .profile-box.tasks .profile-box-header { background: rgba(var(--c-ink), 0.06); color: rgb(var(--c-ink)); }
#view-activity .profile-box.emails .profile-box-header { background: rgba(var(--c-accent-2), 0.16); color: rgb(var(--c-accent-2)); }

#view-activity .profile-box-list {
  border: none;
  background: rgba(var(--c-cream), 0.5);
}

#view-activity .profile-box-item {
  padding: 8px 12px;
  font-size: 12px;
  color: rgb(var(--c-ink));
  border-bottom: 1px solid rgba(var(--c-ink), 0.12);
}

#view-activity .profile-box-item:last-child { border-bottom: none; }

#view-activity .task-add-row {
  padding: 8px 12px;
  font-size: 12px;
  color: rgb(var(--c-accent));
  cursor: pointer;
  font-weight: 600;
}

#view-activity .task-add-row:hover { text-decoration: underline; }

#view-activity .task-add-input {
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid rgba(var(--c-ink), 0.3);
  background: transparent;
  font-size: 12px;
  padding: 4px 0;
  outline: none;
}

#view-activity .task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#view-activity .task-item-dismiss {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: rgba(var(--c-ink), 0.4);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

#view-activity .task-item-dismiss:hover { color: rgb(var(--c-accent)); }

#view-activity .task-add-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

#view-activity .task-add-form-row .task-add-input { flex: 1; width: auto; }

#view-activity .task-add-submit-btn {
  flex-shrink: 0;
  border: 1px solid rgba(var(--c-accent), 0.6);
  background: transparent;
  color: rgb(var(--c-accent));
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

#view-activity .task-add-submit-btn:hover { background: rgba(var(--c-accent), 0.12); }
#view-activity .task-add-submit-btn:disabled { opacity: 0.5; cursor: default; }

#view-activity .task-add-datetime-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 8px;
  flex-wrap: wrap;
  position: relative;
}

#view-activity .task-add-date-picker { position: relative; flex: 1.4; min-width: 82px; }

#view-activity .task-add-date-btn {
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid rgba(var(--c-ink), 0.3);
  background: transparent;
  font-size: 11px;
  color: rgba(var(--c-ink), 0.5);
  padding: 4px 2px;
  font-family: inherit;
  cursor: pointer;
}
#view-activity .task-add-date-btn.has-value { color: rgb(var(--c-ink)); }

#view-activity .task-add-date-cal {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  background: rgb(var(--c-cream));
  border: 1px solid rgba(var(--c-ink), 0.15);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(var(--c-ink), 0.18);
  padding: 8px;
  width: 190px;
}
#view-activity .task-add-date-cal.open { display: block; }

#view-activity .task-add-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: rgb(var(--c-ink));
  margin-bottom: 6px;
}
#view-activity .task-add-cal-arrow {
  border: none;
  background: none;
  color: rgb(var(--c-accent));
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
#view-activity .task-add-cal-dow,
#view-activity .task-add-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
#view-activity .task-add-cal-dow {
  font-size: 9px;
  color: rgba(var(--c-ink), 0.45);
  text-align: center;
  margin-bottom: 3px;
}
#view-activity .task-add-cal-grid { gap: 2px; }
#view-activity .task-add-cal-day {
  text-align: center;
  font-size: 10.5px;
  color: rgb(var(--c-ink));
  padding: 4px 0;
  border-radius: 4px;
  cursor: pointer;
}
#view-activity .task-add-cal-day:hover:not(.disabled):not(.muted) { background: rgba(var(--c-accent), 0.15); }
#view-activity .task-add-cal-day.selected { background: rgb(var(--c-accent)); color: #ffffff; }
#view-activity .task-add-cal-day.disabled { color: rgba(var(--c-ink), 0.22); cursor: default; }
#view-activity .task-add-cal-day.muted { visibility: hidden; }

#view-activity .task-add-hour-select,
#view-activity .task-add-minute-select,
#view-activity .task-add-ampm-select {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-bottom: 1px solid rgba(var(--c-ink), 0.3);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath d='M1 2l3 3 3-3' stroke='%23211E19' stroke-width='1.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 8px 8px;
  font-size: 11px;
  color: rgb(var(--c-ink));
  padding: 4px 12px 4px 2px;
  outline: none;
  font-family: inherit;
  min-width: 0;
  box-sizing: border-box;
}
#view-activity .task-add-hour-select,
#view-activity .task-add-minute-select { width: 40px; flex: none; }
#view-activity .task-add-ampm-select { width: 54px; flex: none; }
#view-activity .task-add-colon { color: rgba(var(--c-ink), 0.5); font-size: 11px; }
#view-activity .task-add-datetime-row .task-add-submit-btn { margin-left: auto; }
#view-activity .task-add-date-btn.error { color: rgb(var(--c-danger)); border-bottom-color: rgb(var(--c-danger)); }
#view-activity .task-add-hour-select.error,
#view-activity .task-add-minute-select.error { color: rgb(var(--c-danger)); border-bottom-color: rgb(var(--c-danger)); }
#view-activity .task-add-datetime-error { width: 100%; font-size: 10.5px; color: rgb(var(--c-danger)); margin-top: 4px; }

#view-activity .profile-notes-title, #view-activity .profile-activity-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: rgb(var(--c-ink));
  margin: 26px 0 10px;
}

#view-activity .profile-notes-box {
  background: rgb(var(--c-row));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 18px;
}

#view-activity .profile-note-entry { margin-bottom: 14px; }
#view-activity .profile-note-entry:last-child { margin-bottom: 0; }

#view-activity .note-add-box {
  margin-top: 10px;
}

#view-activity .note-add-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  resize: vertical;
  border: 1px solid rgba(var(--c-ink), 0.18);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  background: rgb(var(--c-cream));
  color: rgb(var(--c-ink));
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#view-activity .note-add-textarea:focus {
  outline: none;
  border-color: rgba(var(--c-accent), 0.5);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(var(--c-accent), 0.12);
}

#view-activity .note-add-btn {
  margin-top: 8px;
  width: 100%;
  background: rgb(var(--c-accent));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#view-activity .note-add-btn:hover { background: rgb(var(--c-accent-2)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
#view-activity .note-add-btn:disabled { opacity: 0.6; cursor: default; }

#view-activity .profile-note-meta {
  font-size: 11px;
  font-weight: 700;
  color: rgb(var(--c-ink));
  margin-bottom: 4px;
}

#view-activity .profile-note-text {
  font-size: 13.5px;
  color: rgb(var(--c-ink));
  line-height: 1.4;
}

#view-activity .profile-activity-list {
  border: 1px solid rgba(var(--c-ink), 0.25);
  border-radius: 6px;
  overflow: hidden;
}

#view-activity .profile-activity-feed-row {
  padding: 9px 14px;
  font-size: 12.5px;
  color: rgb(var(--c-ink));
  text-align: center;
  border-bottom: 1px solid rgba(var(--c-ink), 0.15);
}

#view-activity .profile-activity-feed-row:last-child { border-bottom: none; }

#view-activity .stage-action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
#view-activity .stage-action-btn {
  flex: 1 1 50%;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: var(--shadow-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
#view-activity .stage-action-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
#view-activity .stage-action-btn.lost {
  background: transparent;
  color: rgb(var(--c-ink));
  border: 1.5px solid rgba(var(--c-ink), 0.3);
  box-shadow: none;
}
#view-activity .stage-action-btn.lost:hover { background: rgba(var(--c-ink), 0.08); }
#view-activity .stage-action-btn.won {
  background: rgb(var(--c-accent-2));
  color: #ffffff;
}
#view-activity .stage-action-btn.won:hover { background: rgb(var(--c-accent)); }
