/* ============================================================================
   Partner Deals — CSS
   Prefix: .pd-  (avoids conflicts with pipeline.css)
   Depends on: tokens.css
   ============================================================================ */

/* ========== PARTNER DEAL STAGE COLORS ========== */
:root {
  --ext-lead: #6366F1;
  --ext-lead-badge: rgba(99,102,241,0.12);
  --ext-qualifying: #8B5CF6;
  --ext-qualifying-badge: rgba(139,92,246,0.12);
  --ext-active: #F59E0B;
  --ext-active-badge: rgba(245,158,11,0.12);
  --ext-closing: #F97316;
  --ext-closing-badge: rgba(249,115,22,0.12);
  --ext-closed-won: #047857;
  --ext-closed-won-badge: rgba(4,120,87,0.12);
  --ext-closed-lost: #EF4444;
  --ext-closed-lost-badge: rgba(239,68,68,0.12);
  --ext-on-hold: #94A3B8;
  --ext-on-hold-badge: rgba(148,163,184,0.12);

  --stale-fresh: #10B981;
  --stale-warm: #F59E0B;
  --stale-cold: #EF4444;
}


/* ========== ANIMATIONS ========== */

@keyframes pdFadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pdModalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}


/* ========== PAGE LAYOUT ========== */

.pd-page-content {
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
}


/* ========== PAGE HEADER ========== */

.pd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.pd-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
}

.pd-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pd-btn-new-deal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-brand);
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.pd-btn-new-deal:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand), 0 2px 8px rgba(0,0,0,0.08);
}

.pd-btn-new-deal:active {
  transform: translateY(0);
}

.pd-btn-new-deal i {
  font-size: 15px;
}


/* ========== COLD ALERT BANNER ========== */

.pd-cold-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--error-wash);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--r-md);
  margin-bottom: 16px;
  animation: pdFadeSlideIn 300ms ease forwards;
}

.pd-cold-banner-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--r-full);
  background: rgba(239,68,68,0.12);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.pd-cold-banner-text {
  flex: 1;
  min-width: 0;
}

.pd-cold-banner-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-800);
  line-height: 1.3;
}

.pd-cold-banner-detail {
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.4;
  margin-top: 2px;
}

.pd-cold-banner-action button {
  font-size: 12px;
  font-weight: 600;
  color: var(--error);
  background: none;
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--r-sm);
  padding: 5px 12px;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.pd-cold-banner-action button:hover {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.4);
}


/* ========== CONTROLS ROW ========== */

.pd-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Stage chips --- */

.pd-stage-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pd-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  user-select: none;
}

.pd-stage-chip:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.pd-stage-chip.active {
  border-color: currentColor;
}

.pd-stage-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: currentColor;
  flex-shrink: 0;
}

.pd-stage-chip .chip-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: currentColor;
  color: var(--white);
  line-height: 1;
}

.pd-chip-separator {
  width: 1px;
  height: 20px;
  background: var(--gray-200);
  flex-shrink: 0;
}

/* --- Filter right section --- */

.pd-filter-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Cold toggle --- */

.pd-cold-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
  cursor: pointer;
  user-select: none;
}

.pd-cold-toggle-track {
  width: 32px;
  height: 18px;
  border-radius: var(--r-full);
  background: var(--gray-300);
  position: relative;
  transition: background var(--t-fast);
  flex-shrink: 0;
}

.pd-cold-toggle-track.active {
  background: var(--error);
}

.pd-cold-toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: var(--r-full);
  background: var(--white);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform var(--t-fast);
  box-shadow: var(--shadow-xs);
}

.pd-cold-toggle-track.active .pd-cold-toggle-thumb {
  transform: translateX(14px);
}

/* --- Active filter pills --- */

.pd-active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  animation: pdFadeSlideIn 200ms ease forwards;
}

.pd-active-filter-pill.stage-pill {
  background: var(--brand-wash);
  color: var(--brand);
}

.pd-active-filter-pill.cold-pill {
  background: var(--error-wash);
  color: var(--error);
}

.pd-active-filter-pill button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  color: inherit;
  font-size: 12px;
  padding: 0;
  opacity: 0.6;
  transition: opacity var(--t-fast);
}

.pd-active-filter-pill button:hover {
  opacity: 1;
}

/* --- Deal count --- */

.pd-deal-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-400);
  white-space: nowrap;
}


/* ========== VIEW TOGGLE ========== */

