/* The admin DSP page. Its width, cards, header, buttons, pills, attention
   rows and Notes and history come from the client page
   (admin_client_profile.css), which shares its
   tokens with .dsp-page; this file holds only what the DSP page has of its
   own. */

/* Toasts sit under the 64px top bar. */
.dsp-page__notifications { top: 4.5rem; }

/* Initials in a dark circle, the size of the client page's photo. */
.dsp-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #2c5e60;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}

/* The DSP is turned off. */
.dsp-off {
  padding: 16px 20px;
  border: 1px solid #f1b9b7;
  border-radius: 12px;
  background: var(--profile-danger-soft);
  color: var(--profile-danger-ink);
  line-height: 1.5;

  & b, & a { font-weight: 700; }
  & a:hover { text-decoration: underline; }
}

.dsp-card-count {
  margin-left: 8px;
  color: var(--profile-ink-500);
  font-size: 15px;
  font-weight: 400;
}

/* About: a label in a 200px column, the value beside it. */
.dsp-facts { display: flex; flex-direction: column; }
.dsp-fact {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--profile-hairline);

  &:first-child { border-top: 0; }
}
.dsp-fact__label { color: var(--profile-ink-500); font-size: 15px; font-weight: 500; }
.dsp-fact__value {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dsp-fact__main { color: var(--profile-ink); font-size: 16px; font-weight: 500; }
.dsp-fact__link { color: var(--profile-green); &:hover { color: var(--profile-green-dark); } }
.dsp-fact__sub { color: var(--profile-ink-500); font-size: 14px; }
.dsp-fact__sub--amber { color: var(--profile-warning-ink); font-size: 14px; }
.dsp-fact__quiet { color: var(--profile-ink-500); }
.dsp-fact__line { display: flex; align-items: center; gap: 8px; }
.dsp-fact__contact { display: flex; flex-direction: column; & + & { padding-top: 8px; } }
.dsp-fact__pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dsp-fact__pills .client-info__chip { padding: 1px 10px; font-size: 13px; }
.dsp-fact__edit {
  display: inline-flex;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--profile-ink-400);
  cursor: pointer;

  & svg { width: 14px; height: 14px; }
  &:hover { color: var(--profile-green); }
}

/* Referred: one line each, the bar 120px wide. */
.dsp-referral {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 3px 0;
}
.dsp-referral__who { display: flex; align-items: baseline; gap: 8px; flex: none; width: 17rem; }
.dsp-referral__bar { flex: none; width: 120px; }
.dsp-referral__status { font-size: 14px; }
.dsp-referral__all { margin-left: auto; }
/* With the bonus off: who they referred and when each was hired, nothing more. */
.dsp-referral--name-only { gap: 6px; }
.dsp-referrals-dialog { max-width: 44rem; }

