/* Admin Hours and the admin tabs on Payroll: an admin's own clocked workday,
   never client time. The dashboard's Clock in and Clock out live in
   admin_dashboard_header.css. */
.admin-hours,
.pay-tabs,
.pay-type-tag,
.shift-status-pill,
.fix-times {
  --hours-ink: #15302e;
  --hours-text: #3d4a49;
  --hours-body: #5c6b6a;
  --hours-muted: #8a938f;
  --hours-border: #e6e0d6;
  --hours-hairline: #efeae1;
  --hours-paper: #fff;
  --hours-cream: #fffaf2;
  --hours-green: #2e7d52;
  --hours-green-soft: #ecf5ef;
  --hours-green-ink: #2e6b47;
  --hours-blue-soft: #e4ecf7;
  --hours-blue-ink: #2d4f7c;
  --hours-amber: #b45309;
  --hours-amber-soft: #fff3e4;
  --hours-grey-soft: #f1f3f2;
  --hours-red: #e03a3a;
  --hours-red-soft: #fbe2e1;
}

/* The page: title and note on the left, the pay period and Export CSV on the right. */
.admin-hours {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  color: var(--hours-ink);
}
.admin-hours__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.admin-hours__title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.admin-hours__note {
  margin-top: 0.25rem;
  font-size: 1rem;
  color: var(--hours-body);
}
.admin-hours__period {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}
.admin-hours__period-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--hours-body);
}

/* "All admins" and "My hours" here; DSPs, Hourly admins and Salaried admins
   on Payroll. Plain words, the open one dark. */
.pay-tabs {
  display: flex;
  gap: 1.5rem;
  padding: 0 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--hours-muted);
}
.pay-tabs__tab {
  padding: 0.375rem 0;
  border-bottom: 2px solid transparent;

  &:hover { color: var(--hours-text); }
  &:focus-visible { outline: 2px solid var(--hours-green); outline-offset: 2px; border-radius: 0.25rem; }
}
.pay-tabs__tab--active {
  color: var(--hours-ink);
  font-weight: 600;
  border-bottom-color: var(--hours-ink);
}

/* Search staff beside the Filters button, which drops a panel of checkboxes. */
.admin-hours__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.admin-hours__search {
  position: relative;
  flex: 0 1 28rem;
  min-width: 14rem;
}
.admin-hours__search-icon {
  position: absolute;
  top: 50%;
  left: 0.875rem;
  width: 1.125rem;
  height: 1.125rem;
  transform: translateY(-50%);
  color: var(--hours-muted);
  pointer-events: none;
}
.admin-hours__search-input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem 0 2.625rem;
  border: 1px solid var(--hours-border);
  border-radius: 0.625rem;
  background: var(--hours-paper);
  font-size: 0.9375rem;
  color: var(--hours-ink);

  &::placeholder { color: var(--hours-muted); }
  &:focus { outline: 2px solid var(--hours-green); outline-offset: -1px; }
}
.admin-hours__filters { position: relative; }
.admin-hours__filters-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--hours-border);
  border-radius: 0.625rem;
  background: var(--hours-paper);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--hours-ink);
  cursor: pointer;
  list-style: none;

  &::-webkit-details-marker { display: none; }
  &:hover { border-color: var(--hours-green); }
}
.admin-hours__filters[open] .admin-hours__filters-button { border-color: var(--hours-green); }
.admin-hours__filters-icon { width: 1.125rem; height: 1.125rem; }
.admin-hours__filters-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--hours-green);
  font-size: 0.75rem;
  color: #fff;
}
.admin-hours__filters-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 15rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--hours-border);
  border-radius: 0.75rem;
  background: var(--hours-paper);
  box-shadow: 0 0.5rem 1.25rem rgb(20 40 38 / 0.14);
}
.admin-hours__filters-heading {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hours-muted);

  &:first-child { margin-top: 0; }
}
.admin-hours__filters-choice {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  color: var(--hours-text);
  cursor: pointer;
}
.admin-hours__filters-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* The table, wider than a phone. */
.admin-hours-table {
  overflow-x: auto;
  border-radius: 0.75rem;
  background: var(--hours-paper);
  box-shadow: 0 1px 3px rgb(20 40 38 / 0.08);

  & th {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hours-body);
    text-align: left;
  }
  & td { vertical-align: middle; }
}
.admin-hours-table__hours { text-align: right; }
.admin-hours-row { border-top: 1px solid var(--hours-hairline); }
.admin-hours-row--done,
.admin-hours-row--times-fixed { background: var(--hours-cream); }
.admin-hours-row__date { font-size: 1rem; white-space: nowrap; }
.admin-hours-row__name { font-size: 1rem; font-weight: 600; white-space: nowrap; }
.admin-hours-row__length {
  display: block;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.admin-hours-row__times {
  display: block;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--hours-body);
}

/* "Hourly" or "Salary" beside an admin's name. */
.pay-type-tag {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
  white-space: nowrap;
}
.pay-type-tag--hourly { background: var(--hours-green-soft); color: var(--hours-green-ink); }
.pay-type-tag--salary { background: var(--hours-blue-soft); color: var(--hours-blue-ink); }