.pd-view-toggle {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  overflow: hidden;
}

.pd-view-toggle button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pd-view-toggle button:not(:last-child) {
  border-right: 1px solid var(--gray-200);
}

.pd-view-toggle button:hover {
  background: var(--gray-50);
  color: var(--gray-700);
}

.pd-view-toggle button.active {
  background: var(--brand);
  color: var(--white);
}


/* ========== TABLE (LIST VIEW) ========== */

.pd-table {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.pd-table-header {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 140px 110px minmax(160px, 1.5fr) 100px 90px 80px 44px;
  padding: 0 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.pd-th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  user-select: none;
}

.pd-table-body {
  /* scroll container if needed */
}

.pd-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 140px 110px minmax(160px, 1.5fr) 100px 90px 80px 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
}

.pd-table-row:last-child {
  border-bottom: none;
}

.pd-table-row:hover {
  background: var(--gray-50);
}

/* Staleness left border */
.pd-table-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
}

.pd-table-row.stale-fresh::before {
  background: var(--stale-fresh);
}

.pd-table-row.stale-warm::before {
  background: var(--stale-warm);
}

.pd-table-row.stale-cold::before {
  background: var(--stale-cold);
}

.pd-td {
  font-size: 13px;
  display: flex;
  align-items: center;
  padding: 12px 8px;
  min-width: 0;
}

/* --- Deal name cell --- */

.pd-deal-name {
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.pd-deal-contacts-preview {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* --- Contact cell --- */

.pd-contact-name {
  font-weight: 500;
  color: var(--gray-700);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-contact-role {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 1px;
}

/* --- Staleness cell --- */

.pd-stale-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  margin-right: 6px;
}

.pd-contact-days {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

.pd-contact-days.cold {
  color: var(--error);
  font-weight: 700;
}

/* --- Next action cell --- */

.pd-next-action {
  font-size: 12px;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.pd-next-action-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* --- Stage badge --- */

.pd-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pd-stage-badge[data-stage="lead"]       { background: var(--ext-lead-badge);       color: var(--ext-lead); }
.pd-stage-badge[data-stage="qualifying"] { background: var(--ext-qualifying-badge); color: var(--ext-qualifying); }
.pd-stage-badge[data-stage="active"]     { background: var(--ext-active-badge);     color: var(--ext-active); }
.pd-stage-badge[data-stage="closing"]    { background: var(--ext-closing-badge);    color: var(--ext-closing); }
.pd-stage-badge[data-stage="closed-won"] { background: var(--ext-closed-won-badge); color: var(--ext-closed-won); }
.pd-stage-badge[data-stage="closed-lost"]{ background: var(--ext-closed-lost-badge);color: var(--ext-closed-lost); }
.pd-stage-badge[data-stage="on-hold"]    { background: var(--ext-on-hold-badge);    color: var(--ext-on-hold); }

/* --- Size cell --- */

.pd-deal-size {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-800);
}

/* --- Role cell --- */

.pd-ccl-role {
  font-size: 12px;
  color: var(--gray-600);
}

/* --- Assignee avatar --- */

.pd-assignee-avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--brand);
}


/* ========== KANBAN VIEW ========== */

.pd-kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pd-kanban-column {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  background: var(--gray-100);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
}

.pd-kanban-column-header {
  position: sticky;
  top: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-100);
  z-index: 1;
  border-bottom: 1px solid var(--gray-200);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.pd-kanban-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
}

.pd-kanban-column-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

.pd-kanban-column-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
}

.pd-kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 300px);
  flex: 1;
}

/* --- Kanban card --- */

.pd-kanban-card {
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-200);
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.pd-kanban-card:hover {
  box-shadow: var(--shadow-sm);
}

/* Staleness left border */
.pd-kanban-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
}

.pd-kanban-card.stale-fresh::before { background: var(--stale-fresh); }
.pd-kanban-card.stale-warm::before  { background: var(--stale-warm); }
.pd-kanban-card.stale-cold::before  { background: var(--stale-cold); }

.pd-kanban-card.cold-wash {
  background: rgba(239,68,68,0.03);
}

.pd-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pd-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-card-stale-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.pd-card-contact {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-card-next-action {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
}

.pd-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  min-width: 0;
}

.pd-card-size {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--gray-700);
}

.pd-card-role {
  color: var(--gray-500);
}

.pd-card-assignee {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--brand);
  flex-shrink: 0;
}

