.crm-toggle.active {
  background: #155a49;
  border-color: #155a49;
  color: #fff;
}

.opportunity-details {
  background: #f7faf8;
  border: 1px solid #d8e4df;
  border-radius: 8px;
  margin: 1rem 0;
  padding: 1rem;
}

.opportunity-details > header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .85rem;
}

.opportunity-details h2 {
  font-size: 1.05rem;
  margin: .1rem 0 0;
}

.opportunity-details .secondary-button {
  background: #fff;
  border: 1px solid #8ba79d;
  color: #155a49;
  padding: .5rem .7rem;
}

.opportunity-details-grid {
  display: grid;
  gap: .8rem 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.opportunity-details-grid div {
  min-width: 0;
}

.opportunity-details-grid dt {
  color: #60736d;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: .2rem;
  text-transform: uppercase;
}

.opportunity-details-grid dd {
  font-weight: 650;
  margin: 0;
  overflow-wrap: anywhere;
}

.opportunity-details-grid dd a {
  color: #155a49;
}

.opportunity-details-grid dd.not-entered {
  color: #86958f;
  font-style: italic;
  font-weight: 500;
}

.opportunity-details-grid dd small {
  color: #71817c;
  display: block;
  font-size: .68rem;
  font-weight: 500;
  margin-top: .1rem;
}

.opportunity-details-grid .opportunity-notes {
  border-top: 1px solid #d8e4df;
  grid-column: 1 / -1;
  padding-top: .75rem;
}

.crm-overview {
  padding: 1rem 1.2rem 2rem;
}

.crm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin-bottom: .9rem;
}

.crm-kpis article,
.crm-panel {
  background: #fff;
  border: 1px solid #dce5e1;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(20, 57, 48, .04);
}

.crm-kpis article {
  padding: 1rem;
}

.crm-kpis span,
.crm-kpis small {
  color: #60736d;
  display: block;
}

.crm-kpis strong {
  display: block;
  font-size: 1.55rem;
  margin: .15rem 0;
}

.crm-kpis article.warning {
  border-color: #e0a643;
  background: #fffaf0;
}

.crm-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr);
  gap: .9rem;
}

.crm-panel {
  min-width: 0;
  padding: 1rem;
}

.crm-panel > header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .8rem;
}

.crm-panel h2 {
  font-size: 1.05rem;
  margin: .15rem 0 0;
}

.crm-table-wrap {
  overflow-x: auto;
}

.crm-panel table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.crm-panel th,
.crm-panel td {
  border-bottom: 1px solid #e7ecea;
  padding: .65rem .55rem;
  text-align: left;
  vertical-align: top;
}

.crm-panel th {
  color: #60736d;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.crm-panel td small {
  color: #60736d;
  display: block;
  margin-top: .15rem;
}

.crm-panel tr.needs-detail td:first-child strong {
  color: #9a5b00;
}

.crm-followups ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.crm-followups li + li {
  border-top: 1px solid #e7ecea;
}

.crm-followups a {
  color: inherit;
  display: block;
  padding: .7rem .2rem;
  text-decoration: none;
}

.crm-followups a:hover strong {
  color: #155a49;
  text-decoration: underline;
}

.crm-followups span {
  color: #60736d;
  display: block;
  font-size: .78rem;
  margin-top: .2rem;
}

.crm-followups li.overdue span {
  color: #aa332b;
  font-weight: 700;
}

.crm-empty {
  color: #60736d;
}

.crm-needs-details {
  margin-top: .9rem;
}

.crm-chips {
  display: grid;
  gap: .55rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.crm-chips a {
  background: #f4f8f6;
  border: 1px solid #dce5e1;
  border-radius: 7px;
  color: #19362e;
  padding: .7rem;
  text-decoration: none;
}

.crm-chips a span {
  color: #155a49;
  display: block;
  font-size: .76rem;
  margin-top: .25rem;
}

.crm-chips a.data-quality-complete {
  background: #fff;
  border-color: #81bc98;
}

.crm-chips a.data-quality-complete span {
  color: #267445;
  font-weight: 700;
}

.crm-chips a.data-quality-incomplete {
  background: #fff;
  border-color: #e4aa4f;
}

.crm-chips a.data-quality-incomplete span {
  color: #9a5b00;
  font-weight: 700;
}

.crm-needs-details > header p {
  color: #60736d;
  font-size: .78rem;
  margin: .25rem 0 0;
}

.crm-chips a .data-quality-fields {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
}

.data-quality-fields em {
  border: 1px solid;
  border-radius: 999px;
  font-size: .68rem;
  font-style: normal;
  line-height: 1;
  padding: .32rem .45rem;
}

.data-quality-fields em.field-complete {
  background: #eaf7ef;
  border-color: #81bc98;
  color: #267445;
}

.data-quality-fields em.field-missing {
  background: #fff3dd;
  border-color: #e4aa4f;
  color: #9a5b00;
}

@media (max-width: 1000px) {
  .crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-grid { grid-template-columns: 1fr; }
  .opportunity-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .crm-overview { padding: .7rem; }
  .crm-kpis { grid-template-columns: 1fr; }
  .opportunity-details-grid { grid-template-columns: 1fr; }
  .opportunity-details > header { align-items: flex-start; gap: .7rem; }
}
