:root {
  --input-width: 220px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  font-family: 'Brandon Grotesque', 'Brandon Text', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f3;
  color: #000;
  min-height: 100vh;
}

.cs-container {
  max-width: calc(50vw + 700px);
  margin: 0 auto;
  padding: 10px 20px 20px;
}

/* Login Screen */
.cs-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.login-card {
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 19px rgba(0, 0, 0, 0.28);
}

.login-card h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 24px;
  text-align: center;
}

.login-logo {
  display: block;
  margin: 0 auto 24px;
  max-width: 200px;
  height: auto;
}

.login-error {
  margin-top: 12px;
  font-size: 13px;
  color: #dc2626;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus {
  outline: none;
  border-color: #000;
}

/* Buttons */
.cs-btn {
  padding: 10px 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cs-btn.primary {
  background: #000;
  color: #fff;
  border: none;
  width: 100%;
}

.cs-btn.primary:hover {
  background: #333;
}

.cs-btn.secondary {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.cs-btn.secondary:hover {
  background: #f5f5f3;
}

.cs-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cs-btn.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Control Bar (header) */
.cs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* WHAP logo in control bar */
.header-logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
  cursor: pointer;
}

/* Right-side header actions — pushed to far right */
.header-actions-right {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Header stats row */
.header-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-item {
  font-size: 11px;
  font-weight: 400;
  color: #000;
}

.stat-sep {
  font-size: 11px;
  font-weight: 400;
  color: #000;
}

/* Control bar icon buttons — match filter bar style */
.ctrl-btn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #000;
  padding: 0;
}

.ctrl-btn:hover {
  border-color: #000;
}

.ctrl-btn.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Header actions — always visible (Dashboard, Trends, Time Travel) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Header menu — hamburger that reveals buttons to the left */
.header-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-direction: row-reverse;
}

.header-menu-toggle {
  position: relative;
  z-index: 2;
}

.header-menu-items {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition: max-width 0.3s ease, opacity 0.2s ease;
}

.header-menu.open .header-menu-items {
  max-width: 200px;
  opacity: 1;
}

/* Query mode toggle (sparkle button) */
.query-mode-toggle {
  flex-shrink: 0;
}

.query-mode-toggle.ai-active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.query-mode-toggle.ai-active:hover {
  border-color: #333;
}

/* Unified input (merged search + AI query) */
.unified-input-wrap {
  flex: 0 0 auto;
  width: var(--input-width);
}

.unified-input {
  width: 100%;
  padding: 5px 10px;
  padding-right: 22px;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
  flex: none;
}

.unified-input:focus {
  outline: none;
  border-color: #000;
}

.unified-input.ai-mode::placeholder {
  color: #169156;
}

/* filter-group removed — filters are now standalone buttons */

.filter-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: middle;
}

.plan-select {
  width: 77px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
}

.plan-select:focus {
  outline: none;
  border-color: #000;
}

/* Multi-Select Dropdown (Plan filter) */
.multi-select {
  position: relative;
}

.multi-select-toggle {
  padding: 5px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  color: #666;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.multi-select-toggle:focus {
  outline: none;
}

.multi-select-toggle.has-selection {
  border-color: #000;
  color: #000;
}

.ended-toggle {
  margin-left: 4px;
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 40;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
}

.multi-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.multi-select-item:hover {
  background: #f5f5f3;
}

.multi-select-item input[type="checkbox"] {
  accent-color: #169156;
  cursor: pointer;
}

/* Onsite date range dropdown */
.onsite-dropdown {
  padding: 8px;
  min-width: 270px;
  max-height: none;
  overflow: visible;
}
.onsite-range-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.onsite-range-btn {
  flex: 1;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  color: #666;
  transition: all 0.15s ease;
}
.onsite-range-btn.active {
  border-color: #000;
  color: #000;
  background: #f5f5f3;
}
.onsite-range-btn span {
  font-weight: 700;
}
.onsite-cal-wrap {
  margin-bottom: 8px;
}
.onsite-date-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 4px;
}
.onsite-clear-btn,
.onsite-apply-btn {
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.onsite-clear-btn {
  background: #f5f5f5;
  color: #333;
}
.onsite-clear-btn:hover {
  background: #eee;
}
.onsite-apply-btn {
  background: #169156;
  color: #fff;
}
.onsite-apply-btn:hover {
  background: #12753f;
}

/* Birthday field in member detail */
.birthday-row {
  position: relative;
}
.birthday-trigger {
  padding: 3px 8px;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #999;
}
.birthday-trigger:hover {
  border-color: #169156;
}
.birthday-trigger.has-value {
  color: #000;
  border-color: #169156;
}
.birthday-dp-wrap {
  position: absolute;
  top: 24px;
  left: 0;
  z-index: 60;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  width: 260px;
  padding: 4px;
}
.bday-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  z-index: 1;
  padding: 0 4px;
}
.bday-close:hover {
  color: #000;
}

/* Interest Tags */
.tags-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}
.tags-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  margin-bottom: 6px;
}
.tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #169156;
  white-space: nowrap;
}
.tag-icon {
  flex-shrink: 0;
}
.tag-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 1px;
}
.tag-remove:hover {
  color: #fff;
}
.tags-combo {
  position: relative;
}
.tags-input {
  width: 100%;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
}
.tags-input:focus {
  outline: none;
  border-color: #169156;
}
.tags-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  z-index: 50;
  max-height: 180px;
  overflow-y: auto;
}
.tags-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.tags-option:hover {
  background: #f5f5f3;
}
.tags-option-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  background: #169156 !important;
}
.tags-create {
  color: #169156;
  font-weight: 600;
}
.tags-create-plus {
  font-size: 14px;
  font-weight: 700;
}

/* Tags filter in control bar */
.tags-filter-dropdown {
  min-width: 260px;
  max-height: 320px;
  padding: 0;
}
.tags-filter-search-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
}
.tags-filter-search {
  width: 100%;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}
.tags-filter-search:focus {
  outline: none;
  border-color: #169156;
}
.tags-filter-list {
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 240px;
  overflow-y: auto;
}
.tags-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid #169156;
  background: #fff;
  color: #169156;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.tags-filter-chip:hover {
  background: #f0fdf4;
}
.tags-filter-chip.active {
  background: #169156;
  color: #fff;
}
.tags-filter-chip.active .tag-filter-icon {
  stroke: #fff;
}
.tags-filter-empty {
  font-size: 12px;
  color: #999;
  padding: 12px 0;
  text-align: center;
  width: 100%;
}

/* Top info row (stats left, synced right) */
.top-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}

/* Synced At */
.synced-at {
  font-size: 11px;
  color: #999;
  margin: 0;
  text-align: right;
  min-height: 16px;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  text-align: left;
  padding: 10px 6px;
  border-bottom: 1px solid #000;
  position: sticky;
  top: 0;
  background: #fff;
  white-space: nowrap;
  z-index: 2;
}