/* --- Kanban empty card --- */

.pd-kanban-empty-card {
  border: 2px dashed var(--gray-200);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 12px;
  line-height: 1.4;
}


/* ========== EMPTY STATE ========== */

.pd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  text-align: center;
}

.pd-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--gray-400);
  font-size: 24px;
}

.pd-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.pd-empty-desc {
  font-size: 13px;
  color: var(--gray-500);
  max-width: 360px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.pd-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-brand);
  transition: background var(--t-fast), transform var(--t-fast);
}

.pd-empty-cta:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.pd-empty-cta:active {
  transform: translateY(0);
}


/* ========== CREATE DEAL MODAL ========== */

.pd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease;
}

.pd-modal {
  background: var(--white);
  border-radius: var(--r-xl);
  max-width: 640px;
  width: calc(100% - 48px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: pdModalIn 250ms ease forwards;
}

.pd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.pd-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.pd-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  border: none;
  background: none;
  color: var(--gray-400);
  font-size: 18px;
  transition: background var(--t-fast), color var(--t-fast);
}

.pd-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.pd-modal-body {
  padding: 24px;
}

/* --- Form sections --- */

.pd-form-section {
  margin-bottom: 24px;
}

.pd-form-section:last-child {
  margin-bottom: 0;
}

.pd-form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.pd-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pd-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-form-group.full-width {
  grid-column: 1 / -1;
}

.pd-form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

.pd-form-input {
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.pd-form-input::placeholder {
  color: var(--gray-400);
}

.pd-form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

.pd-form-select {
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A1A1AA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.pd-form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

/* --- Contact card within modal --- */

.pd-contact-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 8px;
  position: relative;
}

.pd-contact-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  border: none;
  background: none;
  color: var(--gray-400);
  font-size: 14px;
  transition: color var(--t-fast), background var(--t-fast);
}

.pd-contact-remove:hover {
  color: var(--error);
  background: var(--error-wash);
}

.pd-btn-add-contact {
  width: 100%;
  padding: 8px;
  border: 2px dashed var(--gray-300);
  border-radius: var(--r-md);
  background: none;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
  transition: color var(--t-fast), border-color var(--t-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pd-btn-add-contact:hover {
  color: var(--gray-700);
  border-color: var(--gray-400);
}

/* --- Modal footer --- */

.pd-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.pd-modal-hint {
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pd-modal-hint i {
  font-size: 14px;
}

.pd-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-btn-cancel {
  padding: 8px 16px;
  background: var(--gray-100);
  color: var(--gray-700);
  border: none;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--t-fast);
}

.pd-btn-cancel:hover {
  background: var(--gray-200);
}

.pd-btn-create {
  padding: 8px 16px;
  background: var(--brand);
  color: var(--white);
  border: none;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-brand);
  transition: background var(--t-fast), opacity var(--t-fast);
}

.pd-btn-create:hover {
  background: var(--brand-dark);
}

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

.pd-btn-create:disabled:hover {
  background: var(--brand);
}


/* ============================================================================
   PARTNER DEAL DETAIL VIEW (pdd- prefix)
   ============================================================================ */

/* ========== DETAIL HEADER ========== */

.pdd-header {
  padding: var(--s-5) var(--s-8);
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
}

.pdd-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  font-size: 13px;
}

.pdd-breadcrumb a {
  color: var(--gray-400);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--t-fast);
}

.pdd-breadcrumb a:hover {
  color: var(--brand);
}

.pdd-sep {
  color: var(--gray-300);
  user-select: none;
}

.pdd-stage-crumb {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
}

.pdd-current {
  color: var(--gray-700);
  font-weight: 600;
}

.pdd-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
}

.pdd-title-left {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
}

.pdd-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--gray-500);
  flex-shrink: 0;
  margin-top: 2px;
}

.pdd-back:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-wash);
}

.pdd-back i {
  width: 18px;
  height: 18px;
}

.pdd-deal-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.pdd-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 2px;
}

.pdd-badges {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  flex-wrap: wrap;
}

.pdd-stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pdd-stale-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-sm);
}

.pdd-stale-badge.fresh {
  background: var(--success-wash);
  color: #047857;
}

.pdd-stale-badge.warm {
  background: var(--warning-wash);
  color: #B45309;
}

.pdd-stale-badge.cold {
  background: var(--error-wash);
  color: var(--error);
}

