/* The top of a DSP's Home and Hours: the client Clock In and the admin time
   clock, then "Add Client Session" and "Add Monthly Report". On a phone each
   clock button is as wide as the screen and the two Add buttons share a row.
   From a tablet up the clock buttons sit side by side at the same height,
   with the Add buttons in a row under them. */
.clock-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.clock-actions__clocks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
}

/* The Add buttons are real buttons, 44px tall, with a gap a thumb can't miss. */
.clock-actions__add {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  width: 100%;
}
.clock-actions__add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--color-base-300);
  border-radius: 0.625rem;
  background: var(--color-base-100);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease;

  &:hover { background: var(--color-base-200); }
  &:focus-visible { outline: 2px solid var(--color-success); outline-offset: 2px; }
}
.clock-actions__plus {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: var(--color-success);
}

/* On a phone both clock buttons run the full width, one under the other. */
@media (max-width: 767px) {
  .clock-actions__clocks {
    & [data-clock-target="button"],
    & .admin-time--dsp,
    & .admin-time--dsp .admin-time__buttons,
    & .admin-time--dsp .clock-button { width: 100%; }
    & .admin-time--dsp .clock-button { justify-content: center; }
  }
}

@media (min-width: 768px) {
  .clock-actions { flex-shrink: 0; width: auto; align-items: flex-end; }
  .clock-actions__clocks { flex-direction: row; align-items: flex-start; justify-content: flex-end; width: auto; }
  .clock-actions__add { display: flex; width: auto; }
  .clock-actions__add-button { padding: 0 1rem; }

  /* A running clock shows its timer above its button. The other clock drops
     by the same amount, so the two buttons stay on one line. */
  .clock-actions:not(.clock-actions--stacked) .clock-actions__clocks {
    --timer-row: 2.125rem;

    & .admin-time--dsp .shift-status { height: 1.625rem; line-height: 1; }
    &:has(.admin-time--dsp .shift-status) > #clock-status:not([data-clock-clocked-in-value="true"]),
    &:has(> #clock-status[data-clock-clocked-in-value="true"]) > .admin-time--dsp:not(:has(.shift-status)) {
      padding-top: var(--timer-row);
    }
  }

  /* With a note above Clock In, everything stays in one centered column. */
  .clock-actions--stacked {
    align-items: center;

    & .clock-actions__clocks { flex-direction: column; align-items: center; }
  }
}