/* Column widths */
th[data-col="name"] { width: 200px; padding-left: 12px; }
th[data-col="status"] { width: 72px; }
th[data-col="lastContact"] { width: 72px; }
th[data-col="contacted"] { width: 100px; text-align: center; }
th[data-col="response"] { width: 56px; padding: 10px 2px; text-align: center; }
th[data-col="health"] { width: 135px; text-align: center; }
th[data-col="editedBy"] { width: 72px; text-align: center; }
th[data-col="plan"] { width: 120px; }
th[data-col="price"] { width: 50px; }
th[data-col="startDate"] { width: 86px; }
th[data-col="stage"] { width: 90px; text-align: center; }
th[data-col="monthsActive"] { width: 56px; padding-right: 12px; }

thead th.sortable {
  cursor: pointer;
  user-select: none;
}

thead th.sortable:hover {
  color: #169156;
}

thead th .sort-arrow {
  margin-left: 3px;
  font-size: 9px;
  color: #169156;
}

tbody tr {
  transition: background 0.1s ease;
}

tbody tr:hover {
  background: #f0fdf4;
}

tbody td {
  font-size: 13px;
  padding: 8px 6px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

tbody td:has(.response-btns) { padding: 8px 2px; }
tbody td:has(.edited-squares) { text-align: center; }

tbody td:first-child {
  padding-left: 12px;
}

tbody td:last-child {
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.status-badge.new {
  color: #eab308;
  padding: 0;
  border-radius: 0;
}

.status-badge.active {
  color: #169156;
  padding: 0;
  border-radius: 0;
}

.status-badge.upgrading {
  color: #1d4ed8;
  padding: 0;
  border-radius: 0;
}

.status-badge.downgrading {
  color: #92400e;
  padding: 0;
  border-radius: 0;
}

.status-badge.switching {
  background: #f0fdf4;
  color: #169156;
  border: 1px solid #bbf7d0;
}

.status-badge.pausing {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.status-badge.paused {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.status-badge.leaving {
  color: #dc2626;
  padding: 0;
  border-radius: 0;
}

.transition-date {
  display: block;
  font-size: 10px;
  color: inherit;
  margin-top: 2px;
  text-align: center;
}

/* Health Circles */
.health-circles {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.health-dot {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}

.health-dot .health-icon {
  display: block;
}

.health-dot.red {
  border-color: #dc2626;
  color: #dc2626;
}

.health-dot.red.active {
  background: #dc2626;
  color: #fff;
}

.health-dot.orange {
  border-color: #f97316;
  color: #f97316;
}

.health-dot.orange.active {
  background: #f97316;
  color: #fff;
}

.health-dot.yellow {
  border-color: #eab308;
  color: #eab308;
}

.health-dot.yellow.active {
  background: #eab308;
  color: #fff;
}

.health-dot.green {
  border-color: #169156;
  color: #169156;
}

.health-dot.green.active {
  background: #169156;
  color: #fff;
}

.health-dot:hover {
  transform: scale(1.15);
}

/* Contact Count Dots */
.contact-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.contact-dot {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  background: #fff;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.contact-dot.active {
  background: #ddd;
  color: #000;
  border-color: #000;
}

.contact-dot:hover {
  transform: scale(1.15);
}

/* Response Y/N Buttons */
.response-btns {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.yn-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  background: #fff;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.yn-btn:hover {
  transform: scale(1.15);
}

.yn-btn.active {
  background: #ddd;
  color: #000;
  border-color: #000;
}

/* Edited Squares */
.edited-squares {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.edited-sq {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.edited-sq.active {
  background: #ddd;
  color: #000;
  border-color: #000;
}

/* Activity Inline Panel */
.activity-list {
  margin-bottom: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

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

.activity-type-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  border: 1px solid #ddd;
  background: #f9f9f9;
}

.activity-type-icon.reminder {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.activity-type-icon.draft {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

.activity-date {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  min-width: 70px;
}

.activity-desc {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-delete {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

.activity-delete:hover {
  color: #dc2626;
}

.activity-empty {
  font-size: 12px;
  color: #999;
  padding: 8px 0;
}

/* Activity Form */
.activity-form {
  position: relative;
  padding-top: 14px;
}

.activity-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.activity-type-toggle {
  display: flex;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.activity-type-toggle button {
  padding: 5px 10px;
  font-size: 12px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.activity-type-toggle button.active {
  background: #169156;
  color: #fff;
}

.activity-type-toggle button:not(.active):hover {
  background: #f0fdf4;
}

.activity-date-input {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  width: 130px;
}

.activity-time-input {
  width: 80px;
  padding: 5px 6px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}
.activity-time-input:focus {
  outline: none;
  border-color: #169156;
}

.activity-note-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.activity-draft-fields {
  margin-bottom: 8px;
}

.activity-draft-fields input,
.activity-draft-fields textarea {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  margin-bottom: 6px;
}

.activity-draft-fields textarea {
  min-height: 60px;
  resize: vertical;
}

.activity-autosend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
  margin-bottom: 8px;
}

.activity-autosend-row input[type="checkbox"] {
  margin: 0;
}

.activity-add-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #169156;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.activity-add-btn:hover {
  background: #127a48;
}

.activity-form-status {
  font-size: 12px;
  color: #169156;
  margin-left: 8px;
}

/* Notes Button (pencil icon, 28×28 circle) */
.notes-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
  vertical-align: middle;
  color: #000;
  flex-shrink: 0;
}

.notes-btn:hover {
  border-color: #169156;
  background: #f0fdf4;
  transform: scale(1.15);
}

.notes-btn svg {
  width: 12px;
  height: 12px;
}

.notes-btn.has-notes svg path:first-child {
  fill: #eab308;
}

.notes-btn.active {
  background: #e5e7eb;
  border-color: #aaa;
}

.notes-btn.has-notes.active {
  background: #e5e7eb;
  border-color: #aaa;
}

/* Pipedrive indicator — yellow fill inside pencil icon */
.notes-btn.has-pipedrive svg path:first-child {
  fill: #eab308;
}

/* Highlighted member row when inline panel is open */
tbody tr.inline-panel-active {
  background: #f0fdf4;
}

/* Inline Panel (replaces notes/email modals) */
.inline-panel-row {
  background: #fff !important;
}

.inline-panel-row:hover {
  background: #fff !important;
}

.inline-panel-row > td {
  padding: 0;
}

.inline-panel-content {
  position: relative;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s ease;
  padding: 0 16px;
}

.inline-panel-header {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  margin: 0 -16px;
  border-bottom: 2px solid #e0e0e0;
}

.stage-header-content {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.inline-panel-header:empty {
  display: none;
}

.inline-panel-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inline-panel-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
  margin-left: auto;
}

.inline-panel-close:hover {
  color: #000;
}

.inline-panel-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.inline-panel-title-row .stage-timeline-title {
  margin-bottom: 0;
}
.inline-panel-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.timeline-today-btn {
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.timeline-today-btn:hover {
  color: #666;
}

.inline-panel-body {
  padding: 12px 0;
}

.inline-panel-footer {
  padding: 8px 0 12px;
  border-top: 1px solid #eee;
}

/* Two-column combined panel layout */
.inline-panel-columns {
  display: flex;
  gap: 24px;
}

.inline-left-col {
  flex: 1;
  border-right: 2px solid #e0e0e0;
  padding-right: 24px;
  min-width: 0;
}

.inline-right-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Activity section divider in right column */
.activity-section-divider {
  position: relative;
  margin-top: 16px;
  padding-top: 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
  margin-bottom: 8px;
}

/* 2px section dividers — extend to right panel edge only, stop at center divider */
.activity-section-divider::before,
.pipedrive-notes-section::before,
.activity-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: -16px;
  height: 2px;
  background: #e0e0e0;
}

/* Whole row clickable to open Functions panel */
tbody tr[data-id] {
  cursor: pointer;
}

tbody tr[data-id]:hover .member-name {
  color: #169156;
}

/* Notes button inline in member name row */
.member-name-row .notes-btn {
  margin-left: auto;
  flex-shrink: 0;
}


/* Split send button */
.send-split-btn {
  display: inline-flex;
  position: relative;
}

.send-split-btn .send-now {
  border-radius: 4px 0 0 4px;
}

.send-split-btn .send-dropdown-toggle {
  border-radius: 0 4px 4px 0;
  border-left: 1px solid rgba(255,255,255,0.3);
  padding: 8px 8px;
  min-width: 28px;
  font-size: 10px;
}

.send-dropdown-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 4px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10;
  min-width: 280px;
}

.send-schedule-picker {
  padding: 12px 12px 8px;
}

.send-dropdown-menu .inline-dp-wrap {
  padding: 0 12px 8px;
}

.send-schedule-picker label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: #333;
}

.send-schedule-confirm {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: #169156;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.send-schedule-confirm:hover {
  background: #127a48;
}

.send-schedule-confirm-row {
  padding: 0 12px 12px;
}

/* Schedule time row */
.send-schedule-time-row {
  padding: 0 12px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.send-schedule-time-row label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.send-schedule-time-row select {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

/* Inline calendar picker (matches Time-Travel date picker) */
.inline-dp-wrap {
  position: relative;
  width: 100%;
}

.activity-form-row .inline-dp-wrap {
  margin-bottom: 4px;
}

.inline-dp {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px;
  background: #fff;
  font-size: 12px;
}

.inline-dp .dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.inline-dp .dp-month-year {
  font-weight: 700;
  font-size: 12px;
}

.inline-dp .dp-nav {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 12px;
  color: #333;
}

.inline-dp .dp-nav:hover {
  border-color: #169156;
  color: #169156;
}

.inline-dp .dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: #999;
  margin-bottom: 4px;
}

.inline-dp .dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.inline-dp .dp-day {
  padding: 6px 4px;
  text-align: center;
  border: none;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  width: 28px;
  height: 28px;
}

.inline-dp .dp-day:hover:not(.other-month):not([disabled]) {
  background: #e8f5e9;
}

.inline-dp .dp-day.today {
  font-weight: 700;
  color: #169156;
}

.inline-dp .dp-day.selected {
  background: #169156;
  color: #fff;
  font-weight: 700;
}

.inline-dp .dp-day.other-month {
  color: #ccc;
  cursor: default;
}

.inline-dp .dp-day.disabled,
.inline-dp .dp-day[disabled] {
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Date trigger button */
.dp-trigger {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.dp-trigger:hover {
  border-color: #169156;
}

/* Notes inside inline panel */
.notes-current-entry {
  display: flex;
  flex-direction: column;
}

.notes-entry-header {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notes-textarea {
  width: 100%;
  min-height: 168px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid #169156;
  border-radius: 4px;
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}

.notes-textarea:focus {
  outline: none;
  border-color: #169156;
}

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

.notes-separator {
  border: none;
  border-top: 1px solid #ddd;
  margin: 16px 0;
}

.notes-entry {
  margin-bottom: 0;
}

.notes-entry .notes-entry-header {
  margin-bottom: 4px;
}

.notes-entry-text {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
}

.notes-status {
  font-size: 12px;
  font-weight: 600;
  color: #169156;
  min-height: 20px;
}

/* Notes close button (still used in templates modal) */
.notes-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 24px;
  color: #000;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.notes-close:hover {
  background: #f5f5f5;
  border-color: #000;
}

/* Editable Cells */
.editable-cell {
  cursor: pointer;
  min-height: 20px;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.15s ease;
}

.editable-cell:hover {
  background: #f5f5f3;
}

.editable-cell.editing {
  padding: 0;
}

.cell-input {
  width: 100%;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #169156;
  border-radius: 3px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.cell-input:focus {
  outline: none;
  border-color: #169156;
}

.date-cell {
  white-space: nowrap;
  font-size: 12px;
  cursor: pointer;
  display: inline-block;
  padding: 2px 4px;
}

.date-placeholder {
  color: #999;
  font-size: 11px;
}

/* Custom Date Picker */
.dp {
  position: absolute;
  z-index: 50;
  background: #fff;
  border: 1px solid #000;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  width: 260px;
  font-family: inherit;
  user-select: none;
}

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}

.dp-month-year {
  font-size: 14px;
  font-weight: 700;
}

.dp-nav {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  color: #000;
}

.dp-nav:hover {
  background: #f5f5f3;
}

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #666;
}

.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px 12px 8px;
  gap: 2px;
}

.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-family: inherit;
  font-size: 13px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  background: none;
  color: #000;
  margin: 0 auto;
}

.dp-day:hover {
  background: #f5f5f3;
}

.dp-day.today {
  font-weight: 700;
  border: 1px solid #000;
}

.dp-day.selected {
  background: #000;
  color: #fff;
}

.dp-day.other-month {
  color: #ccc;
  cursor: default;
}

.dp-day.other-month:hover {
  background: none;
}

.dp-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #eee;
}

.dp-action {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #000;
  padding: 4px 8px;
}

.dp-action:hover {
  text-decoration: underline;
}

/* Save flash — green */
@keyframes saveFlash {
  0% { background: #dcfce7; }
  100% { background: transparent; }
}

.save-flash {
  animation: saveFlash 0.8s ease;
}

/* Name column */
.member-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.member-name-row > div {
  min-width: 0;
}

.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.member-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #666;
  flex-shrink: 0;
}

.inline-panel-avatar {
  width: 132px;
  height: 132px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Onsite location pie chart */
.onsite-chart-box {
  width: 132px;
  flex-shrink: 0;
  align-self: stretch;
  border: 1px solid #169156;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.onsite-pie-svg {
  display: block;
}
.onsite-pie-svg .pie-slice {
  cursor: pointer;
  transition: opacity 0.15s;
}
.onsite-pie-svg .pie-slice:hover {
  opacity: 0.75;
}
.onsite-chart-label {
  font-size: 11px;
  color: #000;
  text-align: center;
  margin-top: 4px;
  line-height: 1.2;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Email — black, clickable */
.member-email {
  font-size: 11px;
  color: #000;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-email:hover {
  text-decoration-color: #000;
}

.member-email.copied {
  color: #169156;
  font-weight: 600;
}

/* Price */
.price-cell {
  white-space: nowrap;
}

/* Company column — compact */

/* Start date column — no wrapping */
.start-date-cell {
  white-space: nowrap;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 0;
}

.spinner {
  width: 3.25em;
  transform-origin: center;
  animation: rotate4 2s linear infinite;
  margin: 0 auto 24px;
}

.spinner circle {
  fill: none;
  stroke: #169156;
  stroke-width: 2;
  stroke-dasharray: 1, 200;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  animation: dash4 1.5s ease-in-out infinite;
}

@keyframes rotate4 {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash4 {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dashoffset: -125px;
  }
}

.loading p {
  font-size: 14px;
  color: #666;
}

.empty-state {
  text-align: center;
  color: #999;
  font-size: 14px;
  padding: 40px 0;
}

/* =============================================
   TIME-TRAVEL
   ============================================= */

/* Time-travel button — active state */
.tt-active {
  border-color: #00a651;
}

/* Return to Today link — aligned to bottom of adjacent buttons */
.return-today {
  font-size: 11px;
  font-weight: 600;
  color: #169156;
  text-decoration: underline;
  white-space: nowrap;
}

.return-today:hover {
  color: #000;
}

/* Button active state — black border */
.trends-active {
  border-color: #000;
}

/* Time-travel date picker — disabled future days */
.dp-day.disabled {
  color: #ddd;
  cursor: not-allowed;
}

.dp-day.disabled:hover {
  background: none;
}

/* Historical mode — annotation columns grayed out */
.annotation-historical {
  position: relative;
  opacity: 0.45;
}

.ann-current-tag {
  display: block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #999;
  margin-top: 2px;
}

/* Disabled editable cell in historical mode */
.editable-cell.disabled {
  cursor: default;
  pointer-events: none;
}

/* Notes textarea readonly in historical mode */
.notes-textarea.readonly {
  background: #f5f5f3;
  color: #666;
  cursor: default;
}

/* =============================================
   ALOS TREND CHART
   ============================================= */

.alos-chart-section {
  background: #fff;
  border: 0 solid #000;
  border-radius: 4px;
  margin-bottom: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  max-height: 0;
  padding: 0 16px;
  opacity: 0;
  transition: max-height 0.5s ease-out, padding 0.5s ease-out, opacity 0.3s ease, margin-bottom 0.3s ease, border-width 0.3s ease;
}

.alos-chart-section.expanded {
  max-height: 450px;
  padding: 16px;
  opacity: 1;
  margin-bottom: 8px;
  border-width: 1px;
}

.alos-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
  margin-bottom: 8px;
}

.alos-chart-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alos-chart-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}

.alos-chart-close:hover {
  color: #000;
}

.alos-chart-wrapper {
  position: relative;
  width: 100%;
  overflow-x: auto;
}

.alos-svg {
  display: block;
}

.alos-dot {
  transition: r 0.15s ease;
}

.alos-hit:hover + .alos-dot,
.alos-hit:hover ~ .alos-dot {
  r: 5;
}

/* Chart + Info Card side-by-side layout */
.chart-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.chart-svg-col {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.chart-info-card {
  width: 180px;
  flex-shrink: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.info-card-sep {
  border-top: 1px solid #eee;
  margin: 1px 0;
}

.info-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 1px;
  margin-right: 5px;
  vertical-align: middle;
}

.info-swatch-bar {
  height: 8px;
  border: 1px solid #000;
  border-radius: 0;
}

.info-card-date {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 2px;
  border-bottom: 1px solid #eee;
  margin-bottom: 0;
}

.info-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.info-card-label {
  font-size: 13px;
  font-weight: 400;
  color: #666;
}

.info-card-value {
  font-size: 14px;
  font-weight: 700;
}

.chart-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 20px 0;
}

/* =============================================
   AI QUERY BAR
   ============================================= */


.query-response {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  border: 0 solid #000;
  margin-bottom: 0;
  transition: max-height 0.5s ease-out, opacity 0.3s ease, margin-bottom 0.3s ease, border-width 0.3s ease;
}

.query-response.expanded {
  max-height: 600px;
  opacity: 1;
  margin-bottom: 8px;
  border-width: 1px;
}

.query-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  background: #f9fafb;
}

.query-response-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #169156;
}

.query-response-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}

.query-response-close:hover {
  color: #000;
}

.query-response-body {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.4;
  max-height: 400px;
  overflow-y: auto;
}

.query-response-body strong {
  font-weight: 700;
}

.query-response-body ul, .query-response-body ol {
  margin: 4px 0;
  padding-left: 20px;
}

.query-response-body li {
  margin-bottom: 2px;
}

.query-response-body p {
  margin-bottom: 4px;
}

.query-response-body code {
  background: #f5f5f3;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 13px;
}

.qi-member-link {
  color: #00a651;
  cursor: pointer;
  font-weight: 600;
}

.qi-member-link:hover {
  background: #f0fdf4;
}

.qi-filter-link {
  color: #558564;
  cursor: pointer;
  font-weight: 600;
}

.qi-filter-link:hover {
  background: #f0fdf4;
}

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

.query-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #ddd;
  border-top-color: #169156;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* =============================================
   NUDGES PANEL
   ============================================= */

.nudge-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #dc2626;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: dd-pulse 5s infinite;
}

.nudge-badge-inner {
  top: 3px;
  right: 3px;
}

@keyframes dd-pulse {
  0%, 20%, 100% { transform: scale(1); opacity: 1; }
  5% { transform: scale(1.6); opacity: 0.7; }
  10% { transform: scale(1); opacity: 1; }
  15% { transform: scale(1.6); opacity: 0.7; }
}


#nudgesBtn {
  position: relative;
}

.nudges-panel {
  background: #fff;
  border: 0 solid #000;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  margin-bottom: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s ease-out, opacity 0.3s ease, margin-bottom 0.3s ease, border-width 0.3s ease;
}

.nudges-panel.expanded {
  max-height: 450px;
  opacity: 1;
  margin-bottom: 8px;
  border-width: 1px;
}

.nudges-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
  margin: 16px 16px 8px;
  border-bottom: 1px solid #eee;
}

.nudges-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nudges-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nudges-clear {
  padding: 3px 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #999;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nudges-clear:hover {
  border-color: #dc2626;
  color: #dc2626;
}

.nudges-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}

