/* Pipeline Work Queue v3 styles */

/* ── KPI strip ─────────────────────────────────────────────── */
.wq-kpis {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px 4px;
}
.wq-kpi {
  background: #1a2035;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 12px 20px;
  min-width: 110px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.wq-kpi:hover { border-color: #4b5563; background: #1e2945; }
.wq-kpi-alert { border-color: #ef4444 !important; }
.wq-kpi-active { border-color: #22d3ee !important; }
.wq-kpi-money  { border-color: #22c55e !important; }
.wq-kpi-v { font-size: 24px; font-weight: 800; color: #f1f5f9; line-height: 1; }
.wq-kpi-l { font-size: 11px; color: #94a3b8; margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.wq-kpi-alert .wq-kpi-v { color: #f87171; }
.wq-kpi-active .wq-kpi-v { color: #22d3ee; }
.wq-kpi-money  .wq-kpi-v { color: #4ade80; }

/* ── Toolbar ──────────────────────────────────────────────── */
.wq-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px 0;
}
.wq-view-tabs {
  display: flex;
  gap: 4px;
  background: #0f1219;
  border: 1px solid #2d3748;
  border-radius: 8px;
  padding: 3px;
}
.wq-tab {
  background: transparent;
  border: none;
  color: #9ca3af;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.wq-tab:hover  { color: #e2e8f0; background: #1a2035; }
.wq-tab.active { background: #1e40af; color: #fff; }
.wq-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}
.wq-search {
  flex: 1;
  background: #0f1219;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #f1f5f9;
  padding: 7px 12px;
  font-size: 13px;
}
.wq-search:focus { outline: none; border-color: #3b82f6; }
.wq-refresh-btn {
  background: #1a2035;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  padding: 6px 10px;
}
.wq-refresh-btn:hover { color: #e2e8f0; border-color: #4b5563; }
.wq-ts { font-size: 11px; color: #6b7280; white-space: nowrap; }

/* ── Section headers ──────────────────────────────────────── */
.wq-section { margin: 20px 20px 0; }
.wq-section-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2d3748;
}
.wq-sec-icon  { font-size: 18px; }
.wq-sec-title { font-size: 15px; font-weight: 700; color: #e2e8f0; }
.wq-sec-count { font-size: 13px; color: #6b7280; }
.wq-show-more {
  margin-left: auto;
  background: transparent;
  border: 1px solid #374151;
  color: #9ca3af;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}
.wq-show-more:hover { border-color: #4b5563; color: #e2e8f0; }

/* ── Cards grid ───────────────────────────────────────────── */
.wq-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  padding-bottom: 8px;
}
.wq-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 14px 16px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.wq-card:hover { border-color: #374151; box-shadow: 0 2px 12px rgba(0,0,0,.4); }
.wq-card-urgent { border-left: 3px solid #ef4444 !important; }

/* Card top row */
.wq-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.wq-card-main { flex: 1; min-width: 0; }
.wq-card-org  { font-size: 15px; font-weight: 700; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wq-card-contact { font-size: 12px; color: #94a3b8; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wq-card-email { color: #6b7280; font-size: 11px; }
.wq-card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.wq-ask { font-size: 14px; font-weight: 700; color: #4ade80; }

/* Badges */
.wq-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .04em; }
.wq-badge-grey   { background: #374151; color: #9ca3af; }
.wq-badge-blue   { background: #1e3a5f; color: #60a5fa; }
.wq-badge-green  { background: #14532d; color: #4ade80; }
.wq-badge-orange { background: #431407; color: #fb923c; }
.wq-badge-yellow { background: #422006; color: #fbbf24; }
.wq-badge-teal   { background: #0c2d3a; color: #22d3ee; }
.wq-prio { font-size: 11px; color: #9ca3af; }

/* Touch row */
.wq-touch-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
  background: #0f1219;
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.wq-touch-stale { border-left: 2px solid #ef4444; }
.wq-touch-none  { color: #4b5563; font-style: italic; }
.wq-touch-icon  { font-size: 13px; flex-shrink: 0; }
.wq-touch-when  { color: #cbd5e1; font-weight: 600; flex-shrink: 0; }
.wq-touch-subj  { color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.wq-touch-more  { font-size: 10px; color: #4b5563; cursor: pointer; flex-shrink: 0; }
.wq-touch-more:hover { color: #9ca3af; }

/* History expansion */
.wq-history { background: #0a0f1a; border-radius: 6px; padding: 8px; margin-bottom: 6px; }
.wq-hist-row {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: #6b7280;
  padding: 3px 0;
  border-bottom: 1px solid #1f2937;
  align-items: center;
}
.wq-hist-row:last-child { border-bottom: none; }

/* Notes */
.wq-card-notes { font-size: 11px; color: #6b7280; margin-bottom: 8px; line-height: 1.4; }

/* Action buttons */
.wq-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.wq-btn {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity .15s;
}
.wq-btn:hover { opacity: .85; }
.wq-btn-primary  { background: #1e40af; color: #fff; }
.wq-btn-ghost    { background: #1a2035; border: 1px solid #374151; color: #9ca3af; }
.wq-btn-ghost:hover { color: #e2e8f0; border-color: #4b5563; }
.wq-btn-disabled { background: #1a2035; border: 1px solid #1f2937; color: #374151; cursor: not-allowed; }

/* ── Table view ───────────────────────────────────────────── */
.wq-table-meta { font-size: 13px; padding: 8px 4px; color: #6b7280; }
#wq-table-view { padding: 16px 20px; }
.wq-inline-edit { background: #1a1f2e; padding: 16px; }
.wq-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.wq-edit-grid label { font-size: 11px; color: #9ca3af; display: block; margin-bottom: 4px; }
.wq-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #0f1219;
  color: #fff;
  font-size: 13px;
  box-sizing: border-box;
}
.wq-input:focus { outline: none; border-color: #3b82f6; }
.wq-edit-btns { display: flex; gap: 8px; margin-top: 8px; }

/* ── Funnel view ──────────────────────────────────────────── */
#wq-funnel-view { padding: 16px 20px; }

/* ── Edit modal ───────────────────────────────────────────── */
.wq-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wq-modal {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.wq-modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}
.wq-modal-close {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 18px;
  cursor: pointer;
}
.wq-modal-close:hover { color: #e2e8f0; }
.wq-modal .wq-edit-grid { grid-template-columns: 1fr 1fr; }

/* ── Errors ───────────────────────────────────────────────── */
.wq-error { color: #f87171; font-size: 13px; padding: 12px; background: #1a0a0a; border-radius: 6px; }
