/* ═══════════════════════════════════════════════════
   Opportunity Detail — Two-Pane Layout
   ═══════════════════════════════════════════════════ */

/* Page container */
.opportunity-detail-page {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
  gap: 16px;
}

/* ── Left pane (1/4 width) ── */
.opportunity-detail-left {
  display: flex;
  flex-direction: column;
  flex: 0 0 25%;
  min-height: 0;
  background: var(--bg-surface);
  border-radius: 12px;
  box-shadow: var(--header-shadow);
  overflow: hidden;
}

/* ── Right pane (3/4 width) ── */
.opportunity-detail-right {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--bg-surface);
  border-radius: 12px;
  box-shadow: var(--header-shadow);
  overflow: hidden;
}

/* ── Back button ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--text-primary);
  border-color: var(--input-focus-border);
}

/* ═══════════════════════════════════════════════════
   Left Pane — Sidebar
   ═══════════════════════════════════════════════════ */

.opp-sidebar {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Sidebar Header (back + edit) ── */
.opp-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Headline ── */
.opp-headline {
  margin-top: 12px;
  margin-bottom: 0;
}

.opp-name {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

/* ── Edit Button (view mode header) ── */
.opp-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.opp-edit-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--text-primary);
  border-color: var(--input-focus-border);
}

/* ═══════════════════════════════════════════════════
   Edit Panel — flat compact layout
   ═══════════════════════════════════════════════════ */
.opp-edit-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Header ── */
.opp-edit-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  flex-shrink: 0;
}