.nudges-close:hover {
  color: #000;
}

.nudges-body {
  padding: 12px 16px;
  max-height: calc(450px - 60px);
  overflow-y: hidden;
}

.nudge-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

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

.nudge-item:hover {
  background: #f0fdf4;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.nudge-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.nudge-icon.high {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.nudge-icon.medium {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.nudge-icon.info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

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

.nudge-dismiss {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: #bbb;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-top: 1px;
}

.nudge-dismiss:hover {
  background: #fee2e2;
  color: #dc2626;
}

.nudge-text {
  font-size: 13px;
  line-height: 1.4;
  color: #333;
}

.nudge-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #999;
  margin-top: 2px;
}

.nudges-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 20px 0;
}

/* =============================================
   DAILY DASHBOARD — 4-column layout
   ============================================= */

.dd-columns {
  display: flex;
  gap: 12px;
  height: calc(450px - 105px);
}

.dd-col {
  flex: 1;
  min-width: 0;
  background: #fafafa;
  border-radius: 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dd-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 0 0 0 0;
}

.dd-col-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dd-col-icon svg {
  width: 16px;
  height: 16px;
}

.dd-col-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
  flex: 1;
}

.dd-risk-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
}
.dd-risk-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #fff;
  color: #333;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 100;
  pointer-events: none;
}
.dd-risk-info:hover .dd-risk-tooltip {
  display: block;
}

