/* The admin dashboard: today's work for a program manager. Colour only where
   action is needed; everything settled is grey or plain text. */
.dashboard {
  --dashboard-border: #e6e0d6;
  --dashboard-hairline: #efeae1;
  --dashboard-ink: #15302e;
  --dashboard-muted: #8a938f;
  --dashboard-link: #2f7d4f;
  --dashboard-red: #b91c1c;
  --dashboard-red-wash: #fee2e2;
  --dashboard-amber: #b45309;
  --dashboard-amber-wash: #fef3c7;
  --dashboard-green: #15803d;
  --dashboard-green-wash: #dcfce7;
  --dashboard-grey-wash: #f1f3f2;

  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--dashboard-ink);
}

/* Header: a greeting, the date, and the same three buttons as before. */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}
.dashboard-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.dashboard-header__date {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--dashboard-muted);
}
.dashboard-header__date--short { display: none; }
.dashboard-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Counts on the left, shortcuts on the right, all links. */
.dashboard-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
}
.dashboard-strip__counts,
.dashboard-strip__shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.dashboard-count {
  color: var(--dashboard-link);
  font-weight: 500;

  & b { margin-right: 0.125rem; font-weight: 700; color: var(--dashboard-ink); }
}
.dashboard-link {
  color: var(--dashboard-link);
  font-weight: 600;
  white-space: nowrap;

  &:hover { text-decoration: underline; }
}

/* One white card per section; the header holds its one verb. */
.dashboard-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 3px rgb(20 40 38 / 0.06), 0 1px 2px rgb(20 40 38 / 0.04);
}
.dashboard-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.dashboard-card__title {
  font-size: 1.0625rem;
  font-weight: 700;
}
.dashboard-card__note {
  margin-left: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--dashboard-muted);
}
.dashboard-card__empty {
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--dashboard-muted);
}
.dashboard-card__more {
  padding-top: 0.875rem;
  text-align: center;
  font-size: 0.875rem;
}

