/* The top of the admin dashboard: the date and greeting, the admin's own
   Clock in / Clock out, the three quick-action tiles, then the counts. */
.dashboard-top {
  --clock-green: #2e7d52;
  --clock-green-hover: #226b46;
  --clock-green-edge: #1b6b43;
  --clock-green-soft: #ecf5ef;
  --clock-green-border: #5fae84;
  --clock-red: #e03a3a;
  --clock-red-ink: #9b1c1c;
  --clock-red-soft: #fbe2e1;
  --clock-on-dot: #16804c;
  --clock-body: #5c6b6a;
  --clock-ink-soft: #1f3b3a;

  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Date on top, the greeting with the clock beside it, then Customize.
   On a phone the shift status moves up beside the date, so the button
   keeps its place when the admin clocks in. */
.dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "date      date   date"
    "title     status clock"
    "customize .      .";
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.375rem;
}
.dashboard-header__date {
  grid-area: date;
  font-size: 1.0625rem;
  color: var(--dashboard-muted);
}
.dashboard-header__title {
  grid-area: title;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--dashboard-ink);
}
.dashboard-header__clock { grid-area: clock; }
.dashboard-header__customize {
  grid-area: customize;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--clock-ink-soft);
  cursor: pointer;

  &:hover { text-decoration: underline; }
  &:focus-visible { outline: 2px solid var(--dashboard-link); outline-offset: 2px; border-radius: 0.25rem; }
}
.dashboard-header__customize-icon { width: 1.125rem; height: 1.125rem; }
.dashboard-header__customize-label--short { display: none; }

/* On shift: a green dot, the words, and the running time. */
.shift-status {
  grid-area: status;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--clock-body);
  white-space: nowrap;
}
.shift-status__dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--clock-on-dot);
}
.shift-status__timer {
  font-size: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dashboard-ink);
}

/* Clock in looks pressable: solid green with a darker bottom edge.
   It fits its words and never stretches into a banner. */
.clock-button {
  display: inline-flex;
  align-items: center;
  height: 3rem;
  border-radius: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;

  &:focus-visible { outline: 2px solid var(--clock-green); outline-offset: 2px; }
}
.clock-button__icon { flex-shrink: 0; fill: currentColor; }
.clock-button--in {
  gap: 0.625rem;
  padding: 0 1.75rem 0 1.375rem;
  background: var(--clock-green);
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--clock-green-edge), 0 2px 4px rgb(19 74 46 / 0.25);

  & .clock-button__icon { width: 1.125rem; height: 1.125rem; }
  &:hover { background: var(--clock-green-hover); }
  &:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--clock-green-edge); }
}
/* Clock out is outlined on purpose, so it reads as a button, not an alert. */
.clock-button--out {
  gap: 0.625rem;
  padding: 0 1.5rem 0 1.25rem;
  border: 1.5px solid var(--clock-red);
  background: #fff;
  color: var(--clock-red-ink);
  box-shadow: inset 0 -2px 0 var(--clock-red-soft), 0 2px 4px rgb(60 45 20 / 0.12);

  & .clock-button__icon { width: 1rem; height: 1rem; }
  &:hover { background: var(--clock-red-soft); }
  &:active { transform: translateY(1px); box-shadow: none; }
}

/* Add client, Add DSP and eXPRS CSV: three white tiles, icon over label. */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.quick-action { position: relative; display: flex; }
.quick-action__tile {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(60 45 20 / 0.06);
  text-align: center;
  cursor: pointer;
  list-style: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;

  &::-webkit-details-marker { display: none; }
  &:hover { border-color: var(--clock-green-border); box-shadow: 0 4px 12px rgb(60 45 20 / 0.08); }
  &:focus-visible { outline: 2px solid var(--clock-green); outline-offset: 2px; }
}
.quick-action__tile--waiting { opacity: 0.6; }
.quick-action__chip {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: var(--clock-green-soft);
  color: var(--clock-green);

  & svg { width: 1.25rem; height: 1.25rem; }
}
.quick-action__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dashboard-ink);
}
/* 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.375rem 1rem;
  font-size: 1.0625rem;
}
.dashboard-strip__counts,
.dashboard-strip__shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .clock-button:active { transform: none; }
}

/* A phone: same order, smaller type. The shortcuts are left off because the
   sidebar already has them. */
@media (max-width: 767px) {
  .dashboard-top { gap: 1.25rem; }
  .dashboard-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date      status"
      "title     clock"
      "customize customize";
    column-gap: 0.75rem;
    row-gap: 0.25rem;
  }
  .dashboard-header__date { font-size: 0.9375rem; }
  .dashboard-header__title { font-size: 1.875rem; }
  .dashboard-header__customize {
    gap: 0.5rem;
    min-height: 2.75rem;
    margin: -0.5rem 0;
  }
  .dashboard-header__customize-label--long { display: none; }
  .dashboard-header__customize-label--short { display: inline; }

  .shift-status { gap: 0.375rem; font-size: 0.8125rem; }
  .shift-status__dot { width: 0.5rem; height: 0.5rem; }
  .shift-status__timer { font-size: 0.9375rem; }

  .clock-button { flex-shrink: 0; font-size: 1rem; }
  .clock-button--in {
    gap: 0.5rem;
    padding: 0 1.25rem 0 1rem;

    & .clock-button__icon { width: 1rem; height: 1rem; }
  }
  .clock-button--out {
    gap: 0.5rem;
    padding: 0 1.125rem 0 1rem;

    & .clock-button__icon { width: 0.9375rem; height: 0.9375rem; }
  }

  .quick-actions { gap: 0.625rem; }
  .quick-action__tile {
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;

    &:hover { box-shadow: 0 1px 2px rgb(60 45 20 / 0.06); }
  }
  .quick-action__chip {
    width: 2.5rem;
    height: 2.5rem;

    & svg { width: 1.375rem; height: 1.375rem; }
  }
  .quick-action__label { font-size: 0.875rem; }

  .dashboard-strip { font-size: 0.9375rem; }
  .dashboard-strip__counts { gap: 0.25rem 1.125rem; }
  .dashboard-strip__shortcuts { display: none; }
}