.pdd-assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1-5);
  padding: 3px 10px 3px 3px;
  border-radius: var(--r-full);
  background: var(--gray-100);
  font-size: 12px;
  color: var(--gray-600);
}

.pdd-av {
  width: 22px;
  height: 22px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--white);
}

/* Action buttons */
.pdd-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
  margin-top: 4px;
}

.pdd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font: 600 13px/1.4 var(--font-sans);
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1.5px solid;
}

.pdd-btn i {
  width: 16px;
  height: 16px;
}

.pdd-btn.advance {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

.pdd-btn.advance:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.pdd-btn.hold {
  background: var(--white);
  color: var(--gray-600);
  border-color: var(--gray-300);
}

.pdd-btn.hold:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
}

.pdd-btn.close-deal {
  background: var(--white);
  color: #047857;
  border-color: rgba(4,120,87,0.3);
}

.pdd-btn.close-deal:hover {
  background: rgba(4,120,87,0.06);
  border-color: #047857;
}


/* ========== TAB BAR ========== */

.pdd-tab-bar {
  display: flex;
  gap: var(--s-1);
  padding: 0 var(--s-8);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
}

.pdd-tab-bar::-webkit-scrollbar {
  height: 0;
}

.pdd-tab {
  display: flex;
  align-items: center;
  gap: var(--s-1-5);
  padding: 14px var(--s-4);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.pdd-tab:hover {
  color: var(--gray-700);
}

.pdd-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.pdd-tab i {
  width: 15px;
  height: 15px;
}

.pdd-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}


/* ========== TAB CONTENT ========== */

.pdd-content {
  padding: var(--s-6) var(--s-8);
  max-width: 1280px;
}

.pdd-pane {
  animation: pdFadeSlideIn 250ms ease;
}


/* ========== OVERVIEW CARDS ========== */

.pdd-ov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}

.pdd-span-2 {
  grid-column: 1 / -1;
}

.pdd-ov-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-xs);
}

.pdd-ov-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.pdd-ov-card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.pdd-ov-card-title i {
  width: 14px;
  height: 14px;
}


/* ========== STALENESS HERO ========== */

.pdd-staleness-hero {
  position: relative;
  overflow: hidden;
}

.pdd-staleness-hero.fresh {
  border-color: rgba(16,185,129,0.2);
}

.pdd-staleness-hero.warm {
  border-color: rgba(245,158,11,0.2);
}

.pdd-staleness-hero.cold {
  border-color: rgba(239,68,68,0.25);
}

.pdd-staleness-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.pdd-staleness-hero.fresh .pdd-staleness-accent {
  background: var(--stale-fresh);
}

.pdd-staleness-hero.warm .pdd-staleness-accent {
  background: var(--stale-warm);
}

.pdd-staleness-hero.cold .pdd-staleness-accent {
  background: var(--stale-cold);
}

.pdd-tier-label {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.pdd-tier-label.fresh {
  background: var(--success-wash);
  color: #047857;
}

.pdd-tier-label.warm {
  background: var(--warning-wash);
  color: #B45309;
}

.pdd-tier-label.cold {
  background: var(--error-wash);
  color: var(--error);
}

.pdd-staleness-metric {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.pdd-staleness-number {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.pdd-staleness-number.fresh {
  color: var(--stale-fresh);
}

.pdd-staleness-number.warm {
  color: var(--stale-warm);
}

.pdd-staleness-number.cold {
  color: var(--stale-cold);
}

.pdd-staleness-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
}

.pdd-staleness-details {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.pdd-staleness-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.pdd-staleness-label {
  color: var(--gray-500);
}

.pdd-staleness-value {
  color: var(--gray-800);
  font-weight: 500;
}

.pdd-action-val {
  color: var(--brand-dark);
  font-weight: 600;
}


/* ========== DEAL ECONOMICS ========== */

.pdd-econ-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}

.pdd-econ-label {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--s-1);
}

.pdd-econ-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.pdd-econ-value.mono {
  font-family: var(--font-mono);
}

.pdd-econ-value.payday {
  color: #047857;
}

.pdd-econ-sub {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 1px;
}


/* ========== CONTACT CARDS ========== */

.pdd-contact-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.pdd-contact-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--gray-100);
  background: var(--gray-50);
  transition: all var(--t-fast);
}

.pdd-contact-card:hover {
  border-color: var(--gray-200);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.pdd-contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--brand-subtle);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.pdd-contact-info {
  flex: 1;
  min-width: 0;
}

