/* Schedule upcoming — features/schedule/upcoming.js: the next-shift hero,
   the 14-day strip and the two-week list. Rendered by personal-dashboard.js
   and swap-requests.js (and the dashboard's .personal-dashboard layout in
   shared/dashboard.css). Location hue comes from the --loc slot property
   (base.css "Palette slots"). Loaded eagerly (index.html). */
@layer components {

/* Next-shift hero: the shift column and its actions (row layout on the
   personal dashboard, shared/dashboard.css). */
.ms-hero-main { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.ms-hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ms-hero-actions .btn { min-height: 40px; }

/* 14-day strip: one cell per day, seven per row. */
.day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.day-strip-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  min-height: 56px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--text-xs);
}
.day-strip-day.weekend, .day-strip-day.is-off, .day-strip-day.is-unknown { background: var(--surface-sunk); }
.day-strip-day.is-unknown { border-style: dashed; }
.day-strip-day.is-today { border-color: var(--p-600); box-shadow: inset 0 0 0 1px var(--p-600); }
/* An offered shift (swap or cover request) placed among the caller's own. */
.day-strip-day.is-offered { border: 1px dashed var(--info); background: var(--info-bg); }
.day-strip-new { color: var(--info); font-weight: 700; }
.day-strip-date { color: var(--text-2); white-space: nowrap; }
.day-strip-weekday { text-transform: capitalize; }
.day-strip-empty { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A planned compensation day off: the shared COMP mark (base-ui.css). */
.day-strip-day.is-comp .comp-day-mark { align-self: flex-start; }
/* The caller's own leave: a span row above the week it covers
   (features/leave/leave-spans.js; row and span styles in
   shared/day-timeline.css). A day under approved or sick leave has no "free"
   word; a day under a pending request keeps it behind a dashed border. */
.day-strip-day.is-requested { border-style: dashed; }
.day-strip-shift {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 4px;
  padding-left: 4px;
  border-left: 3px solid var(--muted);
  font-weight: 700;
  color: var(--text);
}
.day-strip-shift .chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.day-strip-shift.chip-oncall .chip-dot { background: transparent; border: 1.5px solid var(--muted); }
.day-strip-abbr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-strip-loc { grid-column: 1 / -1; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-strip-shift:is(.loc-1, .loc-2, .loc-3, .loc-4, .loc-5, .loc-6, .loc-7, .loc-8) { border-left-color: var(--loc); }
.day-strip-shift:is(.loc-1, .loc-2, .loc-3, .loc-4, .loc-5, .loc-6, .loc-7, .loc-8) .chip-dot { background: var(--loc); border-color: var(--loc); }
.day-strip-shift.chip-oncall .chip-dot { background: transparent; }
@media (max-width: 600px) {
  .day-strip-day { align-items: center; padding: var(--space-1) 2px; text-align: center; }
  .day-strip-date { display: flex; flex-direction: column; }
  .day-strip-shift { grid-template-columns: minmax(0, 1fr); padding-left: 3px; }
  .day-strip-shift .chip-dot, .day-strip-loc { display: none; }
  .day-strip-day.is-comp .comp-day-mark { align-self: center; }
}

/* Window summary under the strip. */
.upcoming-summary { margin: var(--space-2) 0 0; color: var(--text-2); }

/* ── Upcoming list (features/schedule/upcoming.js) ──────────────────────
   ISO-week groups, one compact line per shift: date, location dot with
   shift · location, times, swap link. On-call and non-clinical shifts are
   bold. */
.upcoming-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.upcoming-rows { margin: 0; padding: 0; list-style: none; }
.upcoming-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto 4rem;
  align-items: center;
  gap: var(--space-3);
  min-height: 32px;
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-sm);
  border-top: 1px solid var(--border);
}
.upcoming-row:first-child { border-top: 0; }
.upcoming-row.weekend { background: var(--surface-sunk); }
.upcoming-row.today { box-shadow: inset 3px 0 0 var(--p-600); }
.upcoming-row-date { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.upcoming-row-weekday { display: inline-block; min-width: 1.75rem; text-transform: capitalize; color: var(--muted); }
.upcoming-row.today .upcoming-row-date { color: var(--p-600); font-weight: 700; }
.upcoming-row-shift { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.upcoming-row-name, .upcoming-row-loc { overflow: hidden; text-overflow: ellipsis; }
.upcoming-row-loc { color: var(--muted); flex: 1 1 auto; min-width: 0; white-space: pre; }
.upcoming-row-name { flex: 0 0 auto; max-width: 100%; }
.upcoming-row.is-marked .upcoming-row-name { font-weight: 700; }
.upcoming-row-times { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.upcoming-row-swap { justify-self: end; white-space: nowrap; }
.upcoming-row .chip-dot { width: 8px; height: 8px; margin-right: var(--space-2); }
.upcoming-row.chip-oncall .chip-dot { background: transparent; border: 1.5px solid var(--muted); }
.upcoming-row:is(.loc-1, .loc-2, .loc-3, .loc-4, .loc-5, .loc-6, .loc-7, .loc-8) .chip-dot { background: var(--loc); border-color: var(--loc); }
.upcoming-row.chip-oncall[class*="loc-"] .chip-dot { background: transparent; }
.upcoming-week-heading { margin: 0; padding: var(--space-1) var(--space-4); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--surface-sunk); border-bottom: 1px solid var(--border); }
.upcoming-week + .upcoming-week .upcoming-week-heading { border-top: 1px solid var(--border); }
.upcoming-week-empty { margin: 0; padding: var(--space-2) var(--space-4); }
.upcoming-coverage { margin: 0; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.ms-hero-off { margin-top: var(--space-2); color: var(--muted); }
@media (max-width: 800px) {
  .upcoming-row { grid-template-columns: 3rem minmax(0, 1fr) auto; padding-inline: var(--space-3); row-gap: 0; }
  .upcoming-row-times { grid-column: 2; grid-row: 2; font-size: var(--text-xs); }
  .upcoming-row-swap { grid-column: 3; grid-row: 1 / 3; min-height: 32px; display: flex; align-items: center; }
  .upcoming-week-heading, .upcoming-week-empty, .upcoming-coverage { padding-inline: var(--space-3); }
}

/* On a leave day the hero leads with the leave (upcoming.js heroState
   'on-leave'): the left edge takes the leave kind's colour in place of a
   location hue, green for approved leave, amber for a sickness, both tokens
   with their dark values in base.css. A week heading in the list names the
   leave in it the same way. */
.ms-hero.is-on-leave { border-left-color: var(--success); }
.ms-hero.is-on-leave.is-leave-sick { border-left-color: var(--warning); }
.ms-hero-leave { display: flex; align-items: center; gap: var(--space-2); }
.ms-hero-leave svg { flex: none; }
.upcoming-week-leave { text-transform: none; letter-spacing: 0; }
.upcoming-week-leave svg { vertical-align: -2px; }

/* The hero's second line: who works alongside (caller-built, upcoming.js
   peopleLineHtml). Groups wrap as units rather than mid-name. */
.ms-hero-people { display: flex; flex-wrap: wrap; column-gap: 0; row-gap: 2px; margin-top: var(--space-1); color: var(--text-2); }
.ms-hero-people-group { white-space: nowrap; }
.ms-hero-people-sep { white-space: pre; }
@media (max-width: 600px) { .ms-hero-people-group { white-space: normal; } }
/* A resident's clinical shift without a supervisor: the amber chip in place of names. */
.ms-hero-people .badge { gap: var(--space-1); }

/* Compact next-shift hero; location identity uses the left border. */
.ms-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-left-width: 5px;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.ms-hero:is(.loc-1, .loc-2, .loc-3, .loc-4, .loc-5, .loc-6, .loc-7, .loc-8) { border-left-color: var(--loc); }

.ms-hero-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ms-hero-body { font-size: var(--text-base); }

.ms-hero-shift {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2px;
}

.ms-hero-shift-meta { margin-top: 2px; }
.ms-hero-shift-meta:first-child { margin-top: 0; }

} /* @layer components */
