/* CRM is also used for daily task entry; keep its content readable inside cards. */
#appPage .crm-toolbar label,
#appPage .crm-activity-filters label {
  font-size: 14px;
  line-height: 1.5;
}

#appPage .crm-toolbar input,
#appPage .crm-toolbar select,
#appPage .crm-activity-filters input,
#appPage .crm-activity-filters select {
  min-height: 42px;
  font-size: 14px;
}

#appPage .crm-pipeline {
  grid-template-columns: repeat(5, minmax(250px, 1fr));
  gap: 14px;
}

#appPage .crm-stage {
  padding: 14px;
}

#appPage .crm-stage-heading b,
#appPage .crm-opportunity-card > b {
  font-size: 15px;
  line-height: 1.55;
}

#appPage .crm-stage-heading span,
#appPage .crm-opportunity-card small,
#appPage .crm-opportunity-card label {
  font-size: 13px;
  line-height: 1.65;
}

#appPage .crm-opportunity-card input,
#appPage .crm-opportunity-card select,
#appPage .crm-opportunity-card textarea,
#appPage .crm-activity-panel input,
#appPage .crm-activity-panel select,
#appPage .crm-activity-panel textarea {
  min-height: 42px;
  font-size: 14px;
  line-height: 1.5;
}

#appPage .crm-activity-panel {
  width: 100%;
  border-top: 1px solid #dedde7;
  margin-top: 10px;
  padding-top: 9px;
}

#appPage .crm-activity-panel > summary {
  min-height: 42px;
  padding: 8px 4px;
  font-size: 15px;
  line-height: 1.5;
}

#appPage .crm-activity-panel[open] {
  position: fixed;
  z-index: 1000;
  inset: 5vh 5vw;
  width: auto;
  max-height: 90vh;
  overflow: auto;
  margin: auto;
  padding: 18px 22px 24px;
  border: 1px solid var(--surface-border, #dedde7);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--text-primary, #242632);
  box-shadow: 0 0 0 100vmax rgb(19 24 40 / 46%), 0 24px 70px rgb(18 22 38 / 24%);
}

#appPage .crm-activity-panel[open] > summary {
  position: sticky;
  z-index: 1;
  top: -18px;
  margin: -18px -22px 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--surface-border, #dedde7);
  background: var(--surface, #fff);
  font-size: 17px;
}

#appPage .crm-activity-list {
  gap: 12px;
  padding: 12px 0;
}

#appPage .crm-activity-row {
  padding: 14px 16px;
  border-radius: 11px;
}

#appPage .crm-activity-row header b,
#appPage .crm-activity-row > small,
#appPage .crm-activity-row p,
#appPage .crm-activity-empty {
  font-size: 14px;
  line-height: 1.7;
  font-weight: 400;
}

#appPage .crm-activity-row h3 {
  margin: 8px 0;
  font-size: 17px;
  line-height: 1.55;
  font-weight: 500;
}

#appPage .crm-activity-row button,
#appPage .crm-activity-panel .module-toggle,
#appPage .crm-activity-panel .secondary-button {
  min-height: 40px;
  padding: 7px 12px;
  font-size: 14px;
  line-height: 1.45;
}

#appPage .crm-activity-form,
#appPage .crm-activity-edit form {
  gap: 12px;
  padding: 16px;
  border-radius: 11px;
}

#appPage .crm-activity-form label,
#appPage .crm-activity-edit label {
  gap: 6px;
  font-size: 14px;
  line-height: 1.5;
}

#appPage .crm-activity-form input,
#appPage .crm-activity-form select,
#appPage .crm-activity-form textarea,
#appPage .crm-activity-edit input,
#appPage .crm-activity-edit select,
#appPage .crm-activity-edit textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  font-size: 14px;
}

#appPage .crm-activity-form textarea,
#appPage .crm-activity-edit textarea {
  min-height: 100px;
}

#appPage .crm-activity-edit > summary {
  min-height: 40px;
  padding: 7px 0;
  font-size: 14px;
}

#appPage .crm-global-activity {
  align-items: flex-start;
  padding: 16px 18px;
}

#appPage .crm-global-activity h3 {
  font-size: 16px;
  line-height: 1.55;
  font-weight: 500;
}

#appPage .crm-global-activity p,
#appPage .crm-global-activity small,
#appPage .crm-global-activity-meta {
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  #appPage .crm-pipeline {
    grid-template-columns: repeat(5, minmax(230px, 1fr));
  }

  #appPage .crm-activity-panel[open] {
    inset: 2vh 2vw;
    max-height: 96vh;
    padding: 14px;
  }

  #appPage .crm-activity-panel[open] > summary {
    top: -14px;
    margin: -14px -14px 10px;
    padding: 12px 14px;
  }

  #appPage .crm-activity-form,
  #appPage .crm-activity-edit form {
    grid-template-columns: minmax(0, 1fr);
  }
}
