/* Round 14: chip badges shared by the CRM and the Sales app (see /shared/chips.js). */
.ff-badge-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.ff-badge {
  display: inline-block; font-size: 10.5px; font-weight: 600; line-height: 1.5;
  padding: 0 7px; border-radius: 10px; white-space: nowrap; border: 1px solid transparent;
}

/* Customer stage */
.ff-stage { background: #eef1ee; color: #4b5a51; }
.ff-stage-lead { background: #eef1ee; color: #4b5a51; }
.ff-stage-contacted { background: #e8f0fb; color: #1d4ed8; }
.ff-stage-quoted { background: #f3e8ff; color: #7e22ce; }
.ff-stage-sampled { background: #fdf2e3; color: #b45309; }
.ff-stage-first_order { background: #e3f6e9; color: #1f5c38; }
.ff-stage-repeat { background: #1f5c38; color: #ffffff; }
.ff-stage-dormant { background: #f1f1f1; color: #8a8a8a; }

/* Follow-up date */
.ff-followup-upcoming { background: #f6f7f5; color: #6b7a71; border-color: #e2e6e2; }
.ff-followup-today { background: #fff4d6; color: #92600a; border-color: #f3d58a; }
.ff-followup-overdue { background: #fde8e8; color: #b91c1c; border-color: #f5b5b5; }

/* Cross-app status */
.ff-with-sales { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.ff-in-crm { background: #e3f6e9; color: #1f5c38; border-color: #bfe3cb; }

/* Timeline extras */
.ff-tl-inbox { font-size: 10.5px; color: #0369a1; background: #e0f2fe; border-radius: 8px; padding: 0 5px; margin-left: 2px; }
.timeline-entry.ff-tl-handoff { background: #eef6fb; padding: 6px 8px; border-radius: 6px; border-bottom: none; margin: 4px 0; }

/* Stage + follow-up editor */
.ff-stage-row { display: flex; gap: 8px; }
.ff-stage-row select, .ff-stage-row input { flex: 1; min-width: 0; }

/* "Forgot password?" on login screens */
.ff-link-btn { background: none !important; border: none; color: var(--green-dark, #1f5c38) !important; font-size: 13px; cursor: pointer; padding: 6px 0 !important; text-decoration: underline; width: auto !important; }
.ff-ok-msg { color: #1f5c38; font-size: 13px; margin-top: 8px; }

/* Round 16: Lead Status = Needs Attention board (colour comes from the board) */
.ff-lead-status { background: color-mix(in srgb, var(--ls) 14%, transparent); color: color-mix(in srgb, var(--ls) 75%, #111); border: 1px solid color-mix(in srgb, var(--ls) 40%, transparent); }
.ff-lead-status i { display:inline-block; width:7px; height:7px; border-radius:50%; background: var(--ls); margin-right:4px; vertical-align: 1px; }
.ff-lead-status.ff-clickable { cursor: pointer; }
.ff-lead-status.ff-clickable:hover { filter: brightness(0.95); }
.ff-status-picker { position: fixed; z-index: 1000; background: #fff; border: 1px solid #d8dfdb; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; min-width: 220px; max-height: 60vh; overflow-y: auto; font-size: 13px; }
.ff-status-picker .ff-sp-title { font-size: 11px; color: #6b7a71; padding: 4px 8px; }
.ff-status-picker .ff-sp-item { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.ff-status-picker .ff-sp-item:hover { background: #f1f5f3; }
.ff-status-picker .ff-sp-item.current { font-weight: 600; }
.ff-status-picker .ff-sp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ff-status-picker .ff-sp-clear { color: #b91c1c; border-top: 1px solid #eef1ef; margin-top: 4px; }

/* Round 16c: wholesale portal labels on chips */
.ff-portal-user { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.ff-quotes-requested { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

/* Round 15b: latest status update on chips + the status pop-up (both apps) */
.ff-latest-status { font-size: 11.5px; line-height: 1.35; color: #3f4b44; background: #f4f7f5; border-left: 3px solid #2f7d4f; border-radius: 4px; padding: 3px 6px; margin: 4px 0 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ff-latest-status .ff-ls-who { color: #7b8a81; white-space: nowrap; }
.ff-sp-overlay { position: fixed; inset: 0; background: rgba(15,23,19,.45); display: flex; align-items: center; justify-content: center; z-index: 3000; padding: 16px; }
.ff-sp-box { background: #fff; border-radius: 14px; padding: 20px; width: 440px; max-width: 100%; max-height: 92vh; overflow-y: auto; font-family: inherit; color: #1f2a24; text-align: left; }
.ff-sp-box h3 { margin: 0 0 6px; font-size: 18px; }
.ff-sp-sub { color: #6b7a71; font-size: 13px; margin: 0 0 12px; overflow-wrap: anywhere; }
.ff-sp-box label { display: block; font-size: 12.5px; color: #6b7a71; margin-bottom: 10px; }
.ff-sp-box select, .ff-sp-box textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #e2e6e2; border-radius: 8px; font: inherit; font-size: 14px; color: #1f2a24; background: #fff; box-sizing: border-box; }
.ff-sp-box textarea { min-height: 84px; resize: vertical; }
.ff-sp-box .ff-sp-check { display: flex; align-items: center; gap: 8px; color: #1f2a24; font-size: 13.5px; }
.ff-sp-box .ff-sp-check input { width: auto; margin: 0; }
.ff-sp-error { color: #b42318; font-size: 13px; min-height: 18px; }
.ff-sp-actions { display: flex; gap: 8px; margin-top: 6px; }
.ff-sp-actions button { padding: 9px 16px; border-radius: 8px; border: 1px solid #2f7d4f; font-weight: 600; cursor: pointer; font: inherit; font-weight: 600; }
.ff-sp-ok { background: #2f7d4f; color: #fff; }
.ff-sp-ok:hover { background: #1f5c38; }
.ff-sp-cancel { background: #fff; color: #1f5c38; }
.ff-sp-foot { color: #8a978f; font-size: 11.5px; margin: 10px 0 0; }
@media (max-width: 640px) { .ff-sp-overlay { align-items: flex-end; padding: 0; } .ff-sp-box { border-radius: 14px 14px 0 0; } }
