/* The admin console shell: topbar across the top, sidebar left, content right.
   Figma 600:33154. Colour values are tokens only — a hex outside
   eventkrowd_theme.css is a bug this project has a test for. */

.admin-shell {
  display: grid;
  grid-template-columns: 235px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  min-height: 100dvh;
}

/* Visually hidden until focused. The existing .visually-hidden helper has no
   focus escape, so a skip link using it can never be reached by keyboard. */
.admin__skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--wa-color-surface-default);
  color: var(--wa-color-text-link);
}

.admin__skip-link:focus {
  inset-inline-start: 0.5rem;
  top: 0.5rem;
}

.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  min-height: 50px;
  background: var(--wa-color-brand-50);
  color: var(--wa-color-brand-on-loud);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--wa-font-family-heading);
  font-weight: var(--wa-font-weight-heading);
  font-size: 1.125rem;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar__icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.topbar__icon-button:hover,
.topbar__icon-button:focus-visible {
  background: var(--wa-color-brand-40);
}

.topbar__profile-menu {
  padding: 0.75rem;
  min-width: 14rem;
}

.topbar__profile-email {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--wa-color-text-quiet);
  overflow-wrap: anywhere;
}

.admin-shell__main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  /* The 1fr track resolves to minmax(auto, 1fr): without min-width: 0 the
     column grows to the content's min width — a wide table pushed the whole
     document into horizontal scroll between the 1167px breakpoint and the
     width where it fit (HMS-271). With this, the track stays 1fr and each
     page's own table-wrap scrolls instead. */
  min-width: 0;
  padding: 1.5rem;
  background: var(--wa-color-surface-lowered);
}

.admin-shell__main:focus {
  outline: none;
}

.admin-flash {
  margin-block-end: 1rem;
}

.admin-footer {
  margin-block-start: auto;
  padding-block-start: 1.5rem;
}

.admin-footer__copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--wa-color-text-quiet);
}

@media (max-width: 1167px) {
  .admin-shell {
    grid-template-columns: 200px 1fr;
  }

  .admin-shell__main {
    padding: 1rem;
    min-width: 0;
    overflow-x: auto;
  }
}

@media (max-width: 1023px) {
  .admin-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "sidebar"
      "main";
  }
}
