.crm {
  --crm-ink: #172a37;
  --crm-muted: #526671;
  --crm-line: #dce4e7;
  --crm-base: #f2f5f6;
  --crm-accent: #086c67;
  color: var(--crm-ink);
  min-width: 0;
  max-width: 100%;
}
.crm *,
.crm *::before,
.crm *::after {
  box-sizing: border-box;
}
.crm-heading,
.crm-buttons,
.crm-subhead,
.crm-column header > div,
.crm-modal > header,
.crm-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.crm-heading {
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 0 0 24px;
}
.crm-heading h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.13;
  letter-spacing: -0.045em;
  font-weight: 650;
}
.crm-buttons {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.crm button,
.crm select,
.crm input,
.crm textarea {
  font: inherit;
}
.crm button {
  cursor: pointer;
}
.crm button:disabled {
  cursor: default;
  opacity: 0.65;
}
.crm :focus-visible {
  outline: 3px solid #3386aa;
  outline-offset: 2px;
}
.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  padding-bottom: 17px;
}
.crm-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
}
.crm-field > span,
.crm-custom legend {
  color: var(--crm-muted);
  font-size: 0.79rem;
  font-weight: 600;
}
.crm select,
.crm input,
.crm textarea {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #b9c8cf;
  border-radius: 6px;
  background: #fff;
  color: var(--crm-ink);
  padding: 8px 10px;
}
.crm textarea {
  resize: vertical;
}
.crm select,
.crm input {
  min-height: 38px;
}
.crm .crm-search {
  display: flex;
  align-items: center;
  min-height: 38px;
  flex: 1 1 165px;
  max-width: 330px;
  margin-left: auto;
  border-radius: 6px;
  border: 1px solid #b9c8cf;
  background: white;
}
.crm-search span {
  padding-left: 10px;
  color: var(--crm-muted);
  font-size: 1.35em;
}
.crm .crm-search input {
  border: 0;
  width: 100%;
  min-height: 36px;
  padding: 6px;
  background: transparent;
}
.crm-board {
  display: flex;
  overflow-x: auto;
  align-items: stretch;
  gap: 12px;
  padding: 3px 1px 15px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
.crm-column {
  flex: 1 0 228px;
  max-width: 360px;
  min-height: 320px;
  scroll-snap-align: start;
  border-radius: 8px;
  background: var(--crm-base);
  padding: 0 9px 10px;
}
.crm-column > header {
  border-top: 4px solid var(--crm-step);
  border-radius: 5px 5px 0 0;
  margin: 0 -9px;
  padding: 13px 13px 10px;
}
.crm-column h2 {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
  margin: 0;
  font-weight: 660;
}
.crm-column > header strong {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--crm-muted);
  font-variant-numeric: tabular-nums;
}
.crm-count {
  background: #e2e8eb;
  border-radius: 4px;
  font-weight: 650;
  font-size: 0.76rem;
  color: #425864;
  padding: 2px 6px;
}
.crm-stack {
  display: grid;
  gap: 8px;
}
.crm-card {
  border: 1px solid #cdd8dd;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}
.crm-card[draggable='true'] {
  cursor: grab;
}
.crm-card:hover,
.crm-card:focus-within {
  border-color: #7fa4ac;
}
.crm-card-main,
.crm-card-foot {
  display: flex;
  width: 100%;
  text-align: left;
  border: 0;
  padding: 10px 11px;
  background: transparent;
  color: inherit;
}
.crm-card-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.crm-card-main strong,
.crm-kv b,
.crm-event p,
.crm-task strong,
.crm-name,
.crm-followup b,
.crm-modal h2 {
  overflow-wrap: anywhere;
}
.crm-card-main strong {
  font-size: 0.98rem;
  line-height: 1.3;
}
.crm-card-main small,
.crm-task small,
.crm-event small,
.crm-metrics small {
  color: var(--crm-muted);
  font-size: 0.77rem;
}
.crm-amount {
  font-weight: 600;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.crm-card-foot {
  border-top: 1px solid #edf0f1;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding-block: 7px;
}
.crm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.crm-tag {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 4px;
  background: #eaf1f4;
  color: #344f60;
  font-size: 0.73rem;
  font-weight: 550;
  padding: 2px 6px;
}
.crm-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e9ee;
  color: #405968;
  font-size: 0.62rem;
  font-weight: bold;
}
.crm-urgency {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  font-size: 0.76rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: left;
}
.crm-urgency > span {
  flex-shrink: 0;
  font-weight: 700;
}
.crm-urgency.late {
  color: #a33831;
}
.crm-urgency.today {
  color: #00695d;
}
.crm-urgency.none {
  color: #615831;
}
.crm-urgency.future {
  color: #395c82;
}
.crm-add,
.crm-text-btn,
.crm-name {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--crm-accent);
  font-weight: 600;
}
.crm .crm-add {
  width: 100%;
  margin-top: 8px;
  text-align: left;
  padding: 8px 4px;
  font-size: 0.86rem;
}
.crm .crm-text-btn {
  font-size: 0.84rem;
}
.crm-name {
  text-align: left;
}
.crm button.crm-name:hover,
.crm button.crm-text-btn:hover {
  text-decoration: underline;
}
.crm-empty-stage {
  font-size: 0.84rem;
  color: var(--crm-muted);
  margin: 8px 4px;
}
.crm-empty {
  padding: 24px;
  color: var(--crm-muted);
  margin: 0;
}
.crm-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: white;
}
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
}
.crm-table th,
.crm-table td {
  text-align: left;
  padding: 13px 14px;
}
.crm-table th {
  background: var(--crm-base);
  color: var(--crm-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.crm-table tbody tr + tr {
  border-top: 1px solid var(--crm-line);
}
.crm-table td {
  overflow-wrap: anywhere;
  min-width: 94px;
}
.crm-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--crm-line);
  padding: 18px 0;
  margin: 16px 0 24px;
}
.crm-metrics > div {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 0 16px;
  border-right: 1px solid var(--crm-line);
}
.crm-metrics > div:first-child {
  padding-left: 0;
}
.crm-metrics > div:last-child {
  border: 0;
}
.crm-metrics strong,
.crm-deal-value {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.18;
  font-weight: 620;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}
