/* Stage-first pipeline: calm, dense grouping around the team doing the work. */
[hidden] {
  display: none !important;
}

.pipeline-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
  margin-bottom: 22px;
}

.pipeline-controls .filter-pills {
  grid-column: 1 / -1;
}

.pipeline-controls .search-field {
  max-width: 430px;
}

.view-switcher {
  display: flex;
  padding: 3px;
  border: 1px solid #dce2e9;
  border-radius: 7px;
  background: #edf1f5;
}

.view-button {
  min-width: 82px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #68778a;
  font-size: 11px;
  font-weight: 700;
}

.view-button.active {
  background: #fff;
  color: #243d70;
  box-shadow: 0 1px 3px rgba(31, 48, 73, .12);
}

.pipeline-board {
  border-top: 1px solid #dfe4ea;
}

.pipeline-stage {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 25px 0;
  border-bottom: 1px solid #dfe4ea;
}

.stage-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.stage-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid #d8dfe8;
  border-radius: 50%;
  color: #7c899a;
  font: 700 9px/1 ui-monospace, monospace;
}

.stage-header h2 {
  margin: 2px 0 5px;
  color: #1b2c43;
  font-size: 14px;
  letter-spacing: -.025em;
}

.stage-header p {
  margin: 0;
  color: #8995a4;
  font-size: 10px;
}

.stage-deal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stage-deal {
  position: relative;
  padding: 16px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 43, 63, .025);
}

.stage-deal.priority {
  border-color: #d9c9ad;
  box-shadow: inset 3px 0 #e8a745;
}

.stage-deal > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.stage-deal h3,
.stage-deal-link {
  display: block;
  margin: 0;
  color: #192a40;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.stage-deal-link {
  color: #2852b5;
}

.stage-deal > header p {
  margin: 5px 0 0;
  color: #7c8999;
  font-size: 10px;
}

.deal-dates {
  display: flex;
  gap: 18px;
  margin: 14px 0 11px;
  padding-top: 11px;
  border-top: 1px solid #edf0f3;
  color: #8a96a4;
  font-size: 9px;
}

.deal-dates b {
  margin-left: 3px;
  color: #516075;
  font-weight: 700;
}

.open-items {
  overflow: hidden;
  border: 1px solid #e4e8ed;
  border-radius: 6px;
  background: #fbfcfd;
}

.open-items-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid #e4e8ed;
  background: #f4f6f9;
}

.open-items-header strong {
  color: #45556a;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.open-items-header strong span {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 3px;
  border-radius: 50%;
  background: #e5eaf0;
  color: #526177;
}

.open-items-header small {
  color: #8995a4;
  font-size: 9px;
}

.warning-text {
  color: #b16b27 !important;
}

.new-text {
  color: #39725b !important;
}

.mini-issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 8px 10px;
  border-bottom: 1px solid #e8ebef;
}

.mini-issue:last-child {
  border: 0;
}

.mini-issue b,
.mini-issue span {
  display: block;
}

.mini-issue b {
  color: #34445a;
  font-size: 10px;
}

.mini-issue span {
  margin-top: 3px;
  color: #8995a4;
  font-size: 9px;
}

.mini-issue button,
.mini-issue > a {
  padding: 4px 7px;
  border: 0;
  border-radius: 4px;
  background: #eaf0ff;
  color: #315bc7;
  font-size: 9px;
  font-weight: 750;
}

.mini-issue.overdue {
  background: #fffaf4;
}

.mini-issue.overdue b {
  color: #805321;
}

.mini-issue.received {
  background: #f7fbf9;
}

.open-deal-link {
  display: inline-block;
  margin-top: 11px;
  color: #4364a8;
  font-size: 10px;
  font-weight: 700;
}

.empty-pipeline {
  padding: 45px 0;
  color: #7b899a;
  text-align: center;
}

.deals-table {
  min-width: 1220px;
}

.deals-table td:nth-child(6) b {
  color: #34445a;
  font-size: 10px;
}

@media (max-width: 1100px) {
  .stage-deal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .pipeline-stage {
    grid-template-columns: 165px minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .pipeline-controls {
    grid-template-columns: 1fr;
  }

  .pipeline-controls .filter-pills {
    grid-column: 1;
  }

  .view-switcher {
    width: max-content;
  }

  .pipeline-stage {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stage-deal-grid {
    grid-template-columns: 1fr;
  }

  .deal-dates {
    flex-wrap: wrap;
  }
}
