/* ===== Single-row filter bar ===== */
.filterBar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
@media (min-width: 1280px) {
  .filterBar {
    flex-wrap: nowrap;
  }
}
.filterSearch {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
}
.filterSearch i {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--text-main);
  opacity: 0.45;
  font-size: 14.3px;
}
.filterSearch input {
  width: 100%;
  padding: 8px 10px 8px 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.2px;
  background: var(--background);
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}
.filterSearch input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.filterSelect {
  padding: 8px 28px 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  font-size: 13.2px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 160px;
  transition: all 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3e%3cpath d='M4.5 6l3.5 4 3.5-4z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filterSelect:hover {
  border-color: var(--primary);
}
.filterSelect:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.filterDateWrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.filterDateInput {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  font-size: 13.2px;
  color: var(--text-main);
  width: 120px;
  font-family: inherit;
  flex-shrink: 0;
}
.filterDateInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.filterToggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.8px;
  font-weight: 700;
  color: var(--text-main);
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.2;
}
.filterToggle:hover {
  background: var(--surface);
  border-color: var(--primary-soft);
  transform: translateY(-0.5px);
}
.filterToggle:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-sm);
}
.filterToggle input {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.filterClear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 13.2px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filterClear:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filterApply {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  font-size: 13.2px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filterApply:hover {
  background: var(--primary-hover);
}

/* ===== Status & priority chips ===== */
.statusChip {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.s_NEW { background: rgba(99, 102, 241, 0.16); color: #3730a3; }
.s_CONTACTED { background: rgba(14, 165, 233, 0.16); color: #075985; }
.s_QUALIFIED { background: rgba(168, 85, 247, 0.16); color: #6b21a8; }
.s_PROPOSAL { background: rgba(245, 158, 11, 0.18); color: #78350f; }
.s_NEGOTIATION { background: rgba(217, 70, 239, 0.16); color: #86198f; }
.s_WON { background: rgba(22, 163, 74, 0.18); color: #14532d; }
.s_LOST { background: rgba(220, 38, 38, 0.18); color: #7f1d1d; }
.s_ON_HOLD { background: var(--border); color: var(--text-main); }

.priorityChip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.p_LOW { background: var(--border); color: var(--text-main); }
.p_MEDIUM { background: rgba(59, 130, 246, 0.14); color: #1e3a8a; }
.p_HIGH { background: rgba(245, 158, 11, 0.18); color: #78350f; }
.p_HOT { background: rgba(220, 38, 38, 0.18); color: #7f1d1d; }

/* ===== Dashboard cards ===== */
.dashGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.dashCard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 132px;
  justify-content: center;
}
.dashLabel {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-main);
  opacity: 0.65;
  font-weight: 600;
}
.dashValue {
  font-size: 26.4px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dashHint {
  font-size: 12.1px;
  color: var(--text-main);
  opacity: 0.55;
  margin-top: 2px;
}
.dashAccent_primary { border-left: 3px solid var(--primary); }
.dashAccent_success { border-left: 3px solid var(--primary-mid); }
.dashAccent_amber { border-left: 3px solid var(--primary-soft); }
.dashAccent_danger { border-left: 3px solid var(--primary); }

.dashSection {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 18px;
}
.dashSection h3 {
  font-size: 15.4px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13.2px;
}
.barLabel {
  flex-shrink: 0;
  width: 130px;
  color: var(--text-main);
  font-weight: 600;
}
.barTrack {
  flex: 1;
  height: 12px;
  background: var(--background);
  border-radius: 6px;
  overflow: hidden;
}
.barFill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: 6px;
  transition: width 0.35s ease;
}
.barCount {
  width: 60px;
  text-align: right;
  color: var(--text-main);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.recentList {
  display: flex;
  flex-direction: column;
}
.recentRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.recentRow:last-child {
  border-bottom: none;
}
.recentName {
  flex: 1;
  font-weight: 600;
  font-size: 14.3px;
  color: var(--text-main);
}
.recentMeta {
  font-size: 12.1px;
  color: var(--text-main);
  opacity: 0.6;
}

/* ===== Kanban ===== */
.kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: flex-start;
}
.kanCol {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanCol.dragOver {
  border-color: var(--primary);
  background: var(--primary-light);
}
.kanColHeader {
  padding: 14px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.kanColTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.7px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
}
.kanColTitle i {
  font-size: 15.4px;
}
.kanCount {
  font-size: 12.1px;
  font-weight: 600;
  color: var(--text-main);
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.kanColBody {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}
.kanCard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px;
  cursor: grab;
  transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.kanCard:hover {
  border-color: var(--primary-soft);
  box-shadow: 0 8px 16px -10px rgba(15, 23, 42, 0.18),
    0 2px 4px rgba(15, 23, 42, 0.04);
  transform: translateY(-2px);
}
.kanCard:active {
  cursor: grabbing;
}
.kanCard.dragging {
  opacity: 0.5;
}
.kanCardName {
  font-size: 15.4px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.kanCardCompany {
  font-size: 13.2px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
}
.kanCardMeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12.7px;
  color: var(--text-muted);
  font-weight: 500;
  gap: 8px;
}
.kanCardValue {
  font-weight: 700;
  color: var(--primary);
  font-size: 14.3px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.kanEmpty {
  font-size: 12.1px;
  color: var(--text-main);
  opacity: 0.4;
  text-align: center;
  padding: 24px 8px;
  font-style: italic;
}

/* Clear-filters button pinned to the right of the filter bar */
.filterClearRight {
  margin-left: auto;
}

/* ============== TYPOGRAPHY POLISH (LEADS MODULE) ==============
 * Scoped, opt-in heading rhythm + tabular numbers via the .typeScope
 * class. The leads pages add this class on their outer container so
 * the polish applies without affecting other modules.
 */
.typeScope h2,
.typeScope h3,
.typeScope h4 {
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.typeScope :global(.tabular),
.typeScope [data-num],
.typeScope :global(table) td,
.typeScope :global(table) th,
.typeScope :global([class*="kpiValue"]),
.typeScope :global([class*="kpiHint"]),
.typeScope :global([class*="cardTitle"]) {
  font-variant-numeric: tabular-nums;
}