.dd-col-desc {
  font-size: 10px;
  color: #000;
  font-weight: 400;
  padding: 4px 10px 6px;
}

.dd-col-count {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dd-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.dd-col-empty {
  font-size: 11px;
  color: #bbb;
  text-align: center;
  padding: 20px 8px;
}

.dd-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid #eee;
  border-radius: 5px;
  background: #fff;
  transition: border-color 0.15s ease;
}

.dd-member:hover {
  border-color: #ccc;
}

.dd-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.dd-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.dd-member-initials {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e5e5e5;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dd-member-text {
  min-width: 0;
  flex: 1;
}

.dd-member-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-reason {
  font-size: 10px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.dd-btn-contact,
.dd-btn-working,
.dd-btn-done,
.dd-btn-future-activity {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #000;
  transition: all 0.15s ease;
}

.dd-btn-contact svg,
.dd-btn-working svg,
.dd-btn-done svg,
.dd-btn-future-activity svg {
  width: 12px;
  height: 12px;
}

.dd-btn-contact:hover,
.dd-btn-working:hover,
.dd-btn-done:hover,
.dd-btn-future-activity:hover {
  border-color: #169156;
  background: #f0fdf4;
  transform: scale(1.15);
}

.dd-btn-working.active {
  border-color: #169156;
  background: #f0fdf4;
}

/* =============================================
   SCORECARD PANEL
   ============================================= */

#scorecardBtn {
  position: relative;
}

.scorecard-panel {
  background: #fff;
  border: 0 solid #000;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  margin-bottom: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s ease-out, opacity 0.3s ease, margin-bottom 0.3s ease, border-width 0.3s ease;
}

.scorecard-panel.expanded {
  max-height: 450px;
  opacity: 1;
  margin-bottom: 8px;
  border-width: 1px;
}

.scorecard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
  margin: 16px 16px 8px;
  border-bottom: 1px solid #eee;
}

