/* day-load.css — the assignee's next few days, under a due-date picker.
 *
 * Written phone-first because that is where it is hardest to fit: at
 * 375px the three days STACK as rows, and only widen into three
 * columns at 760px (the app's breakpoint). Three columns of task names
 * on a phone truncates every one of them to two words, which turns the
 * panel into decoration.
 *
 * Colours come from tokens.css. Nothing here hardcodes brand blue — a
 * workspace on a custom theme writes --brand inline on <html>.
 */

.dl-peek {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 8px;
}
.dl-peek.is-compact { margin-top: 6px; padding: 6px; background: transparent; }

.dl-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--ink-muted);
}
.dl-head-title { font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.dl-head-note  { font-size: 11px; font-weight: 400; margin-left: auto; }

.dl-empty,
.dl-denied {
  font-size: 12px;
  color: var(--ink-muted);
  padding: 4px 2px;
}

/* ── One person ─────────────────────────────────────────────────── */

.dl-user + .dl-user {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dl-user-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.dl-user-name { font-size: 12px; font-weight: 700; color: var(--ink-strong); }

.dl-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--ink-muted);
}
.dl-chip.is-overdue {
  background: color-mix(in srgb, var(--status-blocked) 12%, transparent);
  color: var(--status-blocked);
}

/* ── The days ───────────────────────────────────────────────────── */

.dl-days { display: grid; grid-template-columns: 1fr; gap: 6px; }

.dl-day {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 6px 8px;
  min-width: 0;
}
/* The day the owner actually picked. Left rail rather than a full
   border so it reads as "this one" without competing with .is-over. */
.dl-day.is-focus { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.dl-day.is-off   { background: var(--bg-subtle); }

.dl-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-muted);
  min-width: 0;
}
.dl-day-when   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-day-when b { color: var(--ink-strong); font-weight: 700; }
.dl-day-rel {
  margin-left: 4px;
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.dl-day-load { font-weight: 700; color: var(--ink-body); white-space: nowrap; }
.dl-day.is-over .dl-day-load { color: var(--status-blocked); }
.dl-unest { margin-top: 3px; font-size: 10px; color: var(--ink-faint); }

.dl-bar {
  height: 3px;
  margin: 5px 0 2px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.dl-bar-fill { display: block; height: 100%; background: var(--brand); }
.dl-day.is-over .dl-bar-fill { background: var(--status-blocked); }

.dl-avail {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--ink-muted);
}
.dl-avail.is-leave   { background: color-mix(in srgb, var(--status-review) 14%, transparent); color: var(--status-review); }
.dl-avail.is-holiday { background: color-mix(in srgb, var(--status-ready) 14%, transparent);  color: var(--status-ready); }

/* ── The tasks on a day ─────────────────────────────────────────── */

.dl-tasks { list-style: none; margin: 5px 0 0; padding: 0; }
.dl-task {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-body);
  min-width: 0;
}
.dl-task-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The project a task belongs to. Given a hard ceiling rather than
   flex: the task name is what the reader is scanning, and a long
   project name must not be allowed to eat it on a phone. */
.dl-task-proj {
  flex: none;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  opacity: .85;
}
.dl-task-est { color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-more { font-size: 10px; color: var(--ink-faint); padding-left: 11px; }

.dl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--prio-none);
}
.dl-dot.prio-critical { background: var(--prio-critical); }
.dl-dot.prio-high     { background: var(--prio-high); }
.dl-dot.prio-medium   { background: var(--prio-medium); }
.dl-dot.prio-low      { background: var(--prio-low); }

/* ── Desk: three days side by side ──────────────────────────────── */

@media (min-width: 761px) {
  .dl-days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dl-day-head { flex-wrap: wrap; }
}


/* ── The team strip (owner dashboard) ───────────────────────────
 *
 * A roster of hours: who down the side, the next few days across.
 *
 * Phone first, and that decides the layout. At 375px a name plus three
 * day cells on ONE line leaves about 40px for the name — every person
 * renders as "Na...", "Ar...", "Fathim...", which is the one column
 * the reader is actually scanning. So below 760px the row STACKS: the
 * name gets the full width, and the days sit as a strip underneath.
 * Side by side only where there is room for both.
 *
 * The cells are wrapped in .dl-cells (see day-load.jsx) so they keep
 * their shared grid with the header in either arrangement.
 */

