/* ============================================================
   ADA Duty Schedule (desk/staff) page.
   The page is built from design-system components; this sheet only
   places them. Structure in @layer layout, paint in @layer design.
   Colour comes from the surface each component sits on.
   ============================================================ */

@layer layout {
  /* Court filter: the labelled select, then the button that reloads the week. */
  .ada-schedule .ada-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--t-space-3);
  }

  .ada-schedule .ada-filter .field {
    flex: 1;
    min-inline-size: 12rem;
  }

  /* Week grid: auto layout, so a narrow screen lets the table grow past the
     card and the table component's scroll region carries it sideways. A
     fixed layout squeezed the five nowrap weekday headers into equal tracks
     narrower than their text, and the headers ran into each other. */
  .ada-schedule .ada-week-grid :is(th, td) {
    padding: var(--t-space-2);
    vertical-align: top;
  }

  /* Duty slot: name, time window, optional primary marker. */
  .ada-schedule .ada-slot {
    display: grid;
    gap: var(--t-space-1);
    padding: var(--t-space-3);
    border-radius: var(--t-radius-md);
  }

  .ada-schedule .ada-slot :is(.name, .time) {
    margin: 0;
  }

  .ada-schedule .ada-slot .name {
    font-size: var(--t-font-size-sm);
    font-weight: var(--t-font-weight-semibold);
  }

  .ada-schedule .ada-slot .time {
    font-size: var(--t-font-size-xs);
  }

  .ada-schedule .ada-primary {
    justify-self: start;
  }

  .ada-schedule .ada-empty-day {
    display: block;
    padding-block: var(--t-space-3);
    text-align: center;
    font-size: var(--t-font-size-sm);
  }

  /* Add-assignment form: fields stack, and rows of fields share the width. */
  .ada-schedule .ada-add form {
    display: grid;
    gap: var(--t-space-4);
  }

  .ada-schedule .ada-field-row {
    display: grid;
    gap: var(--t-space-4);
  }

  @container (min-width: 32rem) {
    .ada-schedule .ada-field-row[data-columns="2"] {
      grid-template-columns: repeat(2, 1fr);
    }

    .ada-schedule .ada-field-row[data-columns="3"] {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  /* The submit keeps its natural width in the form's grid, as it had in the
     old dialog footer. A button macro on a native <button> carries the
     variant class, not the link-only .button class. */
  .ada-schedule .ada-add form > :is(button, a.button, label.button) {
    justify-self: start;
  }
}

@layer design {
  .ada-schedule .ada-slot .time,
  .ada-schedule .ada-empty-day {
    color: var(--c-surface-text-color-muted);
  }
}