.scorecard-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scorecard-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scorecard-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}

.scorecard-close:hover {
  color: #000;
}

.sc-winloss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: #333;
  padding: 0;
  transition: all 0.15s ease;
}
.sc-winloss-btn:hover {
  border-color: #169156;
  background: #f0fdf4;
  transform: scale(1.05);
}
.sc-winloss-btn svg {
  width: 14px;
  height: 14px;
}

/* Win/Loss popup */
.winloss-popup {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  width: 650px;
  max-width: 90vw;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.winloss-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.winloss-popup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #333;
}
.winloss-popup-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}
.winloss-popup-close:hover {
  color: #000;
}
.winloss-popup-body {
  min-height: 80px;
}

.sc-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.sc-date-btn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: border-color 0.15s ease;
  white-space: nowrap;
}

.sc-date-btn:hover {
  border-color: #000;
}

.sc-date-btn.active {
  border-color: #000;
  background: #f5f5f3;
}

.sc-date-sep {
  font-size: 11px;
  color: #999;
  font-weight: 600;
}

.sc-dp-wrap {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 60;
  margin-top: 4px;
}

.sc-dp-wrap .dp {
  position: relative;
}

.scorecard-body {
  padding: 0 16px 16px;
  max-height: calc(450px - 60px);
  overflow-y: hidden;
}

/* Full scorecard content layout: list on left, cards + chart on right */
.sc-content {
  display: flex;
  gap: 12px;
  height: calc(450px - 105px);
}

/* Stat Cards Column */
.sc-cards-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.sc-cards-row {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.sc-stat-card {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sc-card-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 1px;
}

.sc-card-icon {
  flex-shrink: 0;
  color: #333;
}

.sc-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-card-subtitle {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #999;
  margin-bottom: 2px;
}

.sc-card-chart {
  height: 80px;
}

/* Commission card body */
.sc-commission-body {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  padding: 4px 0;
}

.sc-commission-count {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.sc-commission-earned {
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

/* SPIF card styles */
.sc-spif-card {
  border-left: 3px solid #e5e5e5;
}

.sc-spif-card.sc-spif-met {
  border-left-color: #169156;
  background: #f0fdf4;
}

.sc-spif-bonus {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  color: #ccc;
  letter-spacing: -0.3px;
}

.sc-spif-bonus.active {
  color: #169156;
}

.sc-spif-body {
  margin-top: 6px;
  padding: 4px 0;
}

.sc-spif-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sc-spif-progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.sc-spif-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.sc-spif-progress-label {
  font-size: 11px;
  font-weight: 600;
  color: #666;
}

/* Clickable cards */
.sc-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.sc-card-clickable:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border-color: #ccc;
}

/* Card detail modal */
.sc-detail-modal {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  width: 560px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.sc-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.sc-detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  flex: 1;
}

.sc-detail-subtitle {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #999;
  margin-top: 2px;
}

.sc-detail-count {
  background: #f0f0f0;
  color: #333;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sc-detail-commission {
  font-size: 13px;
  font-weight: 800;
  margin-left: auto;
}

.sc-detail-close {
  flex-shrink: 0;
}

.sc-detail-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sc-detail-empty {
  padding: 24px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.sc-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #eee;
  margin-bottom: 6px;
  transition: background 0.1s ease;
}

.sc-detail-row:hover {
  background: #f9f9f8;
}

.sc-detail-row-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sc-detail-row-text {
  min-width: 0;
}

.sc-detail-row-name {
  font-size: 13px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-detail-row-meta {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-detail-row-cat {
  font-weight: 600;
}

.sc-detail-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 1px;
}

.sc-detail-row-price {
  font-size: 11px;
  color: #999;
}

.sc-detail-row-comm {
  font-size: 12px;
  font-weight: 700;
}

.sc-detail-churn-summary {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f9f9f8;
  border-radius: 6px;
  font-size: 12px;
  color: #555;
}

/* Risk + Opportunity lists — same width as CMT columns */
.sc-opps {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sc-opps-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 0;
}

.sc-opps-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #169156;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sc-opps-icon svg {
  width: 16px;
  height: 16px;
}

.sc-opps-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
  flex: 1;
}

.sc-opps-count {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #169156;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sc-opps-desc {
  font-size: 10px;
  color: #000;
  font-weight: 400;
  padding: 4px 10px 6px;
}

.sc-opps-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  background: #fafafa;
  border-radius: 0 0 4px 4px;
}

.sc-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid #eee;
  border-radius: 5px;
  background: #fff;
  transition: border-color 0.15s ease;
}

.sc-member:hover {
  border-color: #ccc;
}

.sc-member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sc-member-initials {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #e5e5e5;
  color: #666;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sc-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sc-member-text {
  min-width: 0;
  flex: 1;
}