.crm-metrics span {
  color: var(--crm-muted);
  font-size: 0.84rem;
}
.crm-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.crm-report {
  min-width: 0;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
}
.crm-report h2,
.crm-detail h3 {
  font-size: 1.04rem;
  margin: 0 0 12px;
}
.crm-report p,
.crm-detail .muted {
  color: var(--crm-muted);
  font-size: 0.87rem;
}
.crm-chart-row {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) 1fr 2ch;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.85rem;
}
.crm-chart-row span {
  overflow-wrap: anywhere;
}
.crm-chart-row > div {
  background: #edf1f3;
  height: 8px;
  border-radius: 2px;
  overflow: hidden;
}
.crm-chart-row i {
  display: block;
  height: 100%;
  background: #5685a5;
}
.crm-followup {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: 0;
  padding: 9px 0;
  text-align: left;
  color: inherit;
}
.crm-report .crm-followup + .crm-followup {
  border-top: 1px solid var(--crm-line);
}
.crm-modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--crm-line);
  border-radius: 12px;
  background: #fff;
  color: var(--crm-ink);
  box-shadow: 0 15px 60px #19344728;
}
.crm-modal::backdrop {
  background: #192d3b55;
}
.crm-modal > header {
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid var(--crm-line);
  padding: 16px 20px;
  z-index: 1;
}
.crm-modal h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}
.crm-modal form {
  margin: 0;
}
.crm-fields {
  padding: 18px 20px 0;
  display: grid;
  gap: 14px;
}
.crm-modal footer {
  padding: 14px 20px;
  justify-content: flex-end;
  border-top: 1px solid var(--crm-line);
}
.crm-error {
  color: #a33831;
  margin: 12px 20px;
  white-space: pre-line;
}
.crm-custom {
  min-width: 0;
  border: 1px solid var(--crm-line);
  border-radius: 6px;
  margin: 0;
  padding: 10px;
}
.crm-stage-row,
.crm-custom-row {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 3px 0;
}
.crm-stage-row input,
.crm-custom-row input,
.crm-custom-row textarea {
  width: 0;
  flex: 1;
}
.crm-small {
  border: 1px solid var(--crm-line);
  border-radius: 4px;
  background: white;
  color: inherit;
  min-width: 28px;
  min-height: 30px;
}
.crm-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(495px, 100vw);
  max-height: 100dvh;
  height: 100dvh;
  margin: 0;
  border-radius: 0;
  border-width: 0 0 0 1px;
}
.crm-detail {
  padding: 20px;
}
.crm-view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: var(--crm-base);
  gap: 2px;
  margin: 0 0 15px;
}
.crm-view-switch button {
  border: 0;
  border-radius: 5px;
  padding: 6px 13px;
  background: transparent;
  color: var(--crm-muted);
  font-size: 0.86rem;
}
.crm-view-switch button[aria-pressed='true'] {
  color: var(--crm-ink);
  font-weight: 650;
  background: white;
  box-shadow: 0 1px 3px #223b491c;
}
.crm-table.crm-deal-list td {
  font-size: 0.84rem;
}
.crm-deal-list td:first-child {
  min-width: 150px;
}
.crm-deal-list small,
.crm-period small,
.crm-forecast-row small {
  display: block;
  color: var(--crm-muted);
  font-size: 0.77rem;
}
.crm-deal-list td small {
  margin-top: 2px;
}
.crm-numeric,
.crm-period strong,
.crm-forecast-row > b {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.crm-forecast {
  display: grid;
  gap: 14px;
}
.crm-forecast-key {
  margin: 0;
  color: var(--crm-muted);
  font-size: 0.84rem;
}
.crm-period {
  border: 1px solid var(--crm-line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.crm-period > header,
.crm-forecast-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(115px, 0.38fr) minmax(115px, 0.38fr);
  gap: 10px;
  align-items: center;
  padding: 10px 15px;
}
.crm-period > header {
  background: var(--crm-base);
  border-bottom: 1px solid var(--crm-line);
}
.crm-period > header h2 {
  font-size: 1.08rem;
  margin: 0;
}
.crm-period h2::first-letter {
  text-transform: uppercase;
}
.crm-period > header > div:nth-child(n + 2),
.crm-forecast-row > span,
.crm-forecast-row > b {
  text-align: right;
}
.crm-period > header strong {
  font-size: 1rem;
}
.crm-forecast-row > span,
.crm-forecast-row > b {
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.crm-forecast-row + .crm-forecast-row {
  border-top: 1px solid var(--crm-line);
}
@media (max-width: 560px) {
  .crm-period > header,
  .crm-forecast-row {
    grid-template-columns: minmax(0, 1fr) minmax(90px, 0.7fr);
    padding: 9px;
  }
  .crm-period > header > div:first-child,
  .crm-forecast-row > div:first-child {
    grid-column: 1/-1;
  }
  .crm-period > header > div:nth-child(2),
  .crm-forecast-row > span {
    text-align: left;
  }
}
.crm-drawer.crm-expanded {
  width: min(940px, 100vw);
}
.crm-related {
  padding: 0 20px 20px;
}
.crm-related h3 {
  margin: 0 0 8px;
  font-size: 1.04rem;
}
.crm-related button {
  display: block;
}
.crm-deal-value {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.crm-deal-value .crm-tag {
  letter-spacing: 0;
}
.crm-detail section {
  border-top: 1px solid var(--crm-line);
  margin-top: 17px;
  padding-top: 14px;
}
.crm-kv,
.crm-task {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.87rem;
}
.crm-kv > span {
  color: var(--crm-muted);
  min-width: 25%;
}
.crm-kv > b {
  text-align: right;
  font-weight: 570;
  white-space: pre-line;
}
.crm-kv select {
  max-width: 235px;
}
.crm-subhead h3 {
  margin: 0;
}
.crm-subhead {
  margin-bottom: 7px;
}
.crm-task > div {
  display: grid;
  gap: 4px;
}
.crm-event {
  margin-top: 11px;
  padding-left: 11px;
  border-left: 2px solid #bfced5;
}
.crm-event p {
  white-space: pre-line;
  margin: 0 0 3px;
  font-size: 0.9rem;
}
@media (max-width: 780px) {
  .crm-overview {
    grid-template-columns: 1fr;
  }
  .crm-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 0;
  }
  .crm-metrics > div:nth-child(2) {
    border: 0;
  }
  .crm-metrics > div:nth-child(3) {
    padding-left: 0;
  }
  .crm-toolbar {
    gap: 8px;
  }
  .crm .crm-search {
    margin-left: 0;
  }
  .crm-column {
    flex: 1 0 min(83vw, 265px);
  }
}
@media (max-width: 480px) {
  .crm-heading {
    margin-bottom: 16px;
  }
  .crm-toolbar > .field {
    flex: 1 1 43%;
  }
  .crm-toolbar select {
    width: 100%;
  }
  .crm .crm-search {
    flex-basis: 100%;
    max-width: none;
  }
  .crm-metrics > div {
    padding-right: 8px;
  }
  .crm-metrics strong {
    font-size: 1.16rem;
  }
  .crm-report {
    padding: 14px;
  }
  .crm-detail,
  .crm-fields {
    padding-inline: 14px;
  }
}