/* On shift, Done, Times fixed. */
.shift-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;

  & svg { width: 0.875rem; height: 0.875rem; }
}
.shift-status-pill--on-shift { background: var(--hours-green-soft); color: var(--hours-green-ink); }
.shift-status-pill--done { background: var(--hours-grey-soft); color: var(--hours-body); }
.shift-status-pill--times-fixed { background: var(--hours-amber-soft); border-color: #f0c9a0; color: var(--hours-amber); }

/* Fix times beside the red trash button. */
.admin-hours-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-hours-actions__fix {
  height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid var(--hours-border);
  border-radius: 0.5rem;
  background: var(--hours-paper);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--hours-ink);
  cursor: pointer;

  &:hover { border-color: var(--hours-ink); }
  &:focus-visible { outline: 2px solid var(--hours-green); outline-offset: 2px; }
}
.admin-hours-actions__delete {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  color: var(--hours-red);
  cursor: pointer;

  & svg { width: 1.125rem; height: 1.125rem; }
  &:hover { background: var(--hours-red-soft); }
  &:focus-visible { outline: 2px solid var(--hours-red); outline-offset: 2px; }
}

/* Nothing to show. */
.admin-hours__empty {
  padding: 2.5rem 1rem;
  border-radius: 0.75rem;
  background: var(--hours-paper);
  text-align: center;
  color: var(--hours-body);
}
.admin-hours__empty-title {
  margin-bottom: 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--hours-ink);
}

/* On a phone each shift is a card. */
.admin-hours-cards { display: none; }

@media (max-width: 767px) {
  .admin-hours__title { font-size: 1.75rem; }
  .admin-hours__period { width: 100%; }
  .admin-hours__period form { flex: 1; }
  .admin-hours__period-select { width: 100%; }
  .admin-hours__search { flex: 1 1 100%; }
  .admin-hours__filters { width: 100%; }
  .admin-hours__filters-button { width: 100%; justify-content: center; }
  .admin-hours__filters-panel { right: 0; }

  .admin-hours-table { display: none; }
  .admin-hours-cards {
    display: block;
    overflow: hidden;
    border-radius: 0.75rem;
    background: var(--hours-paper);
    box-shadow: 0 1px 3px rgb(20 40 38 / 0.08);
    list-style: none;
  }
  .admin-hours-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--hours-hairline);

    &:first-child { border-top: 0; }
  }
  .admin-hours-card--done,
  .admin-hours-card--times-fixed { background: var(--hours-cream); }
  .admin-hours-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .admin-hours-card__name { font-size: 1.125rem; font-weight: 700; }
  .admin-hours-card__date { font-size: 1rem; color: var(--hours-body); }
  .admin-hours-card__hours { text-align: right; }
  .admin-hours-card__length {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .admin-hours-card__times {
    display: block;
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
    color: var(--hours-body);
  }
  .admin-hours-card__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .admin-hours-card__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .admin-hours-actions__fix { height: 2.75rem; padding: 0 1.25rem; }
  .admin-hours-actions__delete { width: 2.75rem; height: 2.75rem; }
}

/* The Fix times pop-up: the two times, Save and Cancel, then every earlier
   change to the shift underneath. */
.fix-times__box {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  width: 100%;
  max-width: 32rem;
  padding: 1.5rem;
  border-radius: 1rem 1rem 0 0;

  @media (min-width: 640px) { border-radius: 1rem; }
}
.fix-times__head { display: flex; flex-direction: column; gap: 0.25rem; }
.fix-times__title { font-size: 1.25rem; font-weight: 700; color: var(--hours-ink); }
.fix-times__who { font-size: 1rem; color: var(--hours-body); }
.fix-times__form { display: flex; flex-direction: column; gap: 1.125rem; }
.fix-times__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.fix-times__field { display: flex; flex-direction: column; gap: 0.375rem; }
.fix-times__label { font-size: 0.9375rem; font-weight: 600; color: var(--hours-ink); }
.fix-times__help { font-size: 0.8125rem; color: var(--hours-muted); }
.fix-times__buttons {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;

  @media (min-width: 640px) { flex-direction: row; justify-content: flex-end; }
}
.fix-times__history {
  padding-top: 1.125rem;
  border-top: 1px solid var(--hours-hairline);
}
.fix-times__history-title {
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hours-body);
}
.fix-times__changes {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  list-style: none;
}
.fix-times__change { font-size: 0.9375rem; color: var(--hours-body); }
.fix-times__change-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;

  & strong { color: var(--hours-ink); }
}
.fix-times__change-line {
  margin-top: 0.125rem;

  & s { color: var(--hours-muted); }
  & b { color: var(--hours-ink); }
}
.fix-times__change-reason { margin-top: 0.125rem; color: var(--hours-text); }

/* The note above the Salaried admins tab on Payroll. */
.payroll-note {
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  color: var(--hours-body);
}