.sc-member-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-member-date {
  font-size: 10px;
  font-weight: 400;
  color: #999;
  margin-left: 4px;
}

.sc-member-detail {
  font-size: 10px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.sc-btn-win,
.sc-btn-loss,
.sc-btn-retain {
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 24px;
  text-align: center;
  transition: all 0.15s ease;
  color: #fff;
}

.sc-btn-win {
  background: #169156;
}

.sc-btn-win:hover {
  background: #12753f;
  transform: scale(1.05);
}

.sc-btn-loss {
  background: #dc2626;
}

.sc-btn-loss:hover {
  background: #b91c1c;
  transform: scale(1.05);
}

.sc-btn-retain {
  background: #eab308;
}

.sc-btn-retain:hover {
  background: #ca9a06;
  transform: scale(1.05);
}

.sc-btn-working {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: all 0.15s ease;
}

.sc-btn-working:hover {
  border-color: #169156;
  background: #f0fdf4;
  transform: scale(1.05);
}

.sc-btn-working.active {
  border-color: #169156;
  background: #f0fdf4;
  color: #169156;
}

.sc-btn-working svg {
  width: 12px;
  height: 12px;
}

.sc-btn-future-activity {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
  transition: all 0.15s ease;
}

.sc-btn-future-activity:hover {
  border-color: #169156;
  background: #f0fdf4;
  transform: scale(1.05);
}

.sc-btn-future-activity svg {
  width: 12px;
  height: 12px;
}

.sc-opps-empty {
  font-size: 11px;
  color: #bbb;
  text-align: center;
  padding: 20px 8px;
}

/* Undo toast */
.sc-undo-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #f5f5f3;
  font-size: 11px;
  color: #666;
  animation: sc-fade-in 0.2s ease;
}

@keyframes sc-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.sc-undo-label {
  flex: 1;
  min-width: 0;
}

.sc-undo-label strong {
  color: #333;
}

.sc-undo-btn {
  padding: 2px 8px;
  border: 1px solid #999;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #333;
  transition: all 0.15s ease;
}

.sc-undo-btn:hover {
  border-color: #000;
  background: #f0f0f0;
}

/* Right: Chart area */
.sc-chart {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.sc-chart-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.sc-chart-icon {
  flex-shrink: 0;
  color: #333;
}

.sc-chart-icon svg {
  width: 14px;
  height: 14px;
}

.sc-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  flex: 1;
}

.sc-chart-totals {
  display: flex;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
}

.sc-total-win,
.sc-total-loss,
.sc-total-retain {
  padding: 3px 8px;
  border-radius: 5px;
  color: #fff;
  line-height: 1;
}

.sc-total-win { background: #169156; }
.sc-total-loss { background: #dc2626; }
.sc-total-retain { background: #eab308; }

.sc-chart-body {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: 4px 10px 0;
  position: relative;
  min-height: 0;
}

.sc-chart-svg {
  width: 100%;
  height: 100%;
}

/* =============================================
   EMAIL COMPOSE (inline panel)
   ============================================= */

/* Compose */
.email-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compose-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compose-row label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  width: 70px;
  flex-shrink: 0;
}

.compose-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.compose-contact-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.compose-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.5px 0;
}

.compose-contact-row label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  width: 70px;
  flex-shrink: 0;
}

.compose-copyable {
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

.compose-copyable:hover {
  color: #000;
  text-decoration: underline;
}

.compose-to {
  font-size: 14px;
  font-weight: 400;
}

.compose-template {
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 5px;
  margin-left: auto;
}

.compose-subject {
  flex: 1;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #169156;
  border-radius: 4px;
  width: 100%;
}

.compose-subject:focus {
  outline: none;
  border-color: #169156;
}

.compose-body {
  width: 100%;
  min-height: 168px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid #169156;
  border-radius: 4px;
  overflow-y: auto;
  outline: none;
}

.compose-body:empty::before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

.compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.compose-status {
  font-size: 12px;
  font-weight: 600;
  color: #169156;
  margin-right: auto;
}

.compose-send {
  width: auto;
  padding: 8px 16px;
  background: #169156;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.compose-send:hover {
  background: #127a48;
}

.compose-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Email Threads */
.email-threads {
  padding-top: 16px;
}

.email-threads-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000;
  margin-bottom: 12px;
}

.email-threads-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-loading {
  color: #999;
  font-size: 13px;
}

