/* Sales-Cycle Velocity panel — /dept/sales?tab=velocity.
   Self-contained styling for the migrated Pipeline Manager velocity surface. */

#panel-velocity .sv-root { padding: 4px 2px 40px; }

#panel-velocity .sv-intro { margin-bottom: 18px; }
#panel-velocity .sv-intro-title { font-size: 1.15rem; font-weight: 700; }
#panel-velocity .sv-intro-sub { font-size: 0.85rem; opacity: 0.7; margin-top: 2px; }
#panel-velocity .sv-fy { opacity: 0.6; }

/* Toggle bar */
#panel-velocity .sv-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-bottom: 18px; padding: 12px 14px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
}
#panel-velocity .sv-ctrl { display: flex; flex-direction: column; gap: 4px; }
#panel-velocity .sv-ctrl-check { flex-direction: row; align-items: center; gap: 7px; }
#panel-velocity .sv-ctrl-l { font-size: 0.72rem; font-weight: 600; opacity: 0.7; }
#panel-velocity .sv-select {
  padding: 6px 10px; border-radius: 7px; font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.05); color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
#panel-velocity .sv-ctrl-check input { width: 15px; height: 15px; accent-color: var(--accent, #6366f1); }
#panel-velocity .sv-pop { margin-left: auto; font-size: 0.78rem; opacity: 0.6; font-weight: 600; }

#panel-velocity .sv-loading,
#panel-velocity .sv-error { padding: 24px 4px; opacity: 0.75; }
#panel-velocity .sv-error { color: var(--error, #ef4444); }
#panel-velocity .sv-empty { padding: 14px 4px; opacity: 0.6; font-size: 0.85rem; }

/* KPI strip */
#panel-velocity .sv-kpis {
  display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px;
}
#panel-velocity .sv-kpi {
  flex: 1 1 180px; padding: 14px 18px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
}
#panel-velocity .sv-kpi-v { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
#panel-velocity .sv-kpi-v.green { color: var(--success, #22c55e); }
#panel-velocity .sv-kpi-v.red { color: var(--error, #ef4444); }
#panel-velocity .sv-kpi-v.accent { color: var(--accent, #6366f1); }
#panel-velocity .sv-kpi-l { font-size: 0.8rem; font-weight: 600; margin-top: 4px; }
#panel-velocity .sv-kpi-sub { font-size: 0.72rem; opacity: 0.55; margin-top: 1px; }

/* Cards */
#panel-velocity .sv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 900px) { #panel-velocity .sv-grid { grid-template-columns: 1fr; } }
#panel-velocity .sv-card {
  padding: 16px 18px; border-radius: 10px; margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.08);
}
#panel-velocity .sv-card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }
#panel-velocity .sv-hint { font-weight: 400; opacity: 0.55; font-size: 0.78rem; margin-left: 6px; }

/* Time-in-stage bars */
#panel-velocity .sv-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 7px;
}
#panel-velocity .sv-bar-label { flex: 0 0 140px; font-size: 0.82rem; }
#panel-velocity .sv-bar-track {
  flex: 1 1 auto; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.06); overflow: hidden;
}
#panel-velocity .sv-bar-fill {
  height: 100%; border-radius: 5px; background: var(--accent, #6366f1); min-width: 2px;
}
#panel-velocity .sv-bar-val { flex: 0 0 120px; text-align: right; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
#panel-velocity .sv-bar-sub { opacity: 0.5; font-size: 0.72rem; }

/* Tables */
#panel-velocity .sv-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
#panel-velocity .sv-table th, #panel-velocity .sv-table td {
  padding: 7px 10px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#panel-velocity .sv-table th { font-weight: 600; opacity: 0.8; white-space: nowrap; }
#panel-velocity .sv-table th.right, #panel-velocity .sv-table td.right { text-align: right; }
#panel-velocity .sv-table td.mono, #panel-velocity .sv-table .mono { font-variant-numeric: tabular-nums; }
#panel-velocity .sv-sortable { cursor: pointer; user-select: none; }
#panel-velocity .sv-sortable:hover { opacity: 1; }
#panel-velocity .sv-arrow { opacity: 0.4; font-size: 0.72rem; }

#panel-velocity .sv-scroll { max-height: 520px; overflow-y: auto; }
#panel-velocity .sv-trunc { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-velocity .sv-stage-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.74rem;
  background: rgba(99, 102, 241, 0.15); color: var(--accent, #8b8ff5);
}

/* Product rows — expandable stage drill */
#panel-velocity .sv-prod-row { cursor: pointer; }
#panel-velocity .sv-prod-row:hover { background: rgba(255, 255, 255, 0.03); }
#panel-velocity .sv-caret { opacity: 0.5; display: inline-block; width: 12px; }
#panel-velocity .sv-prod-detail td { padding: 0; }
#panel-velocity .sv-prod-detail-box {
  padding: 10px 14px 14px 34px; background: rgba(255, 255, 255, 0.02);
}
