/* ═══════════════════════════════════════
   Worker Dashboard — Design System 2.0
   ═══════════════════════════════════════ */

/* ── Header — sticky greeting + date ── */
.worker-hero {
  text-align: center;
  padding: var(--space-sm) var(--space-lg);
  padding-top: calc(var(--space-sm) + env(safe-area-inset-top, 0px));
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg);
  margin: calc(-1 * var(--space-lg));
  margin-bottom: var(--space-lg);
}

.worker-hero__greeting {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: var(--leading-tight);
  margin-bottom: 1px;
}

.worker-hero__date {
  font-size: var(--text-xs);
  color: var(--text-faint);
  text-transform: capitalize;
}

/* ── Week strip — 7-day glanceable status bar ── */
.week-strip {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.week-strip__days {
  display: flex;
  justify-content: space-around;
}

.week-strip__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: var(--space-xs) 0;
  border-radius: var(--radius-md);
  min-width: 0;
  transition: background var(--transition-fast);
}

.week-strip__name {
  font-size: var(--text-2xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  line-height: 1;
}

.week-strip__date {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.week-strip__status {
  font-size: var(--text-2xs);
  font-weight: var(--font-bold);
  font-variant-numeric: tabular-nums;
  min-height: 16px;
  display: flex;
  align-items: center;
  line-height: 1;
}

/* Tappable today link */
a.week-strip__day {
  text-decoration: none;
  cursor: pointer;
}

a.week-strip__day:active {
  transform: scale(0.95);
}

/* Plus indicator on tappable today */
.week-strip__plus {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--accent);
  line-height: 1;
}

/* Today — amber column */
.week-strip__day--today {
  background: var(--accent-muted);
}

.week-strip__day--today .week-strip__date {
  background: var(--accent);
  color: var(--bg);
}

.week-strip__day--today .week-strip__name {
  color: var(--accent);
}

/* Has hours logged */
.week-strip__day--logged .week-strip__status {
  color: var(--success);
}

.week-strip__day--logged .week-strip__date {
  color: var(--text);
}

/* Missing — distinct red */
.week-strip__day--missing .week-strip__status {
  color: var(--danger);
}

.week-strip__day--missing .week-strip__date {
  border: 1px dashed var(--danger);
  opacity: 0.7;
}

/* Weekend */
.week-strip__day--weekend .week-strip__name,
.week-strip__day--weekend .week-strip__date {
  opacity: 0.4;
}

/* Future */
.week-strip__day--future .week-strip__name,
.week-strip__day--future .week-strip__date {
  opacity: 0.3;
}

/* Week total */
.week-strip__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-sm) var(--space-2xs);
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.week-strip__total strong {
  color: var(--text);
  font-weight: var(--font-bold);
}

/* ── Section header ── */
.worker-section {
  margin-bottom: var(--space-xl);
}

.worker-section__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.worker-section__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.worker-section__count {
  font-size: var(--text-2xs);
  font-weight: var(--font-bold);
  background: var(--surface-3);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Timesheet row — compact inline card ── */
.worker-ts {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
  border-left: 3px solid var(--border);
  transition: background var(--transition-fast);
}

.worker-ts__left {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.worker-ts__project {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text);
  margin-bottom: var(--space-2xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.worker-ts__time {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.worker-ts__icon {
  flex-shrink: 0;
  opacity: 0.5;
}

.worker-ts__sep {
  opacity: 0.4;
}

.worker-ts__badges {
  display: flex;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.worker-ts__right {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
}

.worker-ts__hours {
  font-size: var(--text-xl);
  font-weight: var(--font-extrabold);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Actions row */
.worker-ts__actions {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  margin-top: var(--space-sm);
  border-top: 1px solid var(--border-subtle);
}

.worker-ts__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.worker-ts__action:hover {
  background: var(--surface-2);
  color: var(--text);
}

.worker-ts__action--danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

/* button_to wraps in a form — reset it */
.worker-ts__actions form {
  display: contents;
}

/* ── Empty state ── */
.worker-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.worker-empty__icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  color: var(--text-faint);
}

.worker-empty__text {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .worker-hero__greeting {
    font-size: var(--text-xl);
  }

  .worker-ts {
    padding: var(--space-sm) var(--space-md);
  }

  .worker-ts__hours {
    font-size: var(--text-lg);
  }
}

/* ── Light theme overrides ── */
[data-theme="light"] .worker-ts {
  border-left-color: var(--border);
}

[data-theme="light"] .week-strip__day--today .week-strip__date {
  color: #fff;
}