/* A row is the link to whatever fixes it; rows never show arrows. */
.dashboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  color: inherit;

  & + & { border-top: 1px solid var(--dashboard-hairline); }
  &:hover { background: color-mix(in oklab, var(--dashboard-grey-wash) 60%, #fff); }
}
.dashboard-row--sentence {
  font-size: 0.875rem;
  color: #3d4a49;
}
.isp-renewal:first-of-type { font-weight: 700; color: var(--dashboard-ink); }

/* Needs your attention: a count box tinted by urgency, a title, one sentence. */
.attention-row__count {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}
.attention-row__count--red { background: var(--dashboard-red-wash); color: var(--dashboard-red); }
.attention-row__count--amber { background: var(--dashboard-amber-wash); color: var(--dashboard-amber); }
.attention-row__count--green { background: var(--dashboard-green-wash); color: var(--dashboard-green); }
.attention-row__text { min-width: 0; }
.attention-row__title { display: block; font-weight: 700; }
.attention-row__detail {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: var(--dashboard-muted);
}

/* DSPs: four stat columns, no dividers. */
.dsp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 0.25rem;
}
.dsp-stat__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dashboard-muted);
}
.dsp-stat__figure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.dsp-stat__number {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
.dsp-stat__badge {
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  background: var(--dashboard-grey-wash);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.dsp-stat--red .dsp-stat__number { color: var(--dashboard-red); }
.dsp-stat--red .dsp-stat__badge { background: var(--dashboard-red-wash); color: var(--dashboard-red); }
.dsp-stat--amber .dsp-stat__number { color: var(--dashboard-amber); }
.dsp-stat--amber .dsp-stat__badge { background: var(--dashboard-amber-wash); color: var(--dashboard-amber); }

/* Authorized hours and ISP renewals sit side by side. */
.dashboard-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.authorized-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(5rem, 7rem) 3rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}
.authorized-row--yellow { --authorized-color: #d97706; }
.authorized-row--red { --authorized-color: #dc2626; }
.authorized-row__client { font-weight: 700; color: var(--dashboard-ink); }
.authorized-row__used { font-size: 0.8125rem; color: var(--dashboard-muted); white-space: nowrap; }
.authorized-bar {
  display: block;
  height: 0.5rem;
  border-radius: 9999px;
  background: #e5e7eb;
  overflow: hidden;
}
.authorized-bar__fill {
  display: block;
  width: var(--share, 0%);
  height: 100%;
  border-radius: 9999px;
  background: var(--authorized-color);
}
.authorized-row__percent {
  text-align: right;
  font-weight: 700;
  color: var(--authorized-color);
}

/* Events this week: date, flyer, title and time, description, who is going. */
.event-row {
  display: grid;
  grid-template-columns: 5.625rem 2.75rem 16.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}
.event-row__date { font-size: 0.875rem; font-weight: 600; }
.event-row__flyer {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--dashboard-hairline);
  border-radius: 0.5rem;
  object-fit: cover;
}
.event-row__flyer--blank { display: block; background: #eff6ff; }
.event-row:nth-child(3n+2) .event-row__flyer--blank { background: #ecfdf5; }
.event-row:nth-child(3n) .event-row__flyer--blank { background: #fef9c3; }
.event-row__what { min-width: 0; }
.event-row__title { display: block; font-weight: 700; }
.event-row__time { display: block; margin-top: 0.125rem; font-size: 0.8125rem; color: var(--dashboard-muted); }
.event-row__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--dashboard-muted);
}
.event-row__going {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--dashboard-muted);
  white-space: nowrap;
}
.avatar-stack {
  display: flex;
  align-items: center;

  & > * + * { margin-left: -0.5rem; }
  & .avatar > div { border: 2px solid #fff; }
}
.avatar-stack__more {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #fff;
  border-radius: 9999px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.625rem;
  font-weight: 700;
}

/* Monthly reports: one calm line until the due date is close, then who owes one. */
.monthly-reports--calm {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 1rem 1.5rem;

  & .dashboard-card__note { flex: 1; margin-left: 0; }
}
.report-group + .report-group { margin-top: 1rem; }
.report-group__label {
  margin-bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dashboard-muted);
}
.report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.report-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: var(--dashboard-ink);
}
.report-chip--red { background: var(--dashboard-red-wash); }
.report-chip--red .report-chip__initials { background: var(--dashboard-red); }
.report-chip--amber { background: var(--dashboard-amber-wash); }
.report-chip--amber .report-chip__initials { background: var(--dashboard-amber); }
.report-chip--more { padding: 0.25rem 0.75rem; background: var(--dashboard-grey-wash); font-weight: 600; }
.report-chip__initials {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
}

/* A phone stacks the same sections in the same order. */
@media (max-width: 767px) {
  .dashboard { gap: 0.75rem; }
  .dashboard-header__title { font-size: 1.5rem; }
  .dashboard-header__date--long { display: none; }
  .dashboard-header__date--short { display: inline; }
  .dashboard-header__actions { width: 100%; }
  .dashboard-header__add { flex: 1; }
  .dashboard-strip__counts,
  .dashboard-strip__shortcuts { width: 100%; }
  .dashboard-card { padding: 1rem; }
  .dashboard-card__head .dashboard-card__note { display: block; margin: 0.125rem 0 0; }
  .dsp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.25rem; }
  .dashboard-pair { grid-template-columns: minmax(0, 1fr); }
  .authorized-row { grid-template-columns: minmax(0, 1fr) minmax(5rem, 7rem) 3rem; }
  .authorized-row__used { display: none; }
  .event-row {
    grid-template-columns: 4.5rem 2.75rem minmax(0, 1fr);
    align-items: start;
  }
  .event-row__date { padding-top: 0.125rem; }
  .event-row__description,
  .event-row__going { grid-column: 3; }
  .event-row__going { flex-direction: row; align-items: center; justify-content: flex-start; }
}
