/* Employee work hours: one glass card per day, rows with a share-of-day bar.
   Narrow screens stack the bar under the row, wide containers put everything on one line. */

.wh-list {
  --wh-ink: #1b2140;
  --wh-soft: #4b5567;
  --wh-glass: rgba(255, 255, 255, .62);
  --wh-edge: rgba(255, 255, 255, .8);
  --wh-field: rgba(255, 255, 255, .72);
  --wh-line: #dce4f1;
  --wh-track: rgba(80, 105, 220, .12);
  --wh-icon-edge: rgba(255, 255, 255, .55);
  --wh-shadow: rgba(31, 38, 90, .14);
  --wh-hi: rgba(255, 255, 255, .9);
  --wh-sheen-a: rgba(255, 255, 255, .5);
  --wh-sheen-b: rgba(255, 255, 255, .1);
  --wh-sheen-c: rgba(255, 255, 255, .28);
  container-type: inline-size;
  display: grid;
  gap: 12px;
}

html[data-theme="dark"] .wh-list {
  --wh-ink: #f2f5ff;
  --wh-soft: #b9c3db;
  --wh-glass: rgba(27, 31, 42, .66);
  --wh-edge: rgba(255, 255, 255, .14);
  --wh-field: rgba(255, 255, 255, .06);
  --wh-line: rgba(255, 255, 255, .14);
  --wh-track: rgba(255, 255, 255, .1);
  --wh-icon-edge: rgba(255, 255, 255, .28);
  --wh-shadow: rgba(0, 0, 0, .5);
  --wh-hi: rgba(255, 255, 255, .08);
  --wh-sheen-a: rgba(255, 255, 255, .1);
  --wh-sheen-b: rgba(255, 255, 255, .02);
  --wh-sheen-c: rgba(255, 255, 255, .05);
}

.wh-day {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--wh-edge);
  border-radius: 22px;
  color: var(--wh-ink);
  background:
    linear-gradient(135deg, var(--wh-sheen-a), var(--wh-sheen-b) 45%, var(--wh-sheen-c)),
    var(--wh-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    0 18px 40px var(--wh-shadow),
    inset 0 1px 0 var(--wh-hi);
}

.wh-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 4px;
}

.wh-day-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.wh-day-name > i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--wh-icon-edge);
  border-radius: 11px;
  color: #fff;
  font-size: 17px;
  background: linear-gradient(145deg, #8f84f0, #5069dc);
  box-shadow: 0 6px 14px rgba(80, 105, 220, .3);
}

.wh-day-name small {
  color: var(--wh-soft);
  font-size: 11.5px;
  font-weight: 400;
}

/* the day total: animated gradient with a sweeping light, green while a shift is still running */
.wh-total {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  overflow: hidden;
  border-radius: 999px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(120deg, #5b7bff, #7a55f0, #4fa3f0, #5b7bff);
  background-size: 250% 100%;
  animation: whFlow 6s linear infinite;
  box-shadow:
    0 8px 18px rgba(91, 100, 240, .35),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}

.wh-total::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: whSheen 3.4s ease-in-out infinite;
}

.wh-total.is-live {
  background: linear-gradient(120deg, #2fa96d, #3cc48a, #4fd0b5, #2fa96d);
  background-size: 250% 100%;
  box-shadow:
    0 8px 18px rgba(47, 169, 109, .35),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}

/* ---------- rows ---------- */
.wh-row {
  --wh-tone: var(--petrol);
  position: relative;
  display: grid;
  grid-template-columns: 30px 42px minmax(0, 1fr);
  grid-template-areas:
    "num icon body"
    "bar bar bar";
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid var(--wh-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--wh-tone) 14%, transparent), transparent 55%),
    var(--wh-field);
  animation: whRowIn .55s cubic-bezier(.2, .9, .3, 1.1) both;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.1), box-shadow .25s ease, border-color .25s ease;
}

.wh-row:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--wh-tone) 40%, transparent);
  box-shadow: 0 14px 30px var(--wh-shadow);
}

.wh-num {
  grid-area: num;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--wh-line);
  border-radius: 10px;
  color: var(--wh-soft);
  background: var(--wh-field);
  font-size: 12.5px;
  font-weight: 700;
}

.wh-icon {
  grid-area: icon;
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--wh-icon-edge);
  border-radius: 13px;
  color: #fff;
  font-size: 21px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--wh-tone) 82%, #fff), var(--wh-tone));
  box-shadow: 0 6px 14px color-mix(in srgb, var(--wh-tone) 38%, transparent);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.1);
}

.wh-row:hover .wh-icon {
  transform: scale(1.1) rotate(-8deg);
}

.wh-icon-live {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--wh-field);
  border-radius: 50%;
  background: #2fa96d;
  animation: whPulse 1.6s ease-in-out infinite;
}

.wh-body {
  grid-area: body;
  min-width: 0;
}

.wh-title {
  overflow: hidden;
  color: var(--wh-ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wh-time {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--wh-soft);
  font-size: 12.5px;
  white-space: nowrap;
}

.wh-time > i {
  font-size: 14px;
}

.wh-track-row {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wh-track {
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--wh-track);
}

.wh-track > b {
  display: block;
  width: var(--wh-share);
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--wh-tone), color-mix(in srgb, var(--wh-tone) 55%, #fff));
  transform-origin: right;
  animation: whGrow .9s cubic-bezier(.2, .9, .3, 1.1) .2s both;
}

.wh-row.is-live .wh-track > b {
  background: linear-gradient(90deg, var(--wh-tone), rgba(255, 255, 255, .55), var(--wh-tone));
  background-size: 200% 100%;
  animation: whGrow .9s ease .2s both, whFlow 3s linear infinite;
}

.wh-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--wh-tone) 36%, transparent);
  border-radius: 999px;
  color: var(--wh-ink);
  background: color-mix(in srgb, var(--wh-tone) 16%, transparent);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.wh-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fa96d;
  animation: whPulse 1.6s ease-in-out infinite;
}

/* wide container: one line per row */
@container (min-width: 560px) {
  .wh-day {
    padding: 14px 16px;
  }

  .wh-row {
    grid-template-columns: 30px 42px minmax(180px, 1.1fr) minmax(0, 2fr);
    grid-template-areas: "num icon body bar";
    gap: 14px;
  }

  .wh-track-row {
    gap: 14px;
  }

  .wh-track {
    height: 10px;
  }
}

@keyframes whRowIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes whGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes whFlow {
  to { background-position: 250% 0; }
}

@keyframes whSheen {
  60%, 100% { left: 120%; }
}

@keyframes whPulse {
  50% {
    opacity: .35;
    transform: scale(1.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wh-total,
  .wh-total::before,
  .wh-row,
  .wh-track > b,
  .wh-icon-live,
  .wh-live-dot {
    animation: none;
  }
}