/* Thread group — collapsed by default, shows header only */
.email-thread-group {
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.email-thread-group:hover {
  border-color: #169156;
}
.email-thread-group.expanded {
  border-color: #169156;
}
.email-thread-group-header {
  padding: 12px;
  cursor: pointer;
}
.email-thread-group-header .email-thread-subject {
  margin-bottom: 4px;
}
.email-thread-count {
  font-size: 11px;
  color: #169156;
  font-weight: 600;
}
.email-thread-group-messages {
  display: none;
  border-top: 1px solid #eee;
}
.email-thread-group.expanded .email-thread-group-messages {
  display: flex;
  flex-direction: column;
}
.email-thread-group-messages .email-thread-item {
  border: none;
  border-radius: 0;
  border-top: 1px solid #f5f5f5;
}
.email-thread-group-messages .email-thread-item:first-child {
  border-top: none;
}

.email-thread-item {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.email-thread-item:hover {
  border-color: #169156;
}

.email-thread-item.expanded {
  border-color: #000;
}

.email-thread-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.email-thread-from {
  font-size: 13px;
  font-weight: 600;
}

.email-thread-date {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

.email-thread-subject {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.email-thread-snippet {
  font-size: 12px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-thread-body {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #333;
}

.email-thread-item.expanded .email-thread-body {
  display: block;
}

iframe.email-thread-body.html-body {
  width: 100%;
  min-height: 150px;
  border: none;
  white-space: normal;
}

div.email-thread-body.html-body {
  white-space: normal;
}

.email-thread-body.html-body img {
  max-width: 100%;
  height: auto;
}

.email-thread-item.expanded .email-thread-snippet {
  display: none;
}

.email-thread-account {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #999;
  margin-top: 4px;
}

.email-no-threads {
  color: #999;
  font-size: 13px;
  padding: 12px 0;
}

/* =============================================
   TEMPLATES MODAL
   ============================================= */

.templates-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 100;
  overflow: hidden;
}

.templates-modal.active {
  display: flex;
  flex-direction: column;
}

.templates-modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.templates-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.templates-title {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.templates-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  overflow-y: auto;
}

/* Tabs */
.templates-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 0;
}

.templates-tab {
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: #999;
  transition: all 0.15s ease;
}

.templates-tab:hover {
  color: #000;
}

.templates-tab.active {
  color: #169156;
  border-bottom-color: #169156;
}

/* Template List */
.templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.template-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.template-item:hover {
  border-color: #169156;
}

.template-item-name {
  font-size: 14px;
  font-weight: 600;
}

.template-item-subject {
  font-size: 12px;
  color: #666;
  margin-top: 2px;
}

.template-item-meta {
  font-size: 11px;
  color: #999;
}

/* Template Editor */
.template-editor {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #000;
  border-radius: 4px;
}

.template-editor .form-group {
  margin-bottom: 14px;
}

.template-editor .form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: #666;
}

.template-editor .form-group input {
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.template-editor .form-group input:focus {
  outline: none;
  border-color: #169156;
}

.template-editor .form-group select {
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.merge-fields-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.merge-label {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.merge-btn {
  padding: 3px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f5f5f3;
  cursor: pointer;
  color: #666;
}

.merge-btn:hover {
  border-color: #169156;
  color: #169156;
}

.tpl-body-editor {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow-y: auto;
  outline: none;
}

.tpl-body-editor:focus {
  border-color: #169156;
}

.tpl-body-editor:empty::before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

/* Rich Text Toolbar */
.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.rt-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
  color: #333;
}

.rt-btn:hover {
  border-color: #169156;
}

.rt-color-btn {
  position: relative;
}

.rt-color-swatch {
  position: absolute;
  bottom: 2px;
  left: 4px;
  right: 4px;
  height: 3px;
  background: #000;
  border-radius: 1px;
}

.rt-color-input {
  width: 0;
  height: 0;
  padding: 0;
  border: none;
  visibility: hidden;
  position: absolute;
}

[contenteditable] a {
  color: #2563eb;
  text-decoration: underline;
}

.template-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tpl-delete {
  margin-left: auto;
  color: #dc2626;
  border-color: #dc2626;
}

.tpl-delete:hover {
  background: #fef2f2;
}

/* Automations */
.automations-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.5;
}

.automations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.automation-sequence {
  border: 1px solid #eee;
  border-radius: 4px;
  overflow: hidden;
}

.auto-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fafaf8;
  border-bottom: 1px solid #eee;
}

.auto-top-row label {
  font-size: 12px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.auto-top-row select, .auto-top-row input[type="number"] {
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.auto-top-row input[type="checkbox"] {
  accent-color: #169156;
}

.automation-remove {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #dc2626;
  padding: 0 4px;
  line-height: 1;
}

.auto-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  border-left: 3px solid #169156;
  margin-left: 12px;
}

.auto-step-row + .auto-step-row {
  border-top: 1px solid #f0f0f0;
}

.auto-step-label {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  min-width: 90px;
}

.auto-step-row select {
  padding: 5px 8px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1;
  max-width: 300px;
}

.automations-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.automations-status {
  font-size: 12px;
  font-weight: 600;
  color: #169156;
}

/* Gmail Settings */
.gmail-settings {
  max-width: 400px;
}

.gmail-settings h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.gmail-account {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 4px;
}

.gmail-account p {
  font-size: 14px;
  margin-bottom: 4px;
}

.gmail-account .gmail-email {
  font-weight: 600;
  color: #169156;
}

/* =============================================
   INPUT CLEAR BUTTONS
   ============================================= */

.input-clear-wrap {
  position: relative;
  display: flex;
  align-items: center;
}


.input-clear-btn {
  position: absolute;
  right: 4px;
  display: none;
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: #999;
  padding: 0 2px;
  line-height: 1;
}

.input-clear-btn:hover {
  color: #000;
}

/* =============================================
   PIPEDRIVE CRM NOTES
   ============================================= */

.pipedrive-notes-section {
  position: relative;
  margin-top: 16px;
  padding-top: 14px;
}

.pipedrive-notes-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipedrive-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #000;
  color: #fff;
}

.pipedrive-deals-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.pipedrive-deal-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
}

.pipedrive-deal-chip.won {
  background: #fef9e7;
  color: #92400e;
  border-color: #fde68a;
}

.pipedrive-deal-chip.lost {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.pipedrive-deal-chip.open {
  background: #fef9e7;
  color: #92400e;
  border-color: #fde68a;
}

.pipedrive-note-item {
  border-left: 3px solid #eab308;
  background: #fffef5;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 0 4px 4px 0;
}

.pipedrive-note-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.pipedrive-note-date {
  font-size: 11px;
  font-weight: 700;
  color: #666;
}

.pipedrive-note-deal {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
}

.pipedrive-note-text {
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
}

.pipedrive-loading {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

.pipedrive-empty {
  font-size: 12px;
  color: #999;
  padding: 4px 0;
}

/* =============================================
   BASE NOTES
   ============================================= */

.base-notes-section {
  position: relative;
  margin-top: 16px;
  padding-top: 14px;
}

.base-notes-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: -16px;
  height: 2px;
  background: #e0e0e0;
}

.base-notes-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.base-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #2563eb;
  color: #fff;
}

.base-note-item {
  padding: 10px;
  margin: 8px 0 0;
}

.base-note-item:last-child {
  margin-bottom: 0;
}

.base-note-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.base-note-date {
  font-size: 11px;
  font-weight: 700;
  color: #666;
}

.base-note-author {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
}

.base-note-text {
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
}

.base-loading {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

.base-empty {
  font-size: 12px;
  color: #999;
  padding: 4px 0;
}

/* Base notes indicator — blue stroke on pencil icon */
.notes-btn.has-base-notes svg path:first-child {
  stroke: #3b82f6;
  stroke-width: 2.5;
}

/* When both pipedrive and base notes exist, pipedrive fill takes priority, base adds stroke */
.notes-btn.has-pipedrive.has-base-notes svg path:first-child {
  fill: #eab308;
  stroke: #3b82f6;
  stroke-width: 2.5;
}

/* Notifications Tab */
.notifications-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  color: #333;
}

.builtin-trigger-card {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 8px;
  transition: opacity 0.15s ease;
}

.builtin-trigger-card.disabled {
  opacity: 0.5;
}

.builtin-trigger-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.builtin-trigger-header input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #169156;
  cursor: pointer;
}

