/* ============================================================
   Audit Log (desk/staff) page. Built from design-system components; this
   sheet only places them and carries the page's own cell emphasis.
   Structure in @layer layout, paint in @layer design.

   The bare .filter-bar / .filter-chip / .search-box rules further down are
   shared with other pages (messages, documents, compliance, user management)
   and stay until those pages move to components too.
   ============================================================ */

@layer layout {
  /* Page intro: the heading on the left, the refresh on the right. */
  .audit .intro { display: flex; flex-wrap: wrap; align-items: flex-start;
                  justify-content: space-between; gap: var(--t-space-3); }

  /* Controls: the filter chips and the search beside or below them. The
     search takes the room the chips leave. */
  .audit .controls { display: flex; flex-wrap: wrap; align-items: center;
                     gap: var(--t-space-3); }
  .audit .controls .search-bar { flex: 1; }

  /* The log's time column never wraps. */
  .audit .time { white-space: nowrap; }

  /* The card's foot carries the count of what the table shows. */
  .audit .pager { padding: var(--t-space-4) var(--t-space-5); }

  /* ── shared with other pages (see the header) ── */
  .filter-bar { display: flex; flex-wrap: wrap; gap: var(--mea-space-2);
                margin: 0; padding: 0; }
  .filter-chip { display: inline-flex; align-items: center; min-height: var(--t-target-min, 44px);
                 padding: var(--mea-space-2) var(--mea-space-4); border: 0;
                 border-radius: var(--mea-radius-pill); cursor: pointer; white-space: nowrap; }
  .search-box { flex: 1; min-inline-size: 12rem; display: flex; align-items: center; gap: var(--mea-space-2);
                margin: 0; padding: var(--mea-space-2) var(--mea-space-3);
                border-radius: var(--mea-radius-md); }
  .search-box__input { flex: 1; min-height: var(--t-target-min, 44px);
                       border: 0; background: transparent; padding: 0; }
}

@layer design {
  /* The actor, event and resource values carry the emphasis the base gave
     them; time and the resource id stay muted. The event name is its own
     class so the shared ".event" list item's rule cannot draw a divider
     under it. */
  .audit .actor,
  .audit .audit-event,
  .audit .resource { font-weight: var(--t-font-weight-semibold); }
  .audit .time,
  .audit .on,
  .audit .resource-id { color: var(--c-surface-text-color-muted); }
  .audit .resource-id { font-family: var(--mea-font-mono); font-size: var(--t-font-size-xs); }

  /* ── shared with other pages (see the header) ── */
  .filter-chip { background: var(--t-bg-recessed); color: var(--t-text-secondary);
                 font-size: var(--mea-text-sm); font-weight: var(--mea-w-semibold);
                 transition: background var(--mea-dur-fast), color var(--mea-dur-fast); }
  .filter-chip:hover { background: var(--t-bg-active); }
  .filter-chip.is-active { background: var(--t-accent); color: var(--t-accent-text); }

  .search-box { background: var(--t-bg-elevated); color: var(--t-text); border: 1px solid var(--t-border); }
  .search-box__icon { color: var(--t-text-muted); }
  .search-box__input { color: var(--t-text); font-size: var(--mea-text-md); }
  .search-box__input::placeholder { color: var(--t-text-muted); }
  .search-box:focus-within { border-color: var(--t-border-focus); }
}
