/* styles-additions-v14.css
   ============================================================
   Polish patch 3 styles:
   - Stale-activity row tinting (amber → orange → deep red)
   - Stale badges + days-overdue indicator
   - Composer "notes / topics" textarea
   - X close button on email-card-detail overlay
   - Win-probability stale-impact tooltip styling
   ============================================================ */

/* ----- Staleness tier tints (applied to activity rows) ----- */

.rr-row.staleness-late {
  border-left: 4px solid #d69e2e;          /* amber */
  background: rgba(214, 158, 46, 0.04);
}

.rr-row.staleness-critical {
  border-left: 4px solid #dd6b20;          /* orange */
  background: rgba(221, 107, 32, 0.06);
}

.rr-row.staleness-blocked {
  border-left: 4px solid #9b1c1c;          /* deep red */
  background: rgba(155, 28, 28, 0.08);
}

.rr-row.staleness-blocked:hover {
  background: rgba(155, 28, 28, 0.12);
}

/* ----- Stale badges ----- */

.staleness-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--ds-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  white-space: nowrap;
}

.staleness-badge-late {
  background: rgba(214, 158, 46, 0.18);
  color: #8a5d10;
}

.staleness-badge-critical {
  background: rgba(221, 107, 32, 0.20);
  color: #7c2d12;
}

.staleness-badge-blocked {
  background: rgba(155, 28, 28, 0.20);
  color: #7f1d1d;
  /* subtle pulse to draw attention to truly stuck items */
  animation: staleness-pulse 2s ease-in-out infinite;
}

@keyframes staleness-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

.staleness-days {
  font-size: 11px;
  color: var(--ds-text-muted, #6a6a6a);
  margin-left: 6px;
}

/* ----- Win probability stale-impact note ----- */

.win-prob-stale-note {
  display: inline-block;
  font-size: 10px;
  color: #9b1c1c;
  margin-left: 4px;
  font-style: italic;
}

/* ============================================================
   Composer notes / topics textarea
   ============================================================ */

.ec-notes-section {
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(244, 232, 195, 0.45);   /* faint cream */
  border: 1px solid rgba(160, 130, 60, 0.20);
  border-radius: 8px;
}

.ec-notes-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-text-muted, #6a6a6a);
  margin-bottom: 4px;
}

.ec-notes-hint {
  display: block;
  font-size: 11px;
  color: var(--ds-text-muted, #888);
  margin-bottom: 8px;
  font-style: italic;
}

.ec-notes-textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
}

.ec-notes-textarea:focus {
  outline: none;
  border-color: rgba(160, 130, 60, 0.50);
  box-shadow: 0 0 0 2px rgba(160, 130, 60, 0.15);
}

/* ============================================================
   Email card detail — explicit X close button (top-right)
   ============================================================ */

.ecd-x-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 6px;
  font-size: 18px;
  font-family: inherit;
  color: var(--ds-text-muted, #555);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.ecd-x-close:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.25);
  color: var(--ds-text, #1a1a1a);
}

/* The overlay-inner needs relative positioning so absolute X anchors correctly */
.ecd-overlay-inner {
  position: relative;
}

/* ============================================================
   Touch detail modal — Compose & send button styling
   ============================================================ */

.tdm-btn-compose {
  background: #1e5fa8;
  color: #fff;
  border-color: #1e5fa8;
  font-weight: 500;
}

.tdm-btn-compose:hover {
  background: #164a85;
  border-color: #164a85;
}