.pdd-contact-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-900);
}

.pdd-contact-meta {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.pdd-dot {
  color: var(--gray-300);
}

.pdd-contact-actions {
  display: flex;
  gap: var(--s-1);
}

.pdd-contact-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-400);
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pdd-contact-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-wash);
}

.pdd-contact-btn i {
  width: 14px;
  height: 14px;
}


/* ========== DEAL TIMELINE ========== */

.pdd-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  padding: var(--s-2) 0;
}

.pdd-timeline-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.pdd-timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--gray-200);
}

.pdd-timeline-step.completed:not(:last-child)::after {
  background: var(--brand);
}

.pdd-timeline-step.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--brand) 0%, var(--gray-200) 100%);
}

.pdd-timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  position: relative;
  z-index: 1;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-400);
}

.pdd-timeline-step.completed .pdd-timeline-dot {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

.pdd-timeline-step.active .pdd-timeline-dot {
  background: var(--white);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.pdd-timeline-dot i {
  width: 12px;
  height: 12px;
}

.pdd-timeline-label {
  margin-top: var(--s-1-5);
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-400);
  text-align: center;
  white-space: nowrap;
}

.pdd-timeline-step.completed .pdd-timeline-label {
  color: var(--brand);
}

.pdd-timeline-step.active .pdd-timeline-label {
  color: var(--brand);
  font-weight: 700;
}

.pdd-timeline-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gray-400);
  margin-top: 1px;
  text-align: center;
}


/* ========== COLD WARNING BANNER ========== */

.pdd-cold-warning {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--error-wash);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-6);
  animation: pdFadeSlideIn 300ms ease;
}

.pdd-cold-warning-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(239,68,68,0.12);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdd-cold-warning-icon i {
  width: 20px;
  height: 20px;
}

.pdd-cold-warning-text {
  flex: 1;
}

.pdd-cold-warning-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
}

.pdd-cold-warning-sub {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}

.pdd-cold-warning-action {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  background: var(--error);
  color: var(--white);
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.pdd-cold-warning-action:hover {
  background: #DC2626;
}


/* ========== WON BANNER ========== */

.pdd-won-banner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  background: rgba(4,120,87,0.06);
  border: 1px solid rgba(4,120,87,0.15);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-6);
}

.pdd-won-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(4,120,87,0.12);
  color: #047857;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdd-won-banner-icon i {
  width: 20px;
  height: 20px;
}

.pdd-won-banner-text {
  flex: 1;
}

.pdd-won-banner-title {
  font-weight: 700;
  font-size: 14px;
  color: #047857;
}

.pdd-won-banner-sub {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}


/* ========== LOST BANNER ========== */

.pdd-lost-banner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--error-wash);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-6);
}

.pdd-lost-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(239,68,68,0.12);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdd-lost-banner-icon i {
  width: 20px;
  height: 20px;
}

.pdd-lost-banner-text {
  flex: 1;
}

.pdd-lost-banner-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--error);
}

.pdd-lost-banner-sub {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
}


/* ========== TASKS TAB ========== */

.pdd-task-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-width: 640px;
}

.pdd-task-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--white);
  border: 1px solid var(--gray-200);
  transition: all var(--t-fast);
}

.pdd-task-item:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-xs);
}

.pdd-task-check {
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  border: 2px solid var(--gray-300);
  background: var(--white);
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdd-task-check.done {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
}

.pdd-task-check.done i {
  width: 12px;
  height: 12px;
}

.pdd-task-text {
  font-size: 14px;
  color: var(--gray-800);
  flex: 1;
}

.pdd-task-text.done {
  text-decoration: line-through;
  color: var(--gray-400);
}

.pdd-task-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-400);
}

.pdd-task-stage-label {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-weight: 600;
  white-space: nowrap;
}


/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  .pdd-header {
    padding: var(--s-4) var(--s-4);
  }

  .pdd-title-row {
    flex-direction: column;
  }

  .pdd-actions {
    margin-top: var(--s-3);
    flex-wrap: wrap;
  }

  .pdd-content {
    padding: var(--s-4) var(--s-4);
  }

  .pdd-tab-bar {
    padding: 0 var(--s-4);
  }

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

  .pdd-econ-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pdd-timeline {
    flex-wrap: wrap;
    gap: var(--s-2);
  }
}
