/* Officer hub: dashboard section. Tokens and shared pieces come from app.css and hub.css; the
   workload bar (.load-meter) lives in hub-team.css. */

/* ---------- layout: the glance strip, then two columns (one on phones) ---------- */

.dash {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.dash-glance { grid-column: 1 / -1; }
.dash-main, .dash-side { display: grid; gap: 18px; min-width: 0; }

.dash-card { padding: 18px 20px 20px; min-width: 0; }
.dash-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px;
  min-height: 34px; margin-bottom: 12px;
}
.dash-card-title { margin: 0; font-size: 16px; letter-spacing: -0.005em; }
.dash-card-title:focus { outline: none; }
.dash-card-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.dash-link { font-size: 14px; font-weight: 650; text-decoration: none; }
.dash-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.dash-quiet { margin: 0; color: var(--muted); }
.dash-foot { margin: 12px 0 0; }
.dash-foot.hint { font-size: 13px; }
.dash-more { margin-top: 12px; }
.dash-status { margin: 0; font-size: 13px; }
.dash-status.is-error { color: var(--danger); font-weight: 600; }
.dash-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-time-ago { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---------- the board at a glance ---------- */

.dash-tiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.dash-tile a {
  display: grid; align-content: start; gap: 1px; height: 100%;
  padding: 14px 16px 15px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s;
}
.dash-tile a:hover { border-color: var(--accent); }
.dash-tile-n { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dash-tile-label { font-weight: 700; font-size: 14px; }
.dash-tile-sub { color: var(--muted); font-size: 13px; }
.dash-tile.is-late a { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.dash-tile.is-late .dash-tile-n { color: var(--danger); }
.dash-tile.is-ok .dash-tile-n { color: var(--ok); }

/* ---------- my assignments ---------- */

.dash-tasks { list-style: none; margin: 0; padding: 0; }
.dash-task { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.dash-task:first-child { border-top: 0; padding-top: 2px; }
.dash-task:last-child { padding-bottom: 0; }

/* The round "mark done" button: a 36px target (44px on phones) around a 22px ring. */
.dash-check {
  position: relative; z-index: 1; /* above the row's stretched title link */
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; margin: -6px 0 -6px -7px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ok); cursor: pointer;
}
.dash-check::before, .dash-check::after { content: ""; grid-area: 1 / 1; }
.dash-check::before { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); transition: border-color 0.15s, background 0.15s; }
.dash-check::after {
  width: 6px; height: 11px; margin-top: -3px;
  border: solid currentColor; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg); opacity: 0; transition: opacity 0.15s;
}
.dash-check:not(:disabled):hover::before { border-color: var(--ok); }
.dash-check:not(:disabled):hover::after { opacity: 0.55; }
.dash-check:focus-visible { outline-offset: -2px; }
.dash-check:disabled { cursor: default; }
.dash-check.is-done { color: var(--bg); }
.dash-check.is-done::before { background: var(--ok); border-color: var(--ok); }
.dash-check.is-done::after { opacity: 1; }

.dash-task-text { flex: 1; min-width: 0; display: grid; gap: 3px; padding-top: 1px; }
.dash-task-title { color: var(--text); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
/* The title opens the assignment; this stretches it over the whole row (the check and Undo sit
   above it), so the tap target is the row, not one line of text. */
.dash-task-title::after { content: ""; position: absolute; inset: 0; }
.dash-task-title:focus-visible { outline: none; }
.dash-task:has(.dash-task-title:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.dash-task-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dash-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.dash-due { font-weight: 650; }
.dash-due.tone-late { color: var(--danger); }
.dash-due.tone-soon { color: var(--warn); }
.dash-hours { font-variant-numeric: tabular-nums; }
.dash-task.is-done .dash-task-title { color: var(--muted); text-decoration: line-through; }
.dash-done-note { color: var(--ok); font-weight: 650; }
.dash-undo { position: relative; z-index: 1; flex: none; align-self: center; }

/* ---------- announcements ---------- */

.dash-post { display: grid; gap: 8px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.dash-post-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dash-post-row label { margin: 0; font-size: 14px; }
.dash-post textarea { min-height: 80px; }
.dash-post-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.dash-post-actions .dash-status { margin-right: auto; }
.dash-post .btn { min-width: 88px; }

.dash-anns { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.dash-ann-item { display: flex; gap: 12px; min-width: 0; }
.dash-ann-main { flex: 1; min-width: 0; }
.dash-ann-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 28px; }
.dash-ann-who { font-weight: 700; }
.dash-new {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent); border-radius: 5px; padding: 1px 6px;
}
.dash-ann-delete { margin-left: auto; min-height: 28px; font-size: 13px; }
.dash-ann-text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }

/* ---------- recent activity ---------- */

.dash-acts { list-style: none; margin: 0; padding: 0; }
.dash-act { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.dash-act:first-child { border-top: 0; padding-top: 0; }
.dash-act:focus { outline: none; }
.dash-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.dash-act-text { flex: 1; min-width: 0; margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.dash-act .dash-time-ago { flex: none; margin-top: 4px; font-size: 12px; }

/* ---------- finish setting up ---------- */

.dash-setup { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.dash-pill {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px;
  white-space: nowrap;
}
.dash-setup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.dash-setup-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 4px 12px; }
.dash-setup-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; border: 2px solid var(--accent); }
.dash-setup-item > .btn { align-self: center; }
.dash-setup-title { margin: 0; font-weight: 700; font-size: 14px; }
.dash-setup-body { margin: 1px 0 0; font-size: 13px; color: var(--muted); }
.dash-setup-item .btn { white-space: nowrap; }

/* ---------- my week ---------- */

.dash-week-form { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.dash-week-form .hub-field { margin: 0; }
.dash-week-form label { font-size: 14px; }
.dash-week-form input[aria-invalid="true"] { border-color: var(--danger); }
.dash-week-row { display: flex; align-items: flex-end; gap: 10px; }
.dash-week-cap { flex: 0 1 130px; }
.dash-week-actions { margin-left: auto; }
.dash-week-actions .btn { min-height: 46px; min-width: 88px; }
/* Save is turned off with aria-disabled (it keeps the keyboard focus), so it gets the disabled look here. */
.dash-week-save[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.dash-week-save[aria-disabled="true"]:hover { border-color: var(--line-strong); }
.dash-week-form .dash-status:empty { display: none; }

/* ---------- best meeting times ---------- */

.dash-len-wrap { flex: none; }
select.dash-len { width: auto; min-height: 36px; padding-left: 10px; font-size: 14px; }
.dash-times-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dash-time {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg);
}
.dash-rank {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); font-weight: 750; font-size: 13px;
}
.dash-time-text { min-width: 0; }
.dash-time-when { margin: 0; font-weight: 650; }
.dash-time-who { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dash-time-score { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-day-short { display: none; }
.dash-time.is-all { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.dash-time.is-all .dash-time-score { color: var(--ok); }

/* ---------- in between: two columns get narrow ---------- */

@media (max-width: 1020px) and (min-width: 760px) {
  .dash { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
  .dash-main, .dash-side { gap: 14px; }
  .dash-tiles { gap: 10px; }
  .dash-setup-item { grid-template-columns: auto minmax(0, 1fr); }
  .dash-setup-item .btn { grid-column: 2; justify-self: start; }
  .dash-day-long { display: none; }
  .dash-day-short { display: inline; }
}

/* ---------- phones: one column, in the order that matters most ---------- */

@media (max-width: 759px) {
  .dash { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .dash-main, .dash-side { display: contents; }
  .dash-setup { order: 1; }
  .dash-mine { order: 2; }
  .dash-ann { order: 3; }
  .dash-glance { order: 4; }
  .dash-week { order: 5; }
  .dash-times { order: 6; }
  .dash-activity { order: 7; }

  .dash-card { padding: 14px 16px 16px; }
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dash-tile a { padding: 12px 14px; }
  .dash-tile-n { font-size: 26px; }

  .dash-link { display: inline-flex; align-items: center; min-height: 44px; }
  .dash-card-head { margin-bottom: 6px; }
  .dash-check { width: 44px; height: 44px; margin: -10px -2px -10px -11px; }
  .dash-card .btn.small, .dash-card .btn { min-height: 44px; }
  .dash-ann-delete { min-height: 44px; }
  select.dash-len { min-height: 44px; font-size: 16px; }
  .dash-day-long { display: none; }
  .dash-day-short { display: inline; }
  .dash-setup-item { grid-template-columns: auto minmax(0, 1fr); }
  .dash-setup-item .btn { grid-column: 2; justify-self: start; }
  .dash-post-actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-check::before, .dash-check::after, .dash-tile a { transition: none; }
}
