/* The club task list (/task-list), scoped so it looks the same inside the admin layout
   (Bootstrap, light) and the members' layout (20px type, a narrow card, light or dark).
   Column widths are in rem, not em, so the members' bigger type can't blow them up, and the
   layout follows the width of the list itself (a container query), not the window: the
   members' card is narrow even on a wide screen. */
.club-tasks {
  --ct-fg: #1d1d1b; --ct-muted: #6b6a66; --ct-line: #e6e2d8; --ct-card: #ffffff; --ct-accent: #0b5cad;
  --ct-done: #2f7d4f; --ct-active: #b76e00; --ct-blocked: #8a8a8a; --ct-open: #0b5cad; --ct-page: #ffffff; --ct-on-accent: #ffffff;
  --ct-late: #b42318;
  container: club-tasks / inline-size;
  max-width: 900px; color: var(--ct-fg);
}
/* In the members' layout: its colours, so dark mode works there too. */
.member-page .club-tasks {
  --ct-fg: var(--m-fg); --ct-muted: var(--m-muted); --ct-line: var(--m-line); --ct-card: var(--m-card);
  --ct-accent: var(--m-accent); --ct-open: var(--m-accent); --ct-page: var(--m-bg); --ct-on-accent: var(--m-on-accent);
}
@media (prefers-color-scheme: dark) {
  .member-page .club-tasks { --ct-done: #6cc28f; --ct-active: #f0a640; --ct-blocked: #a3a39e; --ct-late: #ff8a7a; }
}
.club-tasks .club-tasks__intro { margin: 0 0 .5rem; color: var(--ct-muted); }
.club-tasks .club-tasks__updated { margin-top: 28px; color: var(--ct-muted); font-size: .85rem; }
.club-tasks .searchbar { position: sticky; top: 0; z-index: 5; margin: 0; padding: 10px 0; background: var(--ct-page); } /* margin: 0 undoes application.css's old .searchbar */
@media (max-width: 767.98px) { .admin-main-content .club-tasks .searchbar { top: 56px; } } /* under the admin's phone bar */
.club-tasks .searchbar form { margin: 0; }
.club-tasks .search { box-sizing: border-box; width: 100%; margin: 0; padding: 12px 14px; font: inherit; font-size: 1rem; border-radius: 10px; border: 2px solid var(--ct-accent); background: var(--ct-card); color: var(--ct-fg); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.club-tasks .search:focus { outline: 3px solid var(--ct-accent); outline-offset: 1px; }
/* My Tasks / All Tasks: two tiles with their own counts; the chosen one lifts and fills
   with the list's gradient. The radio inside stays focusable for the keyboard. */
.club-tasks .view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 1rem 0 .25rem; }
.club-tasks .view-switch__side { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--ct-line); background: var(--ct-card); color: var(--ct-fg); cursor: pointer; transition: transform .15s, box-shadow .2s, border-color .2s; }
.club-tasks .view-switch__side:hover { border-color: var(--ct-accent); }
.club-tasks .view-switch__side:has(.view-switch__radio:focus-visible) { outline: 3px solid var(--ct-accent); outline-offset: 2px; } /* keyboard only */
.club-tasks .view-switch__radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.club-tasks .view-switch__label { font-weight: 800; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.club-tasks .view-switch__counts { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; color: var(--ct-muted); }
.club-tasks .view-switch__counts b { display: inline-block; min-width: 1.4em; font-size: 1.25rem; line-height: 1.2; color: var(--ct-fg); font-variant-numeric: tabular-nums; }
.club-tasks .view-switch__side.is-active { border-color: transparent; background: linear-gradient(135deg, #0b5cad, #1a8a5a); color: #fff; box-shadow: 0 6px 16px rgba(11, 92, 173, .3); transform: translateY(-2px); }
.club-tasks .view-switch__side.is-active .view-switch__counts { color: rgba(255, 255, 255, .85); }
.club-tasks .view-switch__side.is-active .view-switch__counts b { color: #fff; }
@media (prefers-reduced-motion: reduce) { .club-tasks .view-switch__side { transition: none; transform: none !important; } }
/* Admins: whose list. */
.club-tasks .person-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: .75rem 0 0; }
.club-tasks .person-picker label { margin: 0; font-weight: 700; }
.club-tasks .person-picker select { font: inherit; font-size: 1rem; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--ct-line); background: var(--ct-card); color: var(--ct-fg); max-width: 100%; }
.club-tasks section { margin-top: 28px; }
.club-tasks section h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; border-bottom: 1px solid var(--ct-line); padding-bottom: 6px; }
.club-tasks h2 small { color: var(--ct-muted); font-weight: 400; font-size: .85rem; margin-left: 6px; }
.club-tasks ul { list-style: none; margin: 0; padding: 0; }
.club-tasks .task, .club-tasks .cols { display: grid; grid-template-columns: 3rem 7.5rem minmax(0, 1fr) 6.75rem; gap: 6px 14px; align-items: baseline; padding: 10px 12px; background: var(--ct-card); border: 1px solid var(--ct-line); border-radius: 10px; margin-bottom: 8px; }
.club-tasks .cols { background: transparent; border: 0; padding: 2px 12px 0; margin-bottom: 2px; color: var(--ct-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.club-tasks .badge { justify-self: start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; background: none; }
.club-tasks .open .badge { color: var(--ct-open); } .club-tasks .active .badge { color: var(--ct-active); }
.club-tasks .blocked .badge { color: var(--ct-blocked); } .club-tasks .done .badge { color: var(--ct-done); }
.club-tasks .title { min-width: 0; overflow-wrap: break-word; }
.club-tasks .done .title { text-decoration: line-through; color: var(--ct-muted); }
.club-tasks .due { color: var(--ct-muted); font-size: .9rem; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.club-tasks .num { color: var(--ct-muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.club-tasks .waits { grid-column: 3 / -1; color: var(--ct-muted); font-size: .85rem; }
.club-tasks .who { grid-column: 3 / -1; color: var(--ct-muted); font-size: .85rem; }
.club-tasks .who b { color: var(--ct-fg); font-weight: 600; }
/* Overdue (TW #3166): its own group at the top with a red heading; a late date is red and
   bold with how late under it; a date of today says "Today" in bold. */
.club-tasks section.late-group h2 { color: var(--ct-late); border-bottom-color: var(--ct-late); }
.club-tasks .task.late .due { color: var(--ct-late); font-weight: 700; }
.club-tasks .late-note { display: block; font-size: .78rem; font-weight: 600; }
.club-tasks .task.today .due { color: var(--ct-fg); font-weight: 700; }
/* Self-assigned (TW #3103): the member's own tasks, under My Tasks only. */
.club-tasks .self-task .badge { color: var(--ct-muted); }
.club-tasks .self-task__action { grid-column: 3 / -1; display: flex; justify-content: flex-end; }
.club-tasks .self-task__action form { margin: 0; }
.club-tasks .self-task__button { white-space: nowrap; font: inherit; font-size: .9rem; font-weight: 800; min-height: 40px; padding: 6px 16px; border: 0; border-radius: 10px; background: var(--ct-accent); color: var(--ct-on-accent); cursor: pointer; }
.club-tasks .self-task__button.undo { background: transparent; color: var(--ct-muted); border: 2px solid var(--ct-line); font-weight: 600; }
.club-tasks .self-add { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; margin: 4px 0 0; }
.club-tasks .self-add input { box-sizing: border-box; min-width: 0; font: inherit; font-size: 1rem; padding: 10px 12px; border: 2px solid var(--ct-line); border-radius: 10px; background: var(--ct-card); color: var(--ct-fg); }
.club-tasks .self-add input:focus { outline: 3px solid var(--ct-accent); outline-offset: 1px; }
.club-tasks .self-add input[type=submit] { border: 0; background: var(--ct-accent); color: var(--ct-on-accent); font-weight: 800; padding: 10px 18px; cursor: pointer; }
.club-tasks .no-matches { margin: 24px 0; color: var(--ct-muted); }
/* Narrow (phones, and the members' card at any window size): number, status and due date
   on one line, the task's name below them at full width. */
@container club-tasks (max-width: 560px) {
  .club-tasks .task { grid-template-columns: auto auto minmax(0, 1fr); gap: 6px 10px; }
  .club-tasks .task .num { grid-column: 1; grid-row: 1; }
  .club-tasks .task .badge { grid-column: 2; grid-row: 1; }
  .club-tasks .task .due { grid-column: 3; grid-row: 1; }
  .club-tasks .task .title { grid-column: 1 / -1; grid-row: 2; }
  .club-tasks .task .waits, .club-tasks .task .who { grid-column: 1 / -1; }
  /* Self-assigned cards: label and due date on top, the title and its button below. */
  .club-tasks .self-task { grid-template-columns: minmax(0, 1fr) auto; }
  .club-tasks .self-task .num { display: none; }
  .club-tasks .self-task .badge { grid-column: 1; grid-row: 1; }
  .club-tasks .self-task .due { grid-column: 2; grid-row: 1; }
  .club-tasks .self-task .title { grid-column: 1; grid-row: 2; }
  .club-tasks .self-task:not(:has(.self-task__action)) .title { grid-column: 1 / -1; }
  .club-tasks .self-task__action { grid-column: 2; grid-row: 2; align-self: center; }
  .club-tasks .self-add { grid-template-columns: minmax(0, 1fr) auto; }
  .club-tasks .self-add input[type=text] { grid-column: 1 / -1; }
  .club-tasks .cols { display: none; }
}
