/* CRM-specific styles. Brand tokens + shared components live in nexpand.css. */

/* Lead status pills (funnel order: cool -> warm -> outcome), Nexpand ramp */
.badge[class*="status-"] { font-weight: 500; }
.status-new        { background: #EEF0F4; color: #475569; }
.status-to-connect { background: #E0E7FF; color: #3730A3; }
.status-invited    { background: #C7D2FE; color: #312E81; }
.status-connected  { background: var(--nx-primary); color: #fff; }
.status-to-contact { background: #FEF3C7; color: #92400E; }
.status-messaged   { background: #FDE68A; color: #92400E; }
.status-replied    { background: #D1FAE5; color: #065F46; }
.status-met        { background: #34D399; color: #064E3B; }
.status-won        { background: var(--nx-emerald-deep); color: #fff; }
.status-lost       { background: var(--nx-rose); color: #fff; }

/* Company status pills */
.company-status-prospect    { background: #E0E7FF; color: #3730A3; }
.company-status-customer    { background: var(--nx-emerald-deep); color: #fff; }
.company-status-ex-customer { background: var(--nx-rose-soft); color: var(--nx-rose-deep); }
.company-status-other       { background: #EEF0F4; color: #475569; }

/* Pipeline funnel bar (dashboard) */
.nx-funnel { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.nx-funnel a { display: block; height: 100%; }
.nx-funnel a:hover { opacity: .85; }
.fun-new        { background: #CBD5E1; }
.fun-to-connect { background: #A5B4FC; }
.fun-invited    { background: #818CF8; }
.fun-connected  { background: var(--nx-primary); }
.fun-to-contact { background: #FCD34D; }
.fun-messaged   { background: #FBBF24; }
.fun-replied    { background: #6EE7B7; }
.fun-met        { background: #34D399; }
.fun-won        { background: var(--nx-emerald); }
.fun-lost       { background: #FDA4AF; }

/* Sortable column arrow */
.sort-arrow { font-size: .62rem; margin-left: 3px; color: var(--nx-primary); }

/* Bulk-action bar: stays visible below the topbar while scrolling the table */
.bulk-bar {
  border: 1px solid var(--nx-primary);
  background: var(--nx-primary-softer);
  position: sticky;
  top: calc(var(--nx-topbar-h) + 8px);
  z-index: 20;
  box-shadow: var(--nx-shadow-lg);
}

/* Activity timeline on the person page */
.timeline { position: relative; margin: 0; }
.timeline-item { position: relative; padding: 0 0 .9rem 1.2rem; border-left: 2px solid var(--nx-border); }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot { position: absolute; left: -7px; top: .15rem; width: 12px; height: 12px; border-radius: 50%; background: var(--nx-primary); border: 2px solid #fff; }
.timeline-item.kind-note .timeline-dot { background: var(--nx-muted); }
.timeline-item.kind-invitation .timeline-dot { background: var(--nx-amber); }
.timeline-item.kind-message .timeline-dot { background: var(--nx-emerald); }
.timeline-item.kind-imported .timeline-dot { background: var(--nx-faint); }
.timeline-text { font-size: .88rem; }
.timeline-time { font-size: .72rem; }

/* Last-message preview in tables: max two lines */
.msg-preview {
  font-size: .8rem;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 280px;
}

/* Message history bubbles */
.chat-body { max-height: 560px; overflow-y: auto; background: #FBFCFE; }
.chat-row { display: flex; margin-bottom: .6rem; }
.chat-row.me { justify-content: flex-end; }
.chat-row.them { justify-content: flex-start; }
.chat-bubble {
  max-width: 70%;
  padding: .5rem .8rem;
  border-radius: 1rem;
  font-size: .9rem;
  white-space: pre-wrap;
}
.chat-row.me .chat-bubble { background: var(--nx-primary); color: #fff; border-bottom-right-radius: .2rem; }
.chat-row.them .chat-bubble { background: #EEF0F4; color: var(--nx-text); border-bottom-left-radius: .2rem; }
.chat-time { font-size: .68rem; opacity: .7; margin-top: .2rem; text-align: right; }

/* Legacy stat-card (still used on a few pages) */
.stat-card { transition: box-shadow .15s; border-radius: var(--nx-radius-lg); }
.stat-card:hover { box-shadow: 0 2px 10px rgba(79, 70, 229, .18); }

/* English file inputs: the native control's button text follows the BROWSER
   locale ("Fájl kiválasztása" on Hungarian Chrome), so base.html wraps every
   file input in this overlay control with our own English labels. */
.nx-file { position: relative; display: inline-flex; align-items: center; gap: .5rem; max-width: 100%; }
.nx-file input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 2; padding: 0; margin: 0;
}
.nx-file .nx-file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

/* Inline name editing on the people tables: double-click a name and the
   cell swaps to a small input. */
.nx-name-wrap.editing .nx-name-text { display: none; }
.nx-name-input { display: inline-block; width: 9rem; }
