/**
 * WISER WORKFLOWS - CRM & Pipeline Automation Stylesheet
 * Custom styles for Follow-up Queue, SOW E-Signature, and 3-Stage Cost Transparency
 */

/* ==========================================================================
   Hero & Key Metrics Strip
   ========================================================================== */
.crm-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(43, 108, 176, 0.1);
  border: 1px solid rgba(43, 108, 176, 0.3);
  color: var(--accent-cyan);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 3.5rem;
}

@media (max-width: 900px) {
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .metrics-strip {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-lg), 0 0 20px var(--accent-cyan-glow);
}

.metric-val {
  font-size: 2.25rem;
  font-weight: 800;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.35rem;
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ==========================================================================
   Section 1: Individualized Follow-up Queue Simulator
   ========================================================================== */
.queue-simulator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 35px rgba(43, 108, 176, 0.06);
  overflow: hidden;
  margin-top: 2rem;
}

.queue-control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border-subtle);
}

.control-pill-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.control-pill-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

.persona-pill, .tone-pill {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.persona-pill:hover, .tone-pill:hover {
  background: rgba(43, 108, 176, 0.08);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.persona-pill.active, .tone-pill.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 3px 10px var(--accent-cyan-glow);
}

.queue-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  min-height: 540px;
}

@media (max-width: 1024px) {
  .queue-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Queue Timeline & Lead Intel */
.queue-left-pane {
  padding: 1.75rem;
  background: #f0f4fa;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.lead-intel-box {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.lead-intel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.lead-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.lead-score-badge {
  background: rgba(43, 108, 176, 0.12);
  color: #059669;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(43, 108, 176, 0.25);
}

.lead-intel-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lead-intel-details strong {
  color: var(--text-main);
}

/* Cadence Timeline Stepper */
.cadence-stepper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cadence-step-btn {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.cadence-step-btn:hover {
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

.cadence-step-btn.active {
  border-color: var(--accent-cyan);
  background: rgba(43, 108, 176, 0.04);
  box-shadow: 0 4px 15px rgba(43, 108, 176, 0.12);
}

.cadence-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e6edf6;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.cadence-step-btn.active .cadence-step-icon {
  background: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.cadence-step-meta {
  flex-grow: 1;
}

.cadence-step-timing {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cadence-step-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.15rem 0;
}

.cadence-step-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Right Rendered Email / Outreach Preview */
.queue-right-pane {
  padding: 1.75rem 2rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.email-preview-container {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.email-preview-header {
  background: #edf2f9;
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.email-header-row {
  display: flex;
  gap: 0.5rem;
}

.email-header-row span {
  color: var(--text-dim);
  width: 55px;
}

.email-header-row strong {
  color: var(--text-main);
}

.email-preview-body {
  padding: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #334155;
  flex-grow: 1;
  background: #ffffff;
}

.token-highlight {
  background: rgba(43, 108, 176, 0.12);
  color: #c2410c;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px dashed rgba(43, 108, 176, 0.3);
}

.email-preview-footer {
  background: #f0f4fa;
  border-top: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.email-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #059669;
  font-weight: 600;
}

/* ==========================================================================
   Section 2: Pre-Drafted SOW Contracts & E-Signature Studio
   ========================================================================== */
.sow-studio-container {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 2rem;
  margin-top: 2.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .sow-studio-container {
    grid-template-columns: 1fr;
  }
}

/* Deal Terms Controls (Left) */
.deal-terms-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.terms-control-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.term-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.term-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.term-val-badge {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-size: 0.88rem;
}

.term-slider {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.scope-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.scope-chip-btn {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.scope-chip-btn.active {
  background: rgba(15, 32, 53, 0.08);
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
}

/* SOW Contract Preview Document (Right) */
.contract-paper-frame {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 2.25rem;
  position: relative;
}

.contract-watermark {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #059669;
  background: rgba(43, 108, 176, 0.1);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(43, 108, 176, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contract-header {
  border-bottom: 2px solid #0f2035;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.contract-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f2035;
  font-family: var(--font-heading);
}

.contract-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.contract-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 0.78rem;
  margin-bottom: 1.25rem;
  background: #edf2f9;
  padding: 0.85rem;
  border-radius: var(--radius-md);
}

.contract-clause {
  margin-bottom: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #334155;
}

.clause-heading {
  font-weight: 700;
  color: #0f2035;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.milestones-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 0.6rem 0;
}

.milestones-table th, .milestones-table td {
  padding: 0.5rem 0.6rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.milestones-table th {
  background: #e6edf6;
  font-weight: 700;
  color: #475569;
}

/* E-Signature Execution Bar */
.esign-action-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.esign-trigger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.sign-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #64748b;
}

/* Downstream Trigger Flow Box */
.downstream-flow-card {
  background: #0f2035;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: #ffffff;
  display: none;
  animation: fadeIn 0.4s ease;
}

.downstream-flow-card.active {
  display: block;
}

.flow-step-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  margin-top: 0.6rem;
}

.flow-step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
}

.flow-step-item.done {
  color: #34d399;
}

/* ==========================================================================
   Section 3: Interactive 3-Stage Cost Transparency Scale
   ========================================================================== */
.transparency-container {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 35px rgba(43, 108, 176, 0.08);
  padding: 2.5rem;
  margin-top: 2.5rem;
}

.stage-segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #e6edf6;
  border-radius: var(--radius-full);
  padding: 0.35rem;
  gap: 0.35rem;
  max-width: 750px;
  margin: 0 auto 2.5rem;
}

@media (max-width: 768px) {
  .stage-segmented-control {
    grid-template-columns: 1fr;
    border-radius: var(--radius-lg);
  }
}

.stage-tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.stage-tab-btn.active {
  background: #ffffff;
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
}

/* Level 1: Executive Summary */
.exec-transparency-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .exec-transparency-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.exec-card {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.exec-card-val {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.exec-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Level 2: Milestone Breakdown Grid */
.milestone-stages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .milestone-stages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .milestone-stages-grid {
    grid-template-columns: 1fr;
  }
}

.milestone-stage-card {
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.stage-number-tag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(43, 108, 176, 0.1);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-cost-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-indigo);
  font-family: var(--font-heading);
}

.stage-items-list {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  padding-left: 1.1rem;
}

/* Level 3: Granular Itemized Costing Table */
.itemized-table-wrap {
  overflow-x: auto;
}

.itemized-cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.itemized-cost-table th, .itemized-cost-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.itemized-cost-table th {
  background: #edf2f9;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.itemized-cost-table tr:hover td {
  background: rgba(43, 108, 176, 0.02);
}

.itemized-cost-table td.cost-num {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
}

.itemized-total-row td {
  border-top: 2px solid var(--text-main);
  font-weight: 800;
  font-size: 1rem;
  background: #f0f4fa;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
