/* page-deal-detail.css — Deal detail as its own page.
 *
 * The detail body (Details grid, Telematics, Activities, Notes, timeline,
 * archive, status pills, and the won/lost reason dialog) reuses the shared
 * .pd-* classes defined in page-pipeline.css — those styles are global, so the
 * page inherits the exact look the drawer had. This file only styles the page
 * shell: the back link, the editable page-header title, and the controls row.
 * All new rules are scoped under .deal-detail-page / .dd-*. */

.deal-detail-page {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 4px 4px 32px;
}

/* Back link */
.deal-detail-page .dd-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 0.85rem;
}
.deal-detail-page .dd-back:hover { color: var(--color-primary, #4f46e5); }

/* Header: editable title + org/contact subline */
.deal-detail-page .dd-header { margin-bottom: 0.9rem; }

.deal-detail-page .dd-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.deal-detail-page .dd-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-text);
  border-radius: 6px;
}
.deal-detail-page .dd-title-editable { cursor: text; }
.deal-detail-page .dd-title-editable:hover {
  box-shadow: inset 0 0 0 1px var(--color-border);
  padding: 0 6px;
  margin: 0 -6px;
}

/* Rename affordance next to the H1 */
.deal-detail-page .dd-title-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.deal-detail-page .dd-title-edit:hover {
  color: var(--color-primary, #4f46e5);
  border-color: var(--color-primary, #4f46e5);
}
.deal-detail-page .dd-title-edit svg { display: block; }

/* Inline rename input (replaces the H1 while editing) */
.deal-detail-page .dd-title-input {
  flex: 1;
  min-width: 220px;
  font-size: 1.35rem;
  font-weight: 700;
  padding: 5px 9px;
  border: 1px solid var(--color-primary, #4f46e5);
  border-radius: 6px;
  background: var(--color-surface, #fff);
  color: var(--color-text);
}
.deal-detail-page .dd-title-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.deal-detail-page .dd-org {
  margin-top: 5px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Controls row (value + stage select + status pill + action buttons).
   .pd-detail-controls supplies the base flex layout from page-pipeline.css;
   these tweaks adapt it for the wider page context. */
.deal-detail-page .dd-controls {
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

/* Not-found state */
.deal-detail-page .dd-notfound {
  text-align: center;
  padding: 3rem 1rem;
}
.deal-detail-page .dd-notfound .dd-title { justify-content: center; }
.deal-detail-page .dd-notfound-msg {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin: 0.6rem 0 1.4rem;
}

@media (max-width: 640px) {
  .deal-detail-page { padding-left: 2px; padding-right: 2px; }
  .deal-detail-page .dd-title { font-size: 1.35rem; }
}