.dl-grid-wrap { margin-top: 4px; }

/* ── The over-capacity filter ────────────────────────────────────
   Wraps rather than shrinks: on a phone the note drops under the
   button instead of squeezing it below a tappable size. */
.dl-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.dl-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* 44px is the floor this app uses for anything tapped — Apple's HIG
     minimum, and what mobile.css already applies elsewhere. A checkbox
     would have been a 13px target, which is why this is a button. */
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-body);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
}
.dl-toggle:hover { background: var(--bg-hover); }
.dl-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Pressed state carried by fill and weight, not colour alone. */
.dl-toggle.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.dl-toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
}
.dl-toggle.is-on .dl-toggle-count {
  background: rgba(255, 255, 255, .24);
  color: #fff;
}
.dl-tools-note { font-size: 11px; color: var(--ink-muted); }
/* A safety net, not the everyday path: with minmax(0,1fr) cells the
   strip shrinks rather than overflowing. It is here so a five-day
   window on a narrow screen scrolls INSIDE its box instead of making
   the whole dashboard scroll sideways. */
.dl-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.dl-cells {
  display: grid;
  grid-template-columns: repeat(var(--dl-cols, 3), minmax(0, 1fr));
  gap: 5px;
}

.dl-grid-head { display: block; }
.dl-grid-head .dl-grid-who { display: none; }   /* nothing to label when stacked */
.dl-grid-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-faint);
  padding: 0 6px 6px;
  border-bottom: 1px solid var(--border);
}
.dl-grid-head b { color: var(--ink-muted); font-weight: 700; }
.dl-grid-col {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.dl-grid-col b,
.dl-grid-col-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-grid-col-date { font-weight: 400; }

.dl-grid-row {
  display: block;
  position: relative;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  /* The whole row is a tap target, so tapping it must not start a text
     selection over the name — on touch that turns an expand into a
     highlight-and-callout. */
  user-select: none;
  -webkit-user-select: none;
}
.dl-grid-row .dl-cells { margin-top: 4px; }
.dl-grid-row:hover { background: var(--bg-hover); }
.dl-grid-row.is-open { background: var(--bg-hover); border-color: var(--border); }
.dl-grid-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.dl-grid-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dl-grid-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The expand caret. Lives in the name cell (see day-load.jsx) so it
   stays on screen when the strip is scrolled sideways, and reads as
   pressable with no hover to rely on. A plain single angle quote
   rather than a rarer arrow glyph — uncommon Unicode renders as tofu
   on the machines staff actually use (CLAUDE.md §4). */
.dl-caret {
  margin-left: auto;
  flex: none;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform .15s ease;
}
.dl-grid-row.is-open .dl-caret { transform: rotate(270deg); }

.dl-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--bg-subtle);
  min-width: 0;
}
.dl-cell-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dl-cell-off { font-size: 9px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; }

.dl-cell.is-over { background: color-mix(in srgb, var(--status-blocked) 12%, transparent); }
.dl-cell.is-over .dl-cell-val { color: var(--status-blocked); }
.dl-cell.is-off { background: transparent; }
.dl-cell.is-off .dl-cell-val { color: var(--ink-faint); }
/* Work booked onto a day the person is not there. The one state on
   this strip that is a mistake rather than a measurement. */
.dl-cell.is-clash {
  background: color-mix(in srgb, var(--status-progress) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-progress) 50%, transparent);
}
.dl-cell.is-clash .dl-cell-val,
.dl-cell.is-clash .dl-cell-off { color: var(--status-progress); }

.dl-grid-detail { padding: 2px 6px 10px; }

/* ── Desk: name and days on one line ────────────────────────────── */

@media (min-width: 761px) {
  .dl-grid-head,
  .dl-grid-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(0, 2.4fr);
    gap: 10px;
    align-items: center;
  }
  .dl-grid-head .dl-grid-who { display: flex; }
  .dl-grid-row .dl-cells { margin-top: 0; }
}
