/* Extends assessment_review.css's variables/login-screen/tiny-btn - same
   dark/gold CRM styling, just a wider board layout instead of a single
   list. */

.pipeline-screen {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.sp-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.sp-summary-bar:empty { margin-bottom: 0; }
.sp-summary-box {
  background: var(--rv-panel);
  border: 2px solid var(--rv-panel-light);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 200px;
  flex: 1 1 220px;
}
.sp-summary-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rv-muted);
  margin-bottom: 4px;
}
.sp-summary-stat { font-size: 20px; font-weight: bold; }
.sp-summary-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--rv-muted);
}

.sp-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.sp-primary-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 6px;
  border: none;
  background: var(--rv-accent);
  color: #14100a;
  cursor: pointer;
}
.sp-primary-btn:hover { filter: brightness(1.08); }

.sp-new-lead-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--rv-panel);
  border: 2px solid var(--rv-panel-light);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.sp-new-lead-form input,
.sp-new-lead-form select {
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 6px;
  border: 2px solid var(--rv-panel-light);
  background: var(--rv-panel-dark);
  color: var(--rv-text);
  flex: 1 1 180px;
  min-width: 140px;
}
.sp-new-lead-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.sp-new-lead-form .login-error { margin: 0; flex-basis: 100%; }

/* Website Inquiries module - "Prospecting & Lead Generation" card
   follow-up, 2026-08-24: a table view modeled on the Odoo Leads-list
   screenshot attached to that card (CREATE button top-left, plain
   columns, list defaults to a page of rows) rather than the pipeline's
   own card-grid look, since the ask was explicitly to "copy that view as
   close as possible". Sits between the New Lead form and the board -
   only shown on the Lead Generation single-stage page, see
   sales_pipeline.js's renderInquiries(). */
.sp-inquiries-module {
  background: var(--rv-panel);
  border: 2px solid var(--rv-panel-light);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.sp-inquiries-header h2 { margin: 0 0 4px; font-size: 15px; }
.sp-inquiries-header .rv-sub { margin: 0 0 12px; font-size: 12px; }
.sp-inquiries-table-wrap { overflow-x: auto; }
.sp-inquiries-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sp-inquiries-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rv-muted);
  border-bottom: 2px solid var(--rv-panel-light);
  padding: 6px 10px;
  white-space: nowrap;
}
.sp-inquiries-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rv-panel-light);
  vertical-align: top;
}
.sp-inquiries-table tbody tr:last-child td { border-bottom: none; }
.sp-inquiries-table a { color: var(--rv-accent); text-decoration: none; }
.sp-inquiries-table a:hover { text-decoration: underline; }
.sp-inquiries-title { font-weight: bold; }
.sp-inquiries-desc {
  color: var(--rv-muted);
  font-size: 11px;
  max-width: 320px;
  white-space: pre-wrap;
  word-break: break-word;
}
.sp-inquiries-title-cell { min-width: 180px; }
.sp-inquiries-convert-btn { white-space: nowrap; }
/* "Not a lead", beside Convert. Quieter than the convert button and NOT
   red: rejecting an inquiry is a routine triage decision, not a
   destructive one - nothing is deleted, the submission keeps its record.
   .sp-dismiss-btn's own colour is scoped to .sp-card-actions, so this
   needs its own rule rather than inheriting one that never applied. */
.sp-inquiries-reject-btn {
  white-space: nowrap;
  margin-left: 6px;
  color: var(--rv-muted);
  background: transparent;
  border: 1px solid var(--rv-panel-light);
}
.sp-inquiries-reject-btn:hover { color: var(--rv-danger); border-color: var(--rv-danger); }
.sp-inquiries-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.sp-inquiries-pager-count { font-size: 11px; color: var(--rv-muted); }

.sp-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

/* Landed here via a crm_sales.html module tile's own ?stage= link rather
   than the full pipeline overview - just the one stage's column, sized to
   read comfortably instead of a 220px sliver in an otherwise-empty grid.
   Compound selector (not just .sp-board-single) so this outranks the
   narrow-viewport .sp-board overrides below by specificity, not source
   order - a single column is already what those collapse to anyway, but
   at the 280-560px sizing here rather than their 220px. */
.sp-board.sp-board-single {
  grid-template-columns: minmax(280px, 560px);
}

.sp-column {
  background: var(--rv-panel-dark);
  border: 2px solid var(--rv-panel-light);
  border-radius: 10px;
  padding: 10px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-column-header {
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--rv-panel-light);
}
.sp-column-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.sp-column-header h3 { margin: 0; font-size: 13px; }
.sp-column-count {
  font-size: 11px;
  color: var(--rv-muted);
  background: var(--rv-panel-light);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.sp-tool-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-family: inherit;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--rv-panel-light);
  background: var(--rv-panel);
  color: var(--rv-muted);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-tool-btn:hover { color: var(--rv-accent); border-color: var(--rv-accent); }
/* Rendered as an <a> for a stage whose tool has its own page (tool_url in
   sales_pipeline.py) instead of a modal - keep it looking like the button. */