.opp-edit-header-center {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.opp-edit-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.opp-edit-subtitle {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary, #9ca3af);
  white-space: nowrap;
}

.opp-edit-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: var(--accent-color, #3b82f6);
  color: #fff;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
  flex-shrink: 0;
}

.opp-edit-save-btn:hover:not(:disabled) {
  background: var(--accent-hover, #2563eb);
}

.opp-edit-save-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.opp-edit-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.opp-edit-spinner {
  animation: opp-spin 0.8s linear infinite;
}

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

/* ── Scrollable body ── */
.opp-edit-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Form field groups ── */
.opp-edit-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.opp-edit-group-grow {
  flex: 1;
  min-height: 0;
}

.opp-edit-group-grow .opp-edit-textarea {
  flex: 1;
  min-height: 60px;
}

.opp-edit-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #9ca3af);
}

.opp-edit-input {
  width: 100%;
  padding: 6px 9px;
  font-size: 13px;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  background: var(--bg-surface, #fff);
  color: var(--text-primary);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.opp-edit-input:focus {
  border-color: var(--accent-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.opp-edit-textarea {
  width: 100%;
  padding: 7px 9px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  background: var(--bg-surface, #fff);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.opp-edit-textarea:focus {
  border-color: var(--accent-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Side-by-side row */
.opp-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Read-only strip ── */
.opp-edit-readonly-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color, #e5e7eb);
  margin-top: auto;
}

.opp-edit-readonly {
  display: flex;
  align-items: center;
  gap: 5px;
}

.opp-edit-readonly-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #9ca3af);
}

.opp-edit-readonly-value {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
}

/* ── Sticky footer ── */
.opp-edit-footer {
  flex-shrink: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.opp-edit-cancel-btn {
  width: 100%;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.opp-edit-cancel-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.opp-edit-cancel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   Dropdown selector — overlay panel
   ═══════════════════════════════════════════════════ */
.opp-edit-dropdown {
  position: relative;
}

.opp-edit-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 9px;
  font-size: 13px;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  background: var(--bg-surface, #fff);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  text-align: left;
}

.opp-edit-dropdown-trigger:focus,
.opp-edit-dropdown-trigger:active {
  border-color: var(--accent-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.opp-edit-dropdown-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.opp-edit-dropdown-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.opp-edit-dropdown-value.placeholder {
  color: var(--text-tertiary, #9ca3af);
}

.opp-edit-dropdown-chevron {
  flex-shrink: 0;
  opacity: 0.35;
  transition: transform 0.2s ease;
}

.opp-edit-dropdown-chevron.open {
  transform: rotate(180deg);
}

/* Flyout panel — fixed position set via inline style to escape overflow containers */
.opp-edit-dropdown-panel {
  /* position, top, left, width set inline via JS */
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 10px;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: opp-dropdown-in 0.12s ease-out;
}

@keyframes opp-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Search input inside panel */
.opp-edit-dropdown-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-elevated, rgba(249, 250, 251, 0.6));
}

.opp-edit-dropdown-search-wrap svg {
  flex-shrink: 0;
  opacity: 0.3;
}

.opp-edit-dropdown-search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-primary);
  padding: 0;
}

.opp-edit-dropdown-search::placeholder {
  color: var(--text-tertiary, #9ca3af);
}

/* Options list */
.opp-edit-dropdown-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.opp-edit-dropdown-options::-webkit-scrollbar {
  width: 4px;
}

.opp-edit-dropdown-options::-webkit-scrollbar-track {
  background: transparent;
}

.opp-edit-dropdown-options::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

/* Individual option */
.opp-edit-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  font-size: 13px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.opp-edit-dropdown-item:hover {
  background: var(--nav-hover-bg, rgba(59, 130, 246, 0.06));
}

.opp-edit-dropdown-item.selected {
  background: rgba(59, 130, 246, 0.08);
}

.opp-edit-dropdown-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.opp-edit-dropdown-item.selected .opp-edit-dropdown-item-label {
  color: var(--accent-color, #3b82f6);
  font-weight: 500;
}

.opp-edit-dropdown-item-none {
  color: var(--text-tertiary, #9ca3af);
  font-style: italic;
}

.opp-edit-dropdown-item.selected .opp-edit-dropdown-item-none {
  color: var(--accent-color, #3b82f6);
  font-style: normal;
}

.opp-edit-dropdown-item svg {
  flex-shrink: 0;
  color: var(--accent-color, #3b82f6);
}

/* Stacked item layout (name + subtitle) */
.opp-edit-dropdown-item-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.opp-edit-dropdown-item-sub {
  font-size: 10.5px;
  color: var(--text-tertiary, #9ca3af);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opp-edit-dropdown-item-badge {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent-color, #3b82f6);
  background: color-mix(in srgb, var(--accent-color, #3b82f6) 12%, transparent);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Site chip (current site with clear button) */
.opp-edit-site-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #d1d5db);
  background: var(--surface-secondary, #f9fafb);
  min-height: 32px;
}

.opp-edit-site-chip.opp-edit-site-empty {
  border-style: dashed;
}

.opp-edit-site-name {
  flex: 1;
  font-size: 12.5px;
  color: var(--text-primary, #1f2937);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opp-edit-site-name.placeholder {
  color: var(--text-tertiary, #9ca3af);
  font-style: italic;
}

.opp-edit-site-clear {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--text-tertiary, #9ca3af);
  color: white;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}

.opp-edit-site-clear:hover {
  background: var(--text-secondary, #6b7280);
}

.opp-edit-site-clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty / loading placeholder */
.opp-edit-dropdown-empty {
  padding: 16px 10px;
  font-size: 12px;
  color: var(--text-tertiary, #9ca3af);
  text-align: center;
}

.opp-edit-cancel-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.opp-edit-cancel-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.opp-edit-cancel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.opp-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ── Days to close countdown (sidebar) ── */
.opp-close-countdown {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.08);
  color: #16a34a;
}

.opp-close-countdown.soon {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.opp-close-countdown.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.opp-close-number {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.opp-close-unit {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.opp-number {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

.opp-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── FutureLead: muted purple ── */
.opp-status-badge.status-future {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

/* ── New: teal ── */
.opp-status-badge.status-new {
  background: rgba(20, 184, 166, 0.12);
  color: #0d9488;
}

/* ── Internal Review: amber ── */
.opp-status-badge.status-review {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

/* ── Active: green ── */
.opp-status-badge.status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.opp-status-badge.status-open {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.opp-status-badge.status-won {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.opp-status-badge.status-lost {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.opp-status-badge.status-closed {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

.opp-status-badge.status-inactive {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

/* ── Equivalency dashed-border + tooltip ── */
.opp-status-badge.status-equiv {
  border: 1px dashed currentColor;
  cursor: default;
  position: relative;
}

.opp-status-badge.status-equiv[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg, #1e293b);
  color: var(--tooltip-color, #f8fafc);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.opp-status-badge.status-equiv[data-tooltip]:hover::after {
  opacity: 1;
}

.opp-stage-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  color: var(--accent-primary);
}

.opp-type-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  background: var(--nav-hover-bg);
  color: var(--text-secondary);
}

.opp-outcome-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.opp-outcome-badge.outcome-won {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.opp-outcome-badge.outcome-lost {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.opp-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}

/* Heat dots */
.opp-heat-dots {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.opp-heat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.2s;
}

/* ── Hot ── */
.opp-rating-badge.heat-hot {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
  animation: hotPulse 2s ease-in-out infinite;
}

.opp-rating-badge.heat-hot .opp-heat-dot.filled {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.6);
}

@keyframes hotPulse {

  0%,
  100% {
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.2);
  }

  50% {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  }
}

/* ── Warm ── */
.opp-rating-badge.heat-warm {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.opp-rating-badge.heat-warm .opp-heat-dot.filled {
  background: #f59e0b;
}

/* ── Cold ── */
.opp-rating-badge.heat-cold {
  background: rgba(56, 189, 248, 0.12);
  color: #0ea5e9;
}

.opp-rating-badge.heat-cold .opp-heat-dot.filled {
  background: #38bdf8;
}

/* ── Neutral ── */
.opp-rating-badge.heat-neutral {
  background: var(--nav-hover-bg);
  color: var(--text-secondary);
}

.opp-rating-badge.heat-neutral .opp-heat-dot.filled {
  background: var(--text-muted);
}

/* ── Probability badge ── */
.opp-probability-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.opp-prob-ring {
  flex-shrink: 0;
}

.opp-probability-badge.prob-high {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.opp-probability-badge.prob-mid {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.opp-probability-badge.prob-low {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ── Byline (Sales Rep) ── */
.opp-byline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.opp-byline-rep {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opp-byline-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.opp-byline-avatar.secondary {
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.opp-byline-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.opp-byline-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.opp-byline-role {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* ── Divider ── */
.opp-sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

/* ── Sidebar Info ── */
.opp-sidebar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Info rows (address, contact) */
.opp-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.opp-info-row:hover {
  background: var(--nav-hover-bg);
}

/* Clickable row (company link) */
.opp-info-row-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.opp-info-arrow {
  flex-shrink: 0;
  align-self: center;
  color: var(--text-muted);
  stroke: var(--text-muted);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.opp-info-row-link:hover .opp-info-arrow {
  opacity: 1;
  transform: translateX(0);
}

.opp-info-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  stroke: var(--text-muted);
  margin-top: 2px;
}

.opp-info-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.opp-info-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.opp-info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
}

.opp-info-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 2px;
}

.opp-info-muted {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Phone — prominent */
.opp-info-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: #16a34a;
  text-decoration: none;
  transition: opacity 0.15s;
}

.opp-info-phone svg {
  flex-shrink: 0;
  stroke: #16a34a;
}

.opp-info-phone:hover {
  opacity: 0.75;
}

/* Email — secondary to phone */
.opp-info-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}

.opp-info-email svg {
  flex-shrink: 0;
  color: var(--text-muted);
  stroke: var(--text-muted);
}

.opp-info-email:hover {
  color: var(--accent);
}

/* Description section — boxed */
.opp-desc-section {
  margin-top: 4px;
  padding-top: 4px;
}

.opp-desc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 8px;
  color: var(--text-muted);
}

.opp-desc-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.opp-desc-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--nav-hover-bg);
}

.opp-desc-text {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  word-break: break-word;
}

.opp-sidebar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════
   Right Pane — Tab Bar
   ═══════════════════════════════════════════════════ */

.tab-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-surface);
  position: relative;
  z-index: 10;
  overflow: visible;
  min-width: 0;
}

.tab-btn {
  position: relative;
  padding: 14px 16px 12px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}

.tab-btn::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background 0.15s;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--text-primary);
  font-weight: 600;
}

.tab-btn.active::after {
  background: var(--input-focus-border);
}

.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 600;
  background: var(--nav-hover-bg);
  color: var(--text-secondary);
}

.tab-btn.active .tab-count-badge {
  background: var(--input-focus-border);
  color: #fff;
  font-weight: 700;
}

/* ── Detail pane body ── */
.opportunity-detail-right .detail-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════
   Overview Tab
   ═══════════════════════════════════════════════════ */

.overview-tab {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Pipeline Banner ── */
.ov-pipeline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ov-pipeline-stages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ov-pipeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ov-pipeline-chip.stage {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.ov-pipeline-chip.priority {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.ov-pipeline-chip.rating {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.ov-pipeline-chip svg {
  stroke: currentColor;
}

/* Close countdown */
.ov-close-countdown {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--nav-hover-bg);
}

.ov-close-countdown.soon {
  background: rgba(245, 158, 11, 0.08);
}

.ov-close-countdown.overdue {
  background: rgba(239, 68, 68, 0.08);
}

.ov-close-number {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.ov-close-countdown.soon .ov-close-number {
  color: #d97706;
}

.ov-close-countdown.overdue .ov-close-number {
  color: #dc2626;
}

.ov-close-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.ov-close-countdown.soon .ov-close-unit {
  color: #d97706;
}

.ov-close-countdown.overdue .ov-close-unit {
  color: #dc2626;
}

/* ── KPI Strip ── */
.ov-kpi-strip {
  display: flex;
  gap: 2px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border-subtle);
}

.ov-kpi-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 8px;
  background: var(--bg-surface);
  min-width: 0;
}

.ov-kpi-card.primary {
  background: var(--nav-hover-bg);
}

.ov-kpi-card.accent {
  background: var(--nav-hover-bg);
}

.ov-kpi-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ov-kpi-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.ov-kpi-value.healthy {
  color: #16a34a;
}

.ov-kpi-value.moderate {
  color: #d97706;
}

.ov-kpi-value.low {
  color: #ea580c;
}

.ov-kpi-value.negative {
  color: #dc2626;
}

.ov-kpi-pct {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.ov-kpi-pct.healthy {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.ov-kpi-pct.moderate {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

.ov-kpi-pct.low {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}

.ov-kpi-pct.negative {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.ov-kpi-sub {
  font-size: 9px;
  color: var(--text-secondary);
}

/* ── Main Grid (Timeline + Forecast side by side) ── */
.ov-main-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  align-items: start;
}

/* ── Sections ── */
.ov-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ov-section-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ov-section-title svg {
  flex-shrink: 0;
  stroke: var(--text-muted);
}

.ov-age-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--nav-hover-bg);
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Timeline ── */
.ov-timeline-section {
  border-right: 1px solid var(--border-subtle);
  padding-right: 20px;
}

.ov-timeline {
  display: flex;
  flex-direction: column;
  padding-left: 4px;
}

.ov-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  padding-bottom: 20px;
  padding-left: 16px;
}

.ov-timeline-item:not(.last)::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
}

.ov-timeline-item.highlight:not(.last)::before {
  background: linear-gradient(to bottom, var(--accent), var(--border-subtle));
}

.ov-timeline-dot {
  position: absolute;
  left: 3px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.ov-timeline-dot.highlight {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ov-timeline-item.last .ov-timeline-dot {
  background: var(--accent);
}

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

.ov-timeline-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.ov-timeline-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.ov-timeline-item.highlight .ov-timeline-label {
  font-weight: 600;
}

/* Activity dot colors for overview timeline */
.ov-timeline-dot.ov-dot-created {
  background: #ca8a04;
  border-color: #ca8a04;
}

.ov-timeline-dot.ov-dot-setup {
  background: #6b7280;
  border-color: #6b7280;
}

.ov-timeline-dot.ov-dot-review {
  background: #ea580c;
  border-color: #ea580c;
}

.ov-timeline-dot.ov-dot-sent {
  background: #2563eb;
  border-color: #2563eb;
}

.ov-timeline-dot.ov-dot-confirmed {
  background: #059669;
  border-color: #059669;
}

.ov-timeline-dot.ov-dot-sent-confirmed {
  background: #0891b2;
  border-color: #0891b2;
}

.ov-timeline-dot.ov-dot-revision {
  background: #d97706;
  border-color: #d97706;
}

.ov-timeline-dot.ov-dot-finalized {
  background: #7c3aed;
  border-color: #7c3aed;
}

.ov-timeline-dot.ov-dot-converted {
  background: #db2777;
  border-color: #db2777;
}

.ov-timeline-dot.ov-dot-generated {
  background: #0d9488;
  border-color: #0d9488;
}

.ov-timeline-dot.ov-dot-default {
  background: var(--text-muted, #aaa);
  border-color: var(--text-muted, #aaa);
}

/* Activity label text colors for overview timeline */
.ov-timeline-label.ov-text-created {
  color: #ca8a04;
}

.ov-timeline-label.ov-text-setup {
  color: #6b7280;
}

.ov-timeline-label.ov-text-review {
  color: #ea580c;
}

.ov-timeline-label.ov-text-sent {
  color: #2563eb;
}

.ov-timeline-label.ov-text-confirmed {
  color: #059669;
}

.ov-timeline-label.ov-text-sent-confirmed {
  color: #0891b2;
}

.ov-timeline-label.ov-text-revision {
  color: #d97706;
}

.ov-timeline-label.ov-text-finalized {
  color: #7c3aed;
}

.ov-timeline-label.ov-text-converted {
  color: #db2777;
}

.ov-timeline-label.ov-text-generated {
  color: #0d9488;
}

/* Collapsed timeline gap button */
.ov-timeline-gap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 20px 24px;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.15s;
  position: relative;
}

.ov-timeline-gap::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(to bottom,
      var(--border-subtle) 0px,
      var(--border-subtle) 3px,
      transparent 3px,
      transparent 6px);
}

.ov-gap-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--bg-surface-raised, rgba(107, 114, 128, 0.06));
  border: 1px dashed var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: all 0.15s;
}

.ov-gap-arrow {
  opacity: 0;
  transform: translateX(-2px);
  transition: all 0.15s;
  color: var(--accent);
}

.ov-timeline-gap:hover .ov-gap-pill {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}

.ov-timeline-gap:hover .ov-gap-arrow {
  opacity: 1;
  transform: translateX(0);
}

[data-theme="dark"] .ov-gap-pill {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .ov-timeline-gap:hover .ov-gap-pill {
  background: rgba(99, 102, 241, 0.1);
}

/* ── Compact Activity-Style Timeline (Overview) ── */
.ov-tl-entry {
  display: flex;
  gap: 10px;
  min-height: 36px;
  border-radius: 5px;
  padding: 3px 5px;
  margin: 0 -5px;
  transition: background 0.12s ease;
  cursor: default;
}

.ov-tl-entry:hover {
  background: var(--nav-hover-bg, rgba(99, 102, 241, 0.06));
}

.ov-tl-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
  padding-top: 1px;
}

.ov-tl-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ov-tl-dot-milestone {
  background: rgba(107, 114, 128, 0.08);
  color: var(--text-muted);
}

.ov-tl-dot.ov-tl-dot-highlight {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.ov-tl-dot.ov-dot-created {
  background: rgba(202, 138, 4, 0.12);
  color: #ca8a04;
}

.ov-tl-dot.ov-dot-setup {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

.ov-tl-dot.ov-dot-review {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
}

.ov-tl-dot.ov-dot-sent {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.ov-tl-dot.ov-dot-confirmed {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.ov-tl-dot.ov-dot-sent-confirmed {
  background: rgba(8, 145, 178, 0.12);
  color: #0891b2;
}

.ov-tl-dot.ov-dot-revision {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
}

.ov-tl-dot.ov-dot-finalized {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.ov-tl-dot.ov-dot-converted {
  background: rgba(219, 39, 119, 0.12);
  color: #db2777;
}

.ov-tl-dot.ov-dot-generated {
  background: rgba(13, 148, 136, 0.12);
  color: #0d9488;
}

.ov-tl-dot.ov-dot-default {
  background: rgba(107, 114, 128, 0.08);
  color: var(--text-muted);
}

.ov-tl-line {
  width: 2px;
  flex: 1;
  background: var(--card-border, var(--border-subtle));
  min-height: 10px;
}

.ov-tl-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 14px;
  min-width: 0;
}

/* Condensed overrides for activity entries inside the overview timeline */
.ov-tl-body .at-open-badge {
  font-size: 8px;
  padding: 1px 5px;
}

.ov-tl-body .at-content-header {
  margin-bottom: 2px;
}

.ov-tl-meta {
  gap: 7px;
}

.ov-tl-meta .at-user {
  font-size: 10px;
}

.ov-tl-meta .at-timestamp {
  font-size: 10px;
}

.ov-tl-milestone {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.ov-tl-milestone-highlight {
  color: #6366f1;
  font-weight: 600;
}

.ov-tl-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Gap button (compact activity-style) */
.ov-tl-gap-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0 10px 30px;
  border: none;
  background: none;
  cursor: pointer;
}

.ov-tl-gap-btn:hover .ov-gap-pill {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}

.ov-tl-gap-btn:hover .ov-gap-arrow {
  opacity: 1;
  transform: translateX(0);
}

[data-theme="dark"] .ov-tl-gap-btn:hover .ov-gap-pill {
  background: rgba(99, 102, 241, 0.1);
}

/* ── Timeline entry hover popover ── */
.ov-entry-popover {
  position: fixed;
  z-index: 900;
  width: 280px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateY(-100%);
  animation: ov-popover-in 0.15s ease-out;
}

/* ── Quick Stats ── */
.ov-quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.ov-quick-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--nav-hover-bg);
}

.ov-quick-stat svg {
  flex-shrink: 0;
  stroke: var(--text-muted);
}

/* ── Forecast Table ── */
.ov-forecast-section {
  min-width: 0;
}

.ov-forecast-table-wrap {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: visible;
  position: relative;
}

.ov-forecast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.ov-forecast-table th {
  text-align: left;
  padding: 5px 8px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--nav-hover-bg);
  border-bottom: 1px solid var(--border-subtle);
}

.ov-forecast-table td {
  padding: 4px 8px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.ov-forecast-table tbody tr:last-child td {
  border-bottom: 1px solid var(--border-subtle);
}

.ov-forecast-table tbody tr:hover {
  background: var(--nav-hover-bg);
}

.ov-forecast-table tfoot td {
  padding: 5px 8px;
  font-size: 11.5px;
  background: var(--nav-hover-bg);
  border-bottom: none;
}

.ov-forecast-table .col-product {
  width: 50%;
  min-width: 0;
}

.ov-forecast-table .col-revenue {
  width: 30%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ov-forecast-table .col-margin {
  width: 15%;
  text-align: center;
}

.ov-product-id {
  display: inline;
  font-weight: 600;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 10.5px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-product-desc {
  display: inline;
  font-size: 10.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
  margin-left: 6px;
}

.ov-margin-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.ov-margin-badge.healthy {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.ov-margin-badge.moderate {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

.ov-margin-badge.low {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}

.ov-margin-badge.negative {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.ov-margin-badge.neutral {
  background: var(--nav-hover-bg);
  color: var(--text-muted);
}

/* ── Cancellation styles — Forecast Table ── */
.ov-row-cancelled-full td {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

.ov-row-cancelled-full:hover td {
  opacity: 0.65;
}

.ov-row-cancelled-partial {
  border-left: 2px solid #d97706;
}

.ov-cancel-badge {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 16px;
  text-decoration: none;
}

.ov-cancel-badge.full {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.ov-cancel-badge.partial {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

.ov-qty-effective {
  font-weight: 600;
}

.ov-qty-original {
  font-size: 9.5px;
  color: var(--text-muted);
}

.ov-product-inline {
  display: inline;
}

/* Qty badge — inline before product name */
.ov-qty-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  background: var(--nav-hover-bg);
  color: var(--text-secondary);
  margin-right: 6px;
  vertical-align: middle;
  line-height: 16px;
  white-space: nowrap;
}

.ov-qty-badge.partial {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.ov-qty-badge.cancelled {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.ov-qty-orig {
  font-size: 9px;
  opacity: 0.7;
}

.cancelled-kpi .ov-kpi-value {
  color: #dc2626;
}

.ov-forecast-more {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  background: var(--nav-hover-bg);
  border-top: 1px solid var(--border-subtle);
}

/* ── Product Hover Popover ── */
.ov-product-popover {
  position: fixed;
  z-index: 50;
  transform: translateY(-100%);
  width: 280px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 12px 14px;
  pointer-events: auto;
  animation: ov-popover-in 0.15s ease-out;
}

@keyframes ov-popover-in {
  from {
    opacity: 0;
    transform: translateY(calc(-100% + 6px));
  }

  to {
    opacity: 1;
    transform: translateY(-100%);
  }
}

.ov-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ov-popover-id {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.ov-popover-status {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--status-active-bg, rgba(34, 197, 94, 0.12));
  color: var(--status-active-color, #22c55e);
}

.ov-popover-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ov-popover-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 10.5px;
}

.ov-popover-label {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 9px;
  flex-shrink: 0;
}

.ov-popover-value {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-popover-financials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.ov-popover-fin-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ov-popover-fin-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ov-popover-fin-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.ov-popover-cancel {
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

.ov-popover-cancel--full {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.ov-popover-flag {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.ov-forecast-table tbody tr {
  cursor: default;
}

.ov-forecast-row-clickable {
  cursor: pointer;
  transition: background 0.1s ease;
}

.ov-forecast-row-clickable:active {
  background: var(--nav-active-bg, rgba(0, 0, 0, 0.06));
}

/* ── Class Breakdown Bars ── */
.ov-class-breakdown {
  margin-top: 14px;
}

.ov-class-breakdown-title {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.ov-class-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ov-class-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ov-class-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-class-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--nav-hover-bg);
  overflow: hidden;
}

.ov-class-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  min-width: 2px;
  transition: width 0.3s ease;
}

.ov-class-amount {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 50px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ov-empty-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 12px 0;
}

/* ── Sidebar Footer (Details) ── */
.opp-sidebar-footer {
  margin-top: auto;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.opp-footer-item {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.opp-footer-item::after {
  content: "\00b7";
  margin-left: 10px;
  color: var(--text-muted);
  opacity: 0.5;
}

.opp-footer-item:last-child::after {
  display: none;
}

/* ── Sidebar header actions ── */
.opp-sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* ── Delete button (view mode) ── */
.opp-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  transition: all 0.15s ease;
}

.opp-delete-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

/* ── Delete confirmation modal ── */
.opp-delete-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  animation: opp-fade-in 0.15s ease;
}

@keyframes opp-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.opp-delete-modal {
  width: 380px;
  max-width: 90vw;
  padding: 24px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: opp-modal-in 0.2s ease;
}

@keyframes opp-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.opp-delete-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.opp-delete-msg {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.opp-delete-msg strong {
  color: var(--text-primary);
}

.opp-delete-error {
  font-size: 12px;
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 10%, transparent);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 0 12px;
}

.opp-delete-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.opp-delete-confirm-btn {
  padding: 6px 18px;
  border: none;
  border-radius: 7px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.opp-delete-confirm-btn:hover:not(:disabled) {
  background: #dc2626;
}

.opp-delete-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   Forecasts Tab
   ═══════════════════════════════════════════════════ */

.forecasts-tab {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.forecasts-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.forecasts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.forecasts-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--nav-hover-bg);
  border-bottom: 1px solid var(--border-subtle);
}

.forecasts-table th.num,
.forecasts-table td.num {
  text-align: right;
}

.forecasts-table td {
  padding: 10px 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.forecasts-table tbody tr:last-child td {
  border-bottom: none;
}

.forecasts-table tbody tr:hover {
  background: var(--nav-hover-bg);
}

.forecast-status-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--nav-hover-bg);
  color: var(--text-secondary);
}

.forecast-status-badge.included {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.forecasts-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.forecast-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--nav-hover-bg);
  min-width: 0;
  flex: 1 1 120px;
  overflow: hidden;
}

.forecast-summary-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.forecast-summary-value {
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════
   Notes Tab
   ═══════════════════════════════════════════════════ */

.notes-tab {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notes-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.notes-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--text-secondary);
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.notes-add-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent, #60a5fa);
}

.notes-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Compose / Edit area ── */

.note-compose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--nav-hover-bg);
  border: 1px solid var(--border-subtle);
}

.note-compose-textarea,
.note-edit-textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 13px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.note-compose-textarea:focus,
.note-edit-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.note-compose-textarea:disabled,
.note-edit-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.note-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-flag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.note-flag-toggle input[type="checkbox"] {
  display: none;
}

.flag-icon {
  color: var(--text-muted);
  transition: color 0.15s;
}

.flag-icon.flagged {
  color: #f59e0b;
}

.note-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-btn-cancel {
  padding: 5px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.note-btn-cancel:hover {
  background: var(--nav-hover-bg);
  color: var(--text-primary);
}

.note-btn-save {
  padding: 5px 16px;
  border: none;
  border-radius: 7px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.note-btn-save:hover:not(:disabled) {
  filter: brightness(1.1);
}

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

.note-error {
  font-size: 11px;
  color: #ef4444;
  font-weight: 500;
}

/* ── Notes list ── */

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

/* ── Note card ── */

.note-card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: var(--nav-hover-bg);
  border-left: 3px solid var(--border-subtle);
  transition: border-color 0.15s;
}

.note-card.flagged {
  border-left-color: #f59e0b;
}

.note-card.editing {
  border-left-color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-left-width: 3px;
  padding: 14px 16px;
}

/* ── Card header ── */

.note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.note-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.note-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.note-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.note-author-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.note-author-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.note-author-info .note-timestamp {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.note-type-badge {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
  white-space: nowrap;
}

.note-flag-icon {
  color: #f59e0b;
  flex-shrink: 0;
}

.note-timestamp {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Card body ── */

.note-card-body {
  padding: 12px 16px;
}

.note-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Note source badges (activity vs time entry) ── */

.note-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.note-source-activity {
  background: color-mix(in srgb, #6366f1 12%, transparent);
  color: #818cf8;
}

.note-source-time-entry {
  background: color-mix(in srgb, #10b981 12%, transparent);
  color: #34d399;
}

.note-card-time-entry {
  border-left-color: #10b981;
}

/* ── Card sub-header (activity name) ── */

.note-card-subheader {
  padding: 4px 16px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Note action menu ── */

.note-menu-wrap {
  position: relative;
}

.note-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.note-menu-btn:hover {
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-primary);
}

.note-menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 120px;
  padding: 4px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.note-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}

.note-menu-item:hover {
  background: var(--nav-hover-bg);
}

.note-menu-item.danger {
  color: #ef4444;
}

.note-menu-item.danger:hover {
  background: color-mix(in srgb, #ef4444 10%, transparent);
}

/* ── Delete confirmation modal ── */

.note-delete-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.note-delete-modal {
  width: 380px;
  max-width: 90vw;
  padding: 24px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.note-delete-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.note-delete-msg {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.note-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.note-btn-delete {
  padding: 6px 18px;
  border: none;
  border-radius: 7px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.note-btn-delete:hover:not(:disabled) {
  background: #dc2626;
}

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

/* ═══════════════════════════════════════════════════
   Contacts Tab
   ═══════════════════════════════════════════════════ */

.contacts-tab {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--nav-hover-bg);
}

.contact-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-role {
  font-size: 12px;
  color: var(--accent-primary);
  font-weight: 500;
}

.contact-company {
  font-size: 12px;
  color: var(--text-secondary);
}

.contact-notes {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.contact-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.contact-badge.referral {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

/* ── Activity tab ── */
.activity-tab {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Quotes tab ── */
.quotes-tab {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ── View toggle bar ── */
.quotes-view-bar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.quotes-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--nav-hover-bg);
  border-radius: 8px;
  padding: 3px;
}

.quotes-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.quotes-view-tab:hover {
  color: var(--text-primary);
}

.quotes-view-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.quotes-view-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  background: var(--input-focus-border);
  color: #fff;
}

/* ── List view layout ── */
.quotes-list-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.quotes-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--nav-hover-bg);
  border-radius: 10px;
  min-height: 0;
}

.quotes-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quotes-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.quotes-new-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--accent-primary));
}

.quotes-list-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quotes-list-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.quotes-list-item:hover {
  background: var(--bg-surface);
}

.quotes-list-item.active {
  background: var(--bg-surface);
  border-color: var(--input-focus-border);
}

.quotes-list-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quotes-list-item-date {
  font-size: 11px;
  color: var(--text-muted);
}

.quotes-list-empty {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 0;
}

.quotes-list-error {
  color: #ef4444;
}

.quotes-list-empty-link {
  display: inline;
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Detail area ── */
.quotes-detail-area {
  display: flex;
  flex-direction: column;
  background: var(--nav-hover-bg);
  border-radius: 10px;
  overflow: hidden;
  min-height: 0;
}

.quotes-detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  gap: 16px;
  flex: 1;
  padding: 16px;
  min-height: 0;
}

.quotes-detail-info {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── Compact header ── */
.quotes-detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.quotes-detail-header-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  justify-content: space-between;
}

.quotes-detail-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.quotes-detail-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.quotes-detail-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.quotes-detail-actions {
  display: flex;
  gap: 4px;
}

.quotes-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.quotes-action-btn:hover {
  background: var(--nav-hover-bg);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.quotes-action-btn:active {
  transform: scale(0.93);
}

.quotes-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.quotes-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quotes-detail-meta-loading {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Line items table ── */
.quotes-line-items {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-top: 12px;
}

.quotes-line-items-header {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.quotes-line-items-header .quotes-li-col {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.quotes-line-items-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.quotes-line-item {
  display: flex;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 50%, transparent);
  transition: background 0.1s;
}

.quotes-line-item:hover {
  background: var(--nav-hover-bg);
}

.quotes-line-item.cancelled {
  opacity: 0.45;
  text-decoration: line-through;
}

.quotes-line-item.partial-cancelled {
  opacity: 0.7;
}

.quotes-li-partial-tag {
  display: inline;
  margin-left: 6px;
  font-size: 10px;
  color: var(--warning, #e6a817);
  font-weight: 600;
}

/* ── Summary bar ── */
.quotes-summary-bar {
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  background: var(--nav-hover-bg);
  border-radius: 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.quotes-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.quotes-summary-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.quotes-summary-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.quotes-summary-value.positive {
  color: var(--success, #22c55e);
}

.quotes-summary-value.negative {
  color: var(--error, #ef4444);
}

/* ── Cancelled accordion ── */
.quotes-cancelled-accordion {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-top: 1px solid var(--border-subtle);
  user-select: none;
  transition: color 0.15s;
}

.quotes-cancelled-accordion:hover {
  color: var(--text-primary);
}

.quotes-accordion-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.quotes-accordion-chevron.expanded {
  transform: rotate(90deg);
}

.quotes-li-col {
  font-size: 12px;
  color: var(--text-primary);
}

.quotes-li-num {
  width: 28px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.quotes-li-desc {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quotes-li-class {
  display: inline;
  margin-left: 6px;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.quotes-li-qty {
  width: 40px;
  flex-shrink: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.quotes-li-price {
  width: 90px;
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.quotes-line-items-empty {
  padding: 20px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Quote ID footer ── */
.quotes-detail-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  flex-shrink: 0;
}

.quotes-detail-quote-id {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 10px;
  color: color-mix(in srgb, var(--text-muted) 40%, transparent);
  user-select: all;
  letter-spacing: 0.2px;
}

.quotes-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quotes-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quotes-field-mono {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  word-break: break-all;
}

.quotes-detail-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quotes-detail-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.quotes-detail-badge.active {
  border-color: var(--input-focus-border);
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--bg-surface) 90%, var(--accent-primary));
}

/* ── Regen params display ── */
.quotes-detail-params {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quotes-detail-param {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quotes-param-key {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── PDF preview in detail view ── */
.quotes-detail-preview {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 4px 0;
}

.quotes-detail-preview-frame {
  width: 100%;
  flex: 1;
  min-height: 280px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quotes-preview-loading,
.quotes-preview-error-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

.quotes-pdf-page-mini {
  min-height: 280px;
  aspect-ratio: 8.5 / 11;
  padding: 20px;
}

.quotes-pdf-page-mini h4 {
  font-size: 12px;
}

.quotes-pdf-page-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.quotes-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ── Back to list button ── */
.quotes-back-to-list {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.quotes-back-to-list:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.quotes-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.quotes-sidebar-header svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.quotes-sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 10px 0;
}

.quotes-create-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 12px;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.quotes-create-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--accent-primary));
}

.quotes-create-btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.quotes-commit-msg {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.quotes-commit-error {
  background: color-mix(in srgb, var(--bg-surface) 85%, #ef4444);
  color: #ef4444;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 60%, #ef4444);
}

.quotes-commit-success {
  background: color-mix(in srgb, var(--bg-surface) 85%, #22c55e);
  color: #22c55e;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 60%, #22c55e);
}

.quotes-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.quotes-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-surface);
}

.quotes-field-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quotes-field-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.quotes-flags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.quotes-flag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-primary);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.quotes-flag-row:hover {
  border-color: var(--input-focus-border);
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--accent-primary));
}

.quotes-flag-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
  accent-color: var(--accent-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.quotes-flag-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-secondary);
}

.quotes-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.quotes-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.quotes-preview-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.quotes-preview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  padding: 14px 16px;
  background: var(--nav-hover-bg);
  border-radius: 10px;
  min-height: 0;
  height: 100%;
}

.quotes-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.quotes-input {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.quotes-input:disabled {
  opacity: 0.75;
}

.quotes-preview-payload {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quotes-preview-payload pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.quotes-preview-canvas {
  min-height: 500px;
  height: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
}

.quotes-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: var(--bg-surface);
}

.quotes-pdf-placeholder {
  overflow: auto;
}

.quotes-pdf-page {
  width: min(100%, 760px);
  aspect-ratio: 8.5 / 11;
  min-height: 760px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: var(--header-shadow);
  padding: 24px;
  color: var(--text-secondary);
}

.quotes-pdf-page h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text-primary);
}

.quotes-pdf-page p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* ── Logs view ── */
.quotes-logs-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding: 16px;
  gap: 12px;
}

.quotes-logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  white-space: nowrap;
}

.quotes-logs-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.quotes-logs-refresh:hover {
  background: var(--nav-hover-bg);
  color: var(--text-primary);
}

.quotes-logs-refresh:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quotes-logs-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.quotes-logs-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quotes-log-group {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.quotes-log-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--nav-hover-bg);
  border-bottom: 1px solid var(--border-subtle);
}

.quotes-log-filename {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.quotes-log-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.quotes-log-entries {
  display: flex;
  flex-direction: column;
}

.quotes-log-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s;
}

.quotes-log-entry:last-child {
  border-bottom: none;
}

.quotes-log-entry:hover {
  background: var(--nav-hover-bg);
}

.quotes-log-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  width: 80px;
  flex-shrink: 0;
}

.quotes-log-action.download {
  color: var(--accent-primary, #3b82f6);
}

.quotes-log-action.print {
  color: var(--warning, #e6a817);
}

.quotes-log-user {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.quotes-log-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Empty state ── */
.tab-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.tab-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-add-btn {
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════
   Narrow desktop — Forecast summary table tightening
   ═══════════════════════════════════════════════════ */

@media (max-width: 1500px) {
  .ov-product-desc {
    display: none;
  }

  .ov-forecast-table .col-product {
    width: auto;
  }

  .ov-forecast-table th,
  .ov-forecast-table td {
    padding: 4px 6px;
    font-size: 11px;
  }

  .ov-product-id {
    font-size: 10px;
  }
}

@media (max-width: 1250px) {
  .ov-forecast-table .col-margin {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════
   Tablet / Narrow — Stacked layout (sidebar on top)
   ═══════════════════════════════════════════════════ */

@media (max-width: 1100px) and (min-width: 769px) {
  .opportunity-detail-page {
    flex-direction: column;
    gap: 12px;
  }

  .opportunity-detail-left {
    flex: none;
    max-height: none;
    overflow: visible;
    border-radius: 12px;
  }

  .opportunity-detail-right {
    flex: 1;
    min-height: 0;
    border-radius: 12px;
  }

  /* ── Sidebar becomes a horizontal layout ── */
  .opp-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0 24px;
    padding: 16px 20px;
    position: relative;
  }

  /* Headline spans the full width */
  .opp-headline {
    grid-column: 1 / -1;
    margin-top: 8px;
    margin-bottom: 4px;
  }

  /* Back button in its own row */
  .back-btn {
    grid-column: 1 / -1;
  }

  /* Days countdown pinned to top-right corner */
  .opp-close-countdown {
    position: absolute;
    top: 16px;
    right: 20px;
    margin: 0;
    width: fit-content;
  }

  /* Sales reps row across */
  .opp-byline {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 0;
  }

  /* Divider spans full width */
  .opp-sidebar-divider {
    grid-column: 1 / -1;
    margin: 10px 0;
  }

  /* Info section uses the grid columns */
  .opp-sidebar-info {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4px 16px;
  }

  /* Description takes full width */
  .opp-desc-section {
    grid-column: 1 / -1;
  }

  .opp-desc-card {
    max-height: 60px;
    overflow-y: auto;
  }

  /* Footer becomes a horizontal strip */
  .opp-sidebar-footer {
    grid-column: 1 / -1;
    margin-top: 0;
    padding: 8px 0 0;
    border-top: 1px solid var(--border-subtle);
  }
}

/* ═══════════════════════════════════════════════════
   Mobile — Responsive
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .opportunity-detail-page {
    flex-direction: column;
    gap: 0;
  }

  .opportunity-detail-left {
    flex: none;
    border-radius: 12px 12px 0 0;
  }

  .opportunity-detail-left.mobile-collapsed {
    display: none;
  }

  .opportunity-detail-right {
    border-radius: 0 0 12px 12px;
  }

  .opportunity-detail-right.mobile-hidden {
    display: none;
  }

  .tab-bar {
    display: none;
  }

  /* Mobile nav menu */
  .mobile-nav-menu {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
  }

  .mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    width: 100%;
  }

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

  .mobile-nav-item:hover {
    background: var(--nav-hover-bg);
  }

  .mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--nav-hover-bg);
    color: var(--text-secondary);
  }

  .mobile-nav-label {
    flex: 1;
  }

  .mobile-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
    color: var(--accent-primary);
  }

  .mobile-nav-chevron {
    color: var(--text-secondary);
  }

  /* Mobile content header */
  .mobile-content-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }

  .mobile-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
  }

  .mobile-content-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .ov-kpi-strip {
    flex-wrap: wrap;
  }

  .ov-kpi-card {
    flex: 1 1 45%;
    min-width: 80px;
  }

  .ov-main-grid {
    grid-template-columns: 1fr;
  }

  .ov-timeline-section {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 16px;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .quotes-fields-grid,
  .quotes-flags-grid,
  .quotes-preview-grid {
    grid-template-columns: 1fr;
  }

  .quotes-preview-layout {
    grid-template-columns: 1fr;
  }

  .quotes-preview-sidebar {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .quotes-preview-canvas {
    height: 480px;
  }

  .forecasts-summary {
    flex-direction: column;
  }
}

/* ══════════════════════════════════════════════════════════════════
   WORKFLOW PANEL
   ══════════════════════════════════════════════════════════════════ */

.wf-panel {
  padding: 12px 0;
}

/* ── Inline variant (inside tab bar) ── */
.wf-panel-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 0 8px;
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
  overflow: visible;
}

.wf-panel-inline .wf-status-section {
  margin-bottom: 0;
  flex-shrink: 0;
}

.wf-panel-inline .wf-status-row {
  gap: 6px;
}

.wf-panel-inline .wf-stale-note {
  display: none;
}

.wf-panel-inline .wf-actions {
  margin-top: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.wf-panel-inline .wf-action-btn {
  padding: 4px 11px;
  font-size: 11.5px;
}

.wf-panel-inline .wf-error-banner {
  margin-bottom: 0;
  padding: 4px 8px;
  font-size: 11px;
  max-width: 260px;
}

.wf-panel-inline .wf-terminal-notice {
  margin-top: 0;
  white-space: nowrap;
}

/* ── Status Row ── */
.wf-status-section {
  margin-bottom: 10px;
}

.wf-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wf-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition:
    background 0.2s,
    color 0.2s;
}

/* Status variants */
.wf-status-badge.wf-status-pending-new {
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
  border: 1px dashed #0d9488;
}

.wf-status-badge.wf-status-new {
  background: rgba(20, 184, 166, 0.12);
  color: #0d9488;
}

.wf-status-badge.wf-status-review {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.wf-status-badge.wf-status-quote-sent {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.wf-status-badge.wf-status-quote-confirmed {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.wf-status-badge.wf-status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.wf-status-badge.wf-status-ready-to-send {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border: 1px dashed #4f46e5;
}

.wf-status-badge.wf-status-pending-sent {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px dashed #2563eb;
}

.wf-status-badge.wf-status-pending-revision {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px dashed #d97706;
}

.wf-status-badge.wf-status-pending-won {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px dashed #2563eb;
}

.wf-status-badge.wf-status-won {
  background: rgba(37, 99, 235, 0.14);
  color: #2563eb;
}

.wf-status-badge.wf-status-pending-lost {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px dashed #dc2626;
}

.wf-status-badge.wf-status-lost {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.wf-status-badge.wf-status-canceled {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

.wf-status-badge.wf-status-default {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/* Pending pulse animation */
.wf-status-badge.wf-pending {
  animation: wfPendingPulse 2s ease-in-out infinite;
}

@keyframes wfPendingPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.65;
  }
}

/* Terminal locked styling */
.wf-status-badge.wf-terminal {
  opacity: 0.85;
}

/* ── Cold / Stale Indicators ── */
.wf-cold-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(147, 197, 253, 0.15);
  color: #3b82f6;
}

.wf-stale-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Terminal Notice ── */
.wf-terminal-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

.wf-terminal-notice svg {
  flex-shrink: 0;
}

/* ── Pending Schedule Entries ── */
.wf-schedule-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.wf-se-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-primary);
  min-width: 0;
}

.wf-se-icon {
  flex-shrink: 0;
  color: #3b82f6;
}

.wf-se-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.wf-se-time {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 11px;
}

.wf-panel-inline .wf-schedule-entries {
  display: none;
}

/* ── Error Banner ── */
.wf-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.15);
  margin-bottom: 8px;
}

.wf-error-text {
  flex: 1;
  font-size: 12px;
  color: #dc2626;
  line-height: 1.4;
}

.wf-error-dismiss {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #dc2626;
  opacity: 0.6;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.wf-error-dismiss:hover {
  opacity: 1;
}

/* ── Action Buttons ── */
.wf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.wf-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.13s,
    border-color 0.13s,
    box-shadow 0.13s,
    transform 0.1s;
  white-space: nowrap;
  line-height: 1.4;
}

.wf-action-btn:hover {
  transform: translateY(-1px);
}

.wf-action-btn:active {
  transform: translateY(0);
}

.wf-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Action button variants */

/* Primary — filled accent, the main forward action */
.wf-action-btn.wf-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow:
    0 1px 3px rgba(37, 99, 235, 0.3),
    0 0 0 0px rgba(37, 99, 235, 0.4);
}

.wf-action-btn.wf-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow:
    0 3px 8px rgba(37, 99, 235, 0.35),
    0 1px 2px rgba(37, 99, 235, 0.2);
}

/* Ghost — bordered secondary actions */
.wf-action-btn.wf-btn-ghost {
  background: var(--bg-surface, #fff);
  border-color: var(--border-default, #d1d5db);
  color: var(--text-secondary, #374151);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wf-action-btn.wf-btn-ghost:hover {
  background: var(--bg-inset, #f9fafb);
  border-color: var(--border-medium, #9ca3af);
  color: var(--text-primary, #111827);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Ghost-danger — cancel / finalize lost */
.wf-action-btn.wf-btn-ghost.wf-ghost-danger {
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

.wf-action-btn.wf-btn-ghost.wf-ghost-danger:hover {
  background: rgba(220, 38, 38, 0.05);
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

/* Ghost-success — finalize won */
.wf-action-btn.wf-btn-ghost.wf-ghost-success {
  border-color: rgba(22, 163, 74, 0.3);
  color: #16a34a;
}

.wf-action-btn.wf-btn-ghost.wf-ghost-success:hover {
  background: rgba(22, 163, 74, 0.05);
  border-color: rgba(22, 163, 74, 0.45);
  color: #15803d;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.1);
}

/* Icon-only square button (calendar / clock) */
.wf-action-btn.wf-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color, #444);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #888);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.wf-action-btn.wf-btn-icon:hover:not(:disabled) {
  border-color: var(--accent-color, #4f8ef7);
  color: var(--accent-color, #4f8ef7);
  background: var(--accent-bg, rgba(79, 142, 247, 0.08));
}

/* Small spinner for icon buttons */
.wf-spinner.wf-spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* Action group separator */
.wf-action-sep {
  width: 1px;
  height: 18px;
  background: var(--border-subtle, #e5e7eb);
  flex-shrink: 0;
  align-self: center;
  margin: 0 2px;
}

.wf-action-hint {
  font-size: 11px;
  color: var(--text-muted, #888);
  white-space: nowrap;
  align-self: center;
}

/* Tooltip wrapper for disabled action buttons */
.wf-tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.wf-tooltip-wrap::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-tooltip, #1e1e1e);
  color: #f0f0f0;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wf-tooltip-wrap::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: var(--bg-tooltip, #1e1e1e);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 9999;
}

.wf-tooltip-wrap:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.wf-tooltip-wrap:hover::before {
  opacity: 1;
}

[data-theme="dark"] .wf-tooltip-wrap::after {
  background: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .wf-tooltip-wrap::before {
  border-bottom-color: #333;
}

/* ══════════════════════════════════════════════════════════════════
   WORKFLOW MODALS (shared)
   ══════════════════════════════════════════════════════════════════ */

.wf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wfFadeIn 0.2s ease;
}

@keyframes wfFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.wf-modal {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-subtle, #e5e5e5);
  border-radius: 14px;
  box-shadow:
    0 24px 80px -12px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.03);
  width: 90%;
  max-width: 460px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: wfSlideUp 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

.wf-modal.wf-modal-wide {
  max-width: 540px;
}

@keyframes wfSlideUp {
  from {
    transform: scale(0.96) translateY(8px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.wf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle, #e5e5e5);
}

.wf-modal-header.wf-header-accent {
  border-bottom-color: rgba(139, 92, 246, 0.25);
  background: linear-gradient(135deg,
      rgba(139, 92, 246, 0.04) 0%,
      rgba(59, 130, 246, 0.03) 100%);
}

.wf-modal-header.wf-header-won {
  border-bottom-color: rgba(37, 99, 235, 0.25);
  background: linear-gradient(135deg,
      rgba(59, 130, 246, 0.04) 0%,
      transparent 100%);
}

.wf-modal-header.wf-header-lost {
  border-bottom-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(135deg,
      rgba(220, 38, 38, 0.04) 0%,
      transparent 100%);
}

.wf-modal-header.wf-destructive {
  border-bottom-color: rgba(220, 38, 38, 0.25);
  background: linear-gradient(135deg,
      rgba(220, 38, 38, 0.04) 0%,
      transparent 100%);
}

.wf-modal-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary, #1a1a1a);
  margin: 0;
  letter-spacing: -0.01em;
}

.wf-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted, #888);
  transition: all 0.15s;
}

.wf-modal-close:hover {
  color: var(--text-primary, #1a1a1a);
  background: var(--card-hover-bg, #f5f5f5);
  border-color: var(--border-subtle, #e5e5e5);
}

.wf-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.wf-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle, #e5e5e5);
  flex-shrink: 0;
}

/* ── Form Fields ── */
.wf-field-group {
  margin-bottom: 16px;
}

.wf-field-group:last-child {
  margin-bottom: 0;
}

.wf-time-row {
  display: flex;
  gap: 12px;
}

.wf-time-row .wf-time-field {
  flex: 1;
  min-width: 0;
}

.wf-time-row .wf-time-field .wf-input {
  width: 100%;
}

.wf-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #666);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.wf-required {
  color: #ef4444;
  font-weight: 700;
  margin-left: 2px;
}

.wf-optional {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
  font-size: 11px;
}

/* ── Time Entry Section ── */
.wf-time-section {
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle, #eee);
  padding-top: 12px;
}

.wf-time-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted, #888);
  user-select: none;
  transition: color 0.15s;
}

.wf-time-toggle:hover {
  color: var(--text-secondary, #666);
}

.wf-time-toggle svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.wf-time-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 16px;
  background: var(--border-strong, #ccc);
  border: none;
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  outline: none;
  transition: background 0.2s;
}

.wf-time-toggle input[type="checkbox"]:focus,
.wf-time-toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: none;
}

.wf-time-toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%);
  transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wf-time-toggle input[type="checkbox"]:checked {
  background: #3b82f6;
}

.wf-time-toggle input[type="checkbox"]:checked::after {
  left: 16px;
}

.wf-time-fields {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-left: 20px;
  border-left: 2px solid var(--border-subtle, #eee);
}

.wf-time-fields .wf-time-field {
  flex: 1;
  min-width: 0;
}

.wf-time-fields .wf-time-field .wf-field-label {
  font-size: 11px;
  margin-bottom: 4px;
}

.wf-time-fields .wf-input {
  width: 100%;
  font-size: 12px;
  padding: 6px 10px;
}

.wf-textarea {
  width: 100%;
  min-height: 80px;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle, #ddd);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary, #1a1a1a);
  background: var(--bg-inset, #fafafa);
  resize: vertical;
  line-height: 1.5;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
  box-sizing: border-box;
}

.wf-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: var(--bg-surface, #fff);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.wf-textarea::placeholder {
  color: var(--text-muted, #aaa);
}

.wf-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle, #ddd);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary, #1a1a1a);
  background: var(--bg-inset, #fafafa);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
  box-sizing: border-box;
}

.wf-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: var(--bg-surface, #fff);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.wf-field-error .wf-textarea,
.wf-field-error .wf-input {
  border-color: #dc2626;
}

.wf-field-error-text {
  font-size: 11px;
  color: #dc2626;
  margin-top: 4px;
}

/* ── Inline Error ── */
.wf-inline-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.15);
  font-size: 12px;
  color: #dc2626;
  margin-bottom: 14px;
}

/* ── Buttons ── */
.wf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 550;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.wf-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wf-btn-secondary {
  background: var(--bg-inset, #fafafa);
  border-color: var(--border-subtle, #ddd);
  color: var(--text-secondary, #666);
}

.wf-btn-secondary:hover:not(:disabled) {
  background: var(--card-hover-bg, #f0f0f0);
  border-color: var(--border-default, #ccc);
  color: var(--text-primary, #1a1a1a);
}

.wf-btn-primary {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.25);
}

.wf-btn-primary:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
  transform: translateY(-0.5px);
}

.wf-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.wf-btn-destructive {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

.wf-btn-destructive:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
  transform: translateY(-0.5px);
}

.wf-btn-destructive:active:not(:disabled) {
  transform: translateY(0);
}

.wf-btn-success {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.25);
}

.wf-btn-success:hover:not(:disabled) {
  background: #15803d;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
  transform: translateY(-0.5px);
}

.wf-btn-success:active:not(:disabled) {
  transform: translateY(0);
}

.wf-btn-danger {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

.wf-btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
  transform: translateY(-0.5px);
}

.wf-btn-danger:active:not(:disabled) {
  transform: translateY(0);
}

/* ── Confirmation Box ── */
.wf-confirmation-box {
  padding: 14px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-top: 14px;
}

.wf-confirmation-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.5;
}

.wf-confirmation-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Spinner ── */
.wf-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: wfSpin 0.6s linear infinite;
  flex-shrink: 0;
}

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

/* ── Checkbox Group (SendQuoteModal) ── */
.wf-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e5e5e5);
  background: var(--bg-inset, #fafafa);
  transition:
    background 0.15s,
    border-color 0.15s;
}

.wf-checkbox-label:hover {
  background: var(--card-hover-bg, #f5f5f5);
  border-color: var(--border-default, #ccc);
}

.wf-checkbox-label.wf-checkbox-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wf-checkbox-label.wf-checkbox-disabled:hover {
  background: var(--bg-inset, #fafafa);
  border-color: var(--border-subtle, #e5e5e5);
}

.wf-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.wf-checkbox-text {
  flex: 1;
}

.wf-checkbox-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.wf-checkbox-note {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.wf-checkbox-warning {
  font-size: 11px;
  color: #d97706;
  display: block;
  margin-top: 2px;
}

/* ── Send Quote Outcome Section ── */
.sq-outcome-section {
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle, #e5e5e5);
  padding-top: 12px;
}

.sq-confirmed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e5e5e5);
  background: var(--bg-inset, #fafafa);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
}

.sq-confirmed-toggle:hover {
  background: var(--card-hover-bg, #f5f5f5);
  border-color: var(--border-default, #ccc);
}

.sq-confirmed-toggle.sq-active {
  background: #ecfdf5;
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .sq-confirmed-toggle.sq-active {
  background: rgba(16, 185, 129, 0.1);
  border-color: #059669;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}

.sq-toggle-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--bg-inset, #f3f3f3);
  border: 1px solid var(--border-subtle, #ddd);
  transition:
    background 0.15s,
    border-color 0.15s;
}

.sq-active .sq-toggle-check {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

[data-theme="dark"] .sq-active .sq-toggle-check {
  background: #059669;
  border-color: #059669;
}

.sq-toggle-label {
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.sq-toggle-hint {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-left: auto;
}

.sq-sub-options {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-left: 0;
}

.sq-sub-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e5e5e5);
  background: var(--bg-inset, #fafafa);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
  color: var(--text-secondary, #666);
  font-size: 13px;
}

.sq-sub-option:hover {
  background: var(--card-hover-bg, #f0f0f0);
  border-color: var(--border-default, #ccc);
  transform: translateY(-1px);
}

.sq-sub-option:active {
  transform: translateY(0);
}

.sq-sub-option.sq-sub-active {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
  color: var(--text-primary);
}

[data-theme="dark"] .sq-sub-option.sq-sub-active {
  background: rgba(59, 130, 246, 0.1);
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.sq-sub-option svg {
  opacity: 0.5;
  transition: opacity 0.15s;
}

.sq-sub-option.sq-sub-active svg {
  opacity: 1;
  color: #3b82f6;
}

[data-theme="dark"] .sq-sub-option.sq-sub-active svg {
  color: #60a5fa;
}

.sq-sub-label {
  font-weight: 600;
  font-size: 13px;
}

.sq-sub-desc {
  font-size: 11px;
  color: var(--text-muted, #888);
  text-align: center;
  line-height: 1.3;
}

/* Finalize immediately checkbox row */
.sq-finalize-row {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, #e5e5e5);
  background: var(--bg-inset, #fafafa);
}

.sq-finalize-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

.sq-finalize-check input[type="checkbox"] {
  accent-color: #3b82f6;
  flex-shrink: 0;
}

.sq-finalize-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted, #888);
  margin-left: auto;
}

/* ── Decision Buttons (ReviewDecisionModal) ── */
.wf-decision-group {
  margin-bottom: 16px;
}

.wf-decision-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wf-decision-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 10px;
  border: 2px solid var(--border-subtle, #e5e5e5);
  background: var(--bg-inset, #fafafa);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.wf-decision-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--card-hover-bg, #f5f5f5);
  border-color: var(--card-hover-border, #ccc);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wf-decision-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wf-decision-btn.wf-selected {
  border-color: currentColor;
  box-shadow:
    0 0 0 1px currentColor,
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.wf-decision-btn.wf-disabled-perm {
  opacity: 0.4;
}

/* Decision button variants */
.wf-decision-btn.wf-decision-approve {
  color: #16a34a;
}

.wf-decision-btn.wf-decision-approve.wf-selected {
  background: rgba(34, 197, 94, 0.06);
}

.wf-decision-btn.wf-decision-reject {
  color: #d97706;
}

.wf-decision-btn.wf-decision-reject.wf-selected {
  background: rgba(245, 158, 11, 0.06);
}

.wf-decision-btn.wf-decision-send {
  color: #2563eb;
}

.wf-decision-btn.wf-decision-send.wf-selected {
  background: rgba(59, 130, 246, 0.06);
}

.wf-decision-btn.wf-decision-cancel {
  color: #dc2626;
}

.wf-decision-btn.wf-decision-cancel.wf-selected {
  background: rgba(220, 38, 38, 0.06);
}

.wf-decision-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
}

/* ── Finalize Selector (FinalizeModal) ── */
.wf-finalize-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  transition: grid-template-columns 0.2s ease;
}

.wf-finalize-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border-radius: 10px;
  border: 2px solid var(--border-subtle, #e5e5e5);
  background: var(--bg-inset, #fafafa);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s,
    padding 0.2s,
    font-size 0.2s,
    opacity 0.2s;
  font-size: 14px;
  font-weight: 600;
}

/* Shrink the unselected option when a selection is made */
.wf-finalize-selector.has-selection {
  grid-template-columns: 2fr 1fr;
}

.wf-finalize-selector.has-selection.lost-selected {
  grid-template-columns: 1fr 2fr;
}

.wf-finalize-selector.has-selection .wf-finalize-option:not(.wf-selected) {
  padding: 12px 8px;
  opacity: 0.5;
  border-color: var(--border-subtle, #e5e5e5);
  box-shadow: none;
}

.wf-finalize-selector.has-selection .wf-finalize-option:not(.wf-selected) svg {
  width: 16px;
  height: 16px;
}

.wf-finalize-selector.has-selection .wf-finalize-option:not(.wf-selected):hover {
  opacity: 0.75;
}

.wf-finalize-option:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--card-hover-bg, #f5f5f5);
  border-color: var(--card-hover-border, #ccc);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wf-finalize-option:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.wf-finalize-option.wf-selected {
  border-color: currentColor;
  box-shadow:
    0 0 0 1px currentColor,
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.wf-finalize-option.wf-finalize-won {
  color: #2563eb;
}

.wf-finalize-option.wf-finalize-won.wf-selected {
  background: rgba(37, 99, 235, 0.06);
}

.wf-finalize-option.wf-finalize-lost {
  color: #dc2626;
}

.wf-finalize-option.wf-finalize-lost.wf-selected {
  background: rgba(220, 38, 38, 0.06);
}

/* Finalize immediately checkbox */
.wf-finalize-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  margin-bottom: 12px;
  user-select: none;
}

.wf-finalize-check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 16px;
  background: #ccc;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  border: none;
  box-shadow: none;
}

.wf-finalize-check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wf-finalize-check input[type="checkbox"]:checked {
  background: #2563eb;
}

.wf-finalize-check input[type="checkbox"]:checked::after {
  left: 16px;
}

.wf-finalize-check input[type="checkbox"]:focus,
.wf-finalize-check input[type="checkbox"]:focus-visible {
  outline: none;
  border: none;
  box-shadow: none;
}

.wf-finalize-check .wf-info-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted, #9ca3af);
  cursor: help;
  position: relative;
}

.wf-finalize-check .wf-info-icon:hover {
  color: var(--text-secondary, #6b7280);
}

/* Pending disclaimer notice */
.wf-pending-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.18);
  font-size: 12px;
  line-height: 1.5;
  color: #92400e;
  margin-bottom: 12px;
}

.wf-pending-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #d97706;
}

.wf-pending-notice strong {
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════
   ACTIVITY TIMELINE
   ══════════════════════════════════════════════════════════════════ */

.activity-tab {
  padding: 0;
}

.at-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.overview-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.at-header .overview-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.at-refresh-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
}

.at-refresh-btn:hover {
  color: var(--text-primary);
  background: var(--nav-hover-bg);
}

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

.at-spinning {
  animation: wfSpin 0.8s linear infinite;
}

/* ── Loading / Empty / Error states ── */
.at-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.at-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
  color: var(--text-muted);
}

.at-empty p {
  margin: 0;
  font-size: 13px;
}

.at-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.15);
  font-size: 12px;
  color: #dc2626;
}

/* ── Timeline Layout ── */
.at-timeline {
  display: flex;
  flex-direction: column;
}

.at-entry {
  display: flex;
  gap: 12px;
  min-height: 56px;
}

.at-entry.at-entry-open {
  /* Subtle highlight for open/active activities */
}

/* Time entry rows */
.at-entry.at-entry-time-entry {
  opacity: 0.88;
}

.at-dot.at-dot-time-entry {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.at-type-badge.at-type-time-entry {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

/* ── Connector (dots, lines, branches) ── */

/*
 * The connector column grows wider with depth so that all ancestor rails,
 * the branch arm, and the dot all fit without any margin-left on the entry.
 *
 *   depth 0 → 20px  (just the dot)
 *   depth 1 → 48px  (28px rail space + dot)
 *   depth 2 → 76px  (56px rail space + dot)
 *
 * Dot is always at the RIGHT edge of the connector.
 * Dot center from left-edge = depth * 28 + 10.
 */
.at-connector {
  position: relative;
  width: calc(20px + var(--at-depth, 0) * 28px);
  flex-shrink: 0;
}

/*
 * Pass-through rails — ancestor vertical lines that continue the full
 * height of this entry so root-level rails are never interrupted by
 * nested items sitting between two root entries.
 */

/* depth ≥ 1: depth-0 rail at X=9 */
.at-connector[data-depth="1"]::before,
.at-connector[data-depth="2"]::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  /* default: start at dot centre — no stub above curve */
  bottom: 0;
  width: 2px;
  background: var(--card-border);
  z-index: 0;
}

/* When there IS any item above, extend the depth-0 rail to the top */
.at-connector[data-depth="1"].at-has-above::before,
.at-connector[data-depth="2"].at-has-above::before {
  top: 0;
}

/* depth ≥ 2: depth-1 rail at X=37 */
.at-connector[data-depth="2"]::after {
  content: "";
  position: absolute;
  left: 37px;
  top: 10px;
  /* default: no stub above curve */
  bottom: 0;
  width: 2px;
  background: var(--card-border);
  z-index: 0;
}

/* Only extend depth-1 rail to top when another depth-2 item is directly above
   (depth-0 and depth-1 items have no line at x=37, so top:0 would create a stub) */
.at-connector[data-depth="2"].at-has-d1-above::after {
  top: 0;
}

/*
 * Dot: positioned at the top-right corner of the connector column.
 * „top: 0" means the previous entry's exit line ends exactly at this
 * dot's top edge — creating a seamless "line enters the circle" effect.
 */
.at-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.at-dot.at-dot-open {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.at-dot.at-dot-system {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/*
 * Vertical exit line: runs from the dot's bottom edge to the connector
 * bottom.  The next entry's dot starts at Y=0, so this line ends exactly
 * where the next dot begins — creating a seamless connection.
 *
 * left = depth * 28 + 9   (1px left of the dot's horizontal center)
 */
.at-line {
  position: absolute;
  left: calc(var(--at-depth, 0) * 28px + 9px);
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--card-border);
  z-index: 0;
}

/*
 * L-shaped branch: only rendered for depth > 0.
 * Inverted tree: parent is BELOW, so the arm rises from dot-center downward
 * toward the parent rail.  Corner is at TOP-LEFT: the horizontal segment runs
 * right from the rail into the dot's left edge at its centre (Y = 10), and the
 * vertical segment descends from Y=10 toward the parent below.
 *
 *   top: 10px   → starts at dot vertical centre
 *   height: 10px → just the corner piece descending from centre
 *   border-top + border-left + border-top-left-radius → curve opens upward/rightward
 */
.at-branch {
  position: absolute;
  top: 10px;
  height: 10px;
  width: 19px;
  border-left: 2px solid var(--card-border);
  border-top: 2px solid var(--card-border);
  border-top-left-radius: 8px;
  box-sizing: border-box;
  z-index: 1;
}

/* depth-1: parent rail at X=9, dot left-edge at X=28 */
.at-connector[data-depth="1"] .at-branch {
  left: 9px;
}

/* depth-2: parent rail at X=37, dot left-edge at X=56 */
.at-connector[data-depth="2"] .at-branch {
  left: 37px;
}

/* ── Entry Content ── */
.at-content {
  flex: 1;
  padding-bottom: 16px;
  min-width: 0;
}

.at-content-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.at-type-badge {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Optima type badge variants */
.at-type-badge.at-type-created {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}

.at-type-badge.at-type-setup {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.at-type-badge.at-type-review {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
}

.at-type-badge.at-type-sent {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.at-type-badge.at-type-confirmed {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.at-type-badge.at-type-sent-confirmed {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
}

.at-type-badge.at-type-revision {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.at-type-badge.at-type-finalized {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

.at-type-badge.at-type-converted {
  background: rgba(236, 72, 153, 0.1);
  color: #db2777;
}

.at-type-badge.at-type-generated {
  background: rgba(20, 184, 166, 0.1);
  color: #0d9488;
}

.at-type-badge.at-type-default {
  background: rgba(107, 114, 128, 0.08);
  color: var(--text-muted);
}

/* ── Quote Reference Sub-Item ── */
.at-quote-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: 6px;
  background: rgba(20, 184, 166, 0.06);
  color: #0d9488;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.at-quote-link:hover {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.4);
}

.at-quote-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.at-quote-link-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.at-quote-link-arrow {
  opacity: 0.4;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.at-quote-link:hover .at-quote-link-arrow {
  opacity: 0.8;
  transform: translateX(2px);
}

[data-theme="dark"] .at-quote-link {
  border-color: rgba(20, 184, 166, 0.2);
  background: rgba(20, 184, 166, 0.08);
  color: #5eead4;
}

[data-theme="dark"] .at-quote-link:hover {
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(20, 184, 166, 0.35);
}

/* ── Status Transition Pill ── */
.at-transition-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.06);
  color: var(--text-secondary);
}

.at-transition-from {
  opacity: 0.6;
}

.at-transition-to {
  color: var(--text-primary);
}

/* ── Open Badge ── */
.at-open-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

/* ── Activity Name / Notes ── */
.at-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
  line-height: 1.4;
}

.at-notes {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 6px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Meta Row ── */
.at-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.at-user {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.at-user.at-system {
  color: var(--text-muted);
  font-style: italic;
}

.at-timestamp {
  font-size: 11px;
  color: var(--text-muted);
}

.at-closed-at {
  opacity: 0.7;
}

.at-schedule-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--accent-color, #4f8ef7);
}