/* Hours: three tiles in a row. */
.dsp-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.dsp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border-radius: 12px;
  background: var(--profile-raised);
  text-align: center;
}
.dsp-tile__label { color: var(--profile-ink-500); font-size: 14px; }
.dsp-tile__number {
  color: var(--profile-ink);
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.dsp-tile__number--green { color: var(--profile-green); }
.dsp-tile__number--red { color: var(--profile-danger-ink); }

.dsp-month {
  padding-top: 12px;
  color: var(--profile-ink-500);
  font-size: 15px;

  & b { color: var(--profile-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
}
.dsp-subheading { padding: 20px 0 6px; font-size: 17px; font-weight: 600; }

.dsp-days {
  width: 100%;
  border-collapse: collapse;

  & th {
    padding: 0 12px 8px 0;
    color: var(--profile-ink-500);
    font-size: 14px;
    font-weight: 400;
    text-align: left;
  }
  & td {
    padding: 10px 12px 10px 0;
    border-top: 1px solid var(--profile-hairline);
    color: var(--profile-ink);
  }
  & tfoot td { border-top: 2px solid var(--profile-border-strong); font-weight: 600; }
}
.dsp-days__number { font-variant-numeric: tabular-nums; }

/* Whether the DSP tracks miles; the DSP turns it on or off in the app. */
.dsp-miles-status { color: var(--profile-ink-500); font-size: 15px; white-space: nowrap; }

/* Clients: the avatar ringed in the client's Clock In color. */
.dsp-client { color: inherit; &:hover .dsp-client__name { color: var(--profile-green); } }
.dsp-client__photo { width: 100%; height: 100%; object-fit: cover; }
.dsp-client__avatar {
  overflow: hidden;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--client-color);
  border-radius: 50%;
  background: color-mix(in srgb, var(--client-color) 14%, #fff);
  color: var(--profile-ink);
  font-size: 15px;
  font-weight: 700;
}
.dsp-client__name { color: var(--profile-ink); font-size: 16px; font-weight: 600; }
.dsp-client__services { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }

/* Onboarding sits in the page's card, so its panel needs no top gap. */
.dsp-page .onboarding__panel { margin-top: 4px; }

/* Inactivity. */
.dsp-inactivity { gap: 8px; }
.dsp-inactivity__headline { font-size: 17px; font-weight: 600; }
.dsp-inactivity__last { color: var(--profile-ink-500); font-size: 15px; font-weight: 400; }
.dsp-inactivity__note { color: var(--profile-ink-700); }
.dsp-inactivity__scale {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  color: var(--profile-ink-500);
  font-size: 14px;

  & b { color: var(--profile-ink); font-weight: 600; }
}
.dsp-inactivity__alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--profile-hairline);
}
.dsp-inactivity__alert {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  cursor: pointer;
}
.dsp-inactivity__to { color: var(--profile-green); font-weight: 600; }
.dsp-inactivity__recipients {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
  padding-top: 8px;
}
.dsp-inactivity__recipient { justify-self: start; color: var(--profile-ink-500); font-size: 14px; }
.dsp-inactivity__recipient--tip {
  text-decoration: underline dotted;
  text-underline-offset: 4px;
  cursor: default;
}

/* The phone: rows stack, tiles and numbers shrink. */
@media (max-width: 640px) {
  .dsp-avatar { width: 56px; height: 56px; font-size: 20px; }
  .dsp-fact { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 0; }
  .dsp-fact__label { font-size: 13px; }
  .dsp-fact__main { font-size: 15px; }
  .dsp-fact__sub, .dsp-fact__sub--amber, .dsp-referral__status { font-size: 13px; }
  .dsp-referral__who { width: auto; }
  .dsp-referral__all { margin-left: 0; }
  .dsp-tiles { gap: 8px; }
  .dsp-tile { padding: 10px 6px; }
  .dsp-tile__label { font-size: 12px; }
  .dsp-tile__number { font-size: 20px; }
  .dsp-tile .profile-pill { padding: 1px 6px; font-size: 11px; }
  .dsp-month { font-size: 13px; }
  .dsp-subheading { font-size: 15px; }
  .dsp-days { font-size: 14px; & th { font-size: 12px; } & td { padding: 8px 8px 8px 0; } }
  .dsp-client__avatar { width: 40px; height: 40px; font-size: 14px; }
  .dsp-client__name { font-size: 15px; }
  .dsp-inactivity__headline { font-size: 15px; }
  .dsp-inactivity__scale { font-size: 13px; }
}

/* The phone: the top stays short. Phone and email each get a line, the jump
   links scroll sideways in one row, each Needs attention item is one line,
   and a paperwork row reads name and Open, then its pill and where it stands. */
@media (max-width: 640px) {
  .dsp-reach span { display: block; }
  .dsp-fact__contact + .dsp-fact__contact { margin-top: 10px; }
  .dsp-referral { padding: 6px 0; }
  .dsp-referral__who { width: 100%; }
  .dsp-referral__bar { width: 64px; }
  .dsp-inactivity__alert { font-size: 14px; }
  .dsp-inactivity__to { flex-basis: 100%; }
  .dsp-reach .dsp-reach__dot { display: none; }

  .dsp-page .client-jumps {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .dsp-page .client-attention__row > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dsp-card-count--wide-only { display: none; }

  .dsp-page .paperwork-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "kind  action"
      "words words"
      "by    by";
    column-gap: 10px;
  }
  .dsp-page .paperwork-row__pill { display: none; }
  .dsp-page .paperwork-row__words--expiring-soon { color: var(--paperwork-amber); }
  .dsp-page .paperwork-row__words { font-size: 15px; }
  .dsp-page .paperwork-row__by { font-size: 13px; }
}