.builtin-trigger-header label {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.builtin-trigger-desc {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  margin-left: 24px;
}

.builtin-trigger-params {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  margin-left: 24px;
  flex-wrap: wrap;
}

.builtin-trigger-params label {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.builtin-trigger-params input {
  padding: 4px 8px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 3px;
  width: 140px;
}

.builtin-trigger-params input:focus {
  outline: none;
  border-color: #169156;
}

.custom-trigger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  margin-bottom: 6px;
}

.custom-trigger-item:hover {
  border-color: #169156;
}

.custom-trigger-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.custom-trigger-item-name {
  font-size: 14px;
  font-weight: 600;
}

.custom-trigger-item-condition {
  font-size: 12px;
  color: #666;
}

.custom-trigger-priority {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.custom-trigger-priority.high {
  background: #fef2f2;
  color: #dc2626;
}

.custom-trigger-priority.medium {
  background: #fffbeb;
  color: #d97706;
}

.custom-trigger-priority.info {
  background: #eff6ff;
  color: #2563eb;
}

.custom-trigger-editor {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 16px;
  margin-top: 12px;
  background: #fafaf8;
}

.trigger-condition-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.trigger-condition-row select,
.custom-trigger-editor select {
  width: 100%;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

.trigger-condition-row select:focus,
.custom-trigger-editor select:focus {
  outline: none;
  border-color: #169156;
}

/* Responsive */
@media (max-width: 768px) {
  .cs-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .unified-input-wrap {
    width: 100%;
  }

  .inline-panel-columns {
    flex-direction: column;
  }

  .inline-left-col {
    border-right: none;
    padding-right: 0;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
}

/* ============================
   STAGE LIFECYCLE
   ============================ */

/* Stage cell in table — matches other row text */
.stage-cell {
  font-size: 13px;
  text-align: center;
  color: #000;
}

/* Title — matches Email History header style */
.stage-timeline-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000;
  margin-bottom: 8px;
}

/* Timeline outer container — green bordered box matching compose-body */
.stage-timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #169156;
  border-radius: 4px;
  overflow: hidden;
}

/* Scrollable area — fixed height so scrollbar doesn't push box taller */
.stage-timeline-scroll {
  height: 132px;
  overflow-x: auto;
  overflow-y: hidden;
}

.stage-timeline-scroll::-webkit-scrollbar {
  height: 4px;
}

.stage-timeline-scroll::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

.stage-timeline-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Ruler — layered vertical lines with different heights via gradient sizing */
.stage-timeline-ruler {
  position: relative;
  height: 132px;
}
.timeline-dot {
  position: absolute;
  bottom: 10px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #d1d5db;
}
.timeline-dot.week { width: 3px; height: 3px; }
.timeline-dot.month { width: 6px; height: 6px; }
.timeline-dot.past { background: #111; }
.timeline-dot.onsite {
  width: 11px;
  height: 11px;
  bottom: 8px;
  background: #169156;
  z-index: 2;
  cursor: default;
}
.timeline-dot.onsite .onsite-tooltip {
  display: none;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #000;
  white-space: nowrap;
  pointer-events: none;
  background: #fff;
  padding: 0 2px;
  z-index: 3;
}
.timeline-dot.onsite:hover .onsite-tooltip {
  display: block;
}
.timeline-month-label {
  position: absolute;
  bottom: 20px;
  transform: translateX(-50%);
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}
.timeline-star {
  position: absolute;
  bottom: 7px;
  transform: translateX(-50%);
  z-index: 2;
  line-height: 0;
}
.timeline-star .star-tooltip {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  padding: 0 2px;
  z-index: 3;
}

/* Email/Calendly event markers — below stage markers, above timeline dots */
.timeline-events {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
}
.timeline-event-marker {
  position: absolute;
  bottom: 40px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: auto;
  cursor: default;
  z-index: 1;
}
.timeline-event-marker svg {
  flex-shrink: 0;
}

/* Stage node — absolutely positioned on ruler */
.stage-node {
  position: absolute;
  top: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  z-index: 1;
}
/* All stage markers on same top row */

/* Icon square — 28px */
.stage-node-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stage-icon-special {
  background: #169156;
  border: none;
}

/* Number/letter inside milestone icons */
.stage-icon-num {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* Horizontal stage label — left-aligned */
.stage-node-label {
  font-size: 11px;
  color: #000;
  white-space: nowrap;
  text-align: center;
}

.stage-node.active .stage-node-label {
  font-weight: 600;
}

.stage-node.upcoming {
  opacity: 0.45;
}

.stage-node.upcoming .stage-node-icon {
  border: 2px dashed #999;
  background: #fff !important;
}

.stage-node.upcoming .stage-node-label {
  font-style: italic;
  color: #888;
}

/* Label + health column — centered below marker */
.stage-label-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1px;
}
/* Stage health dots — horizontal row, only on active */
.stage-health-dots {
  display: flex;
  flex-direction: row;
  gap: 2px;
  margin-top: 2px;
}

.stage-health-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.stage-health-dot .health-icon { display: block; }

.stage-health-dot.red { border-color: #dc2626; color: #dc2626; }
.stage-health-dot.orange { border-color: #f97316; color: #f97316; }
.stage-health-dot.yellow { border-color: #eab308; color: #eab308; }
.stage-health-dot.green { border-color: #169156; color: #169156; }

.stage-health-dot.active.red { background: #dc2626; color: #fff; }
.stage-health-dot.active.orange { background: #f97316; color: #fff; }
.stage-health-dot.active.yellow { background: #eab308; color: #fff; }
.stage-health-dot.active.green { background: #169156; color: #fff; }

.stage-health-dot:hover {
  transform: scale(1.15);
}

/* Opportunity popup modal */
.opp-popup-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.opp-popup { background: #fff; border-radius: 8px; padding: 20px; width: 400px; max-width: 90vw; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.opp-popup-title { font-size: 14px; font-weight: 700; text-transform: uppercase; margin-bottom: 12px; color: #333; display: flex; align-items: center; gap: 8px; }
.opp-popup-title .opp-icon { width: 24px; height: 24px; border-radius: 6px; background: #169156; display: flex; align-items: center; justify-content: center; }
.opp-popup textarea { width: 100%; min-height: 100px; padding: 10px; font-family: inherit; font-size: 13px; border: 1px solid #ddd; border-radius: 4px; resize: vertical; }
.opp-popup textarea:focus { outline: none; border-color: #169156; }
.opp-popup-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.opp-popup-btn { padding: 6px 16px; border: none; border-radius: 4px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.opp-popup-save { background: #169156; color: #fff; }
.opp-popup-save:hover { background: #12753f; }
.opp-popup-cancel { background: #f5f5f5; color: #333; }
.opp-popup-cancel:hover { background: #eee; }

/* Future Activity popup fields */
.future-activity-fields {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.future-activity-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.future-activity-row label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #666;
}
.future-activity-row input,
.future-activity-row .dp-trigger {
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.future-activity-row input:focus {
  outline: none;
  border-color: #169156;
}
.future-activity-popup .opp-popup-save {
  background: #169156;
}
.future-activity-popup .opp-popup-save:hover {
  background: #12753f;
}
.future-activity-popup textarea:focus {
  border-color: #169156;
}
.fa-date-trigger {
  flex: 1;
  text-align: left;
}
.fa-date-trigger.has-value {
  border-color: #169156;
  color: #000;
}
.fa-cal-wrap {
  margin-bottom: 10px;
}
.snooze-date-trigger {
  padding: 4px 8px;
  min-width: 90px;
  text-align: left;
}
.snooze-date-trigger.has-value {
  border-color: #169156;
  color: #000;
}
.snooze-date-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.future-activity-snooze {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.snooze-toggle-label {
  font-size: 12px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}
.snooze-checkbox {
  accent-color: #169156;
}
/* snooze-date styles moved to .snooze-date-trigger */

/* Opportunity note in notes history */
.notes-opp-entry { border: 1px solid #169156; border-radius: 4px; padding: 10px; margin: 8px 0; }
.notes-opp-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.notes-opp-icon { width: 18px; height: 18px; border-radius: 4px; background: #169156; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notes-opp-label { font-size: 11px; font-weight: 700; color: #169156; text-transform: uppercase; }
.notes-opp-date { font-size: 10px; color: #999; }
.notes-opp-text { font-size: 13px; color: #333; line-height: 1.5; margin: 4px 0 6px; }
.notes-opp-actions { display: flex; gap: 4px; }

/* Bottom chart row */
/* sc-bottom-row and sc-risk-wrap removed — cards now in 2x3 grid */