a.sp-tool-btn { text-decoration: none; text-align: center; box-sizing: border-box; }

.sp-column-empty { font-size: 11px; color: var(--rv-muted); padding: 4px; }

.sp-card {
  background: var(--rv-panel);
  border: 2px solid var(--rv-panel-light);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
}

.sp-card-company { font-weight: bold; font-size: 13px; }
.sp-card-contact { color: var(--rv-muted); margin-bottom: 4px; }
.sp-card-meta { color: var(--rv-muted); font-size: 11px; margin-bottom: 6px; }
.sp-card-meta a { color: var(--rv-accent); text-decoration: none; }
.sp-card-meta a:hover { text-decoration: underline; }

.sp-card-assigned {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--rv-muted);
}
.sp-assign-btn {
  font-family: inherit;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--rv-panel-light);
  background: var(--rv-panel-dark);
  color: var(--rv-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.sp-assign-btn:hover { color: var(--rv-accent); border-color: var(--rv-accent); }

.sp-card-notes {
  background: var(--rv-panel-dark);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 8px;
  max-height: 110px;
  overflow-y: auto;
}
.sp-card-note { margin-bottom: 4px; white-space: pre-wrap; word-break: break-word; }
.sp-card-note:last-child { margin-bottom: 0; }
.sp-card-note-time { color: var(--rv-muted); font-size: 10px; display: block; }
.sp-card-no-notes { color: var(--rv-muted); font-style: italic; }

.sp-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.sp-card-priority { color: var(--rv-accent); font-size: 12px; letter-spacing: 1px; }
.sp-card-tag {
  font-size: 10px;
  color: var(--rv-muted);
  background: var(--rv-panel-dark);
  border: 1px solid var(--rv-panel-light);
  border-radius: 10px;
  padding: 1px 7px;
}

.sp-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-card-actions button {
  font-family: inherit;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 5px;
  border: 2px solid var(--rv-panel-light);
  background: var(--rv-panel-dark);
  color: var(--rv-text);
  cursor: pointer;
}
.sp-card-actions button:hover { background: var(--rv-panel-light); }
.sp-card-actions .sp-advance-btn { border-color: var(--rv-accent); color: var(--rv-accent); }
.sp-card-actions .sp-dismiss-btn { color: var(--rv-danger); }

.sp-dismissed-section { margin-top: 26px; }
.sp-dismissed-section h2 { font-size: 15px; margin: 0 0 10px; }
.sp-dismissed-list { display: flex; flex-direction: column; gap: 8px; }
.sp-dismissed-card {
  background: var(--rv-panel);
  border: 2px solid var(--rv-panel-light);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  opacity: 0.75;
}
.sp-dismissed-reason { color: var(--rv-danger); }

.sp-closed-card-won { border-color: var(--rv-accent); }
.sp-closed-card-lost { border-color: var(--rv-danger); }
.sp-closed-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 10px;
  padding: 1px 7px;
  margin-right: 6px;
}
.sp-closed-badge-won { color: #14100a; background: var(--rv-accent); }
.sp-closed-badge-lost { color: #fff; background: var(--rv-danger); }
/* Neutral, not red. A dismissal is a decision that the lead was not a fit
   - it is not a loss, and colouring it like one would overstate what
   happened. Muted panel tone so it reads as filed rather than as failed. */
.sp-dismissed-badge { color: var(--rv-muted); background: var(--rv-panel-light); }
/* The badge sits inline before the text, so the card stops being a flat
   line of names once it carries one. */
.sp-dismissed-card-badged { opacity: 0.85; }
.sp-closed-category { color: var(--rv-muted); font-style: italic; }

.sp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.sp-modal {
  background: var(--rv-panel);
  border: 2px solid var(--rv-panel-light);
  border-radius: 12px;
  padding: 24px 26px;
  max-width: 360px;
  text-align: center;
}
.sp-modal h2 { margin: 0 0 10px; font-size: 18px; }
.sp-modal p { margin: 0 0 18px; font-size: 13px; color: var(--rv-muted); }

.sp-modal-form { max-width: 400px; text-align: left; }
.sp-close-lost-fields { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sp-close-lost-fields label { font-size: 11px; color: var(--rv-muted); }
.sp-close-lost-fields select,
.sp-close-lost-fields textarea {
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 6px;
  border: 2px solid var(--rv-panel-light);
  background: var(--rv-panel-dark);
  color: var(--rv-text);
  resize: vertical;
}
.sp-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.sp-assign-fields { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sp-assign-fields label { font-size: 11px; color: var(--rv-muted); }
.sp-assign-fields select {
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 6px;
  border: 2px solid var(--rv-panel-light);
  background: var(--rv-panel-dark);
  color: var(--rv-text);
}
.sp-assign-fields .tiny-btn { align-self: flex-start; margin-top: 2px; }

@media (max-width: 1100px) {
  .sp-board { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}
@media (max-width: 620px) {
  .sp-board { grid-template-columns: minmax(220px, 1fr); }
}
