body {
  font-family: system-ui, sans-serif;
  margin: 2rem;
  color: #1f2933;
}

/* The browser's own [hidden] rule is a plain `display: none`, so any class
   here that sets `display` silently beats it — which is why .detail-form and
   .empty-state showed through the hidden attribute their scripts set. Every
   page on this admin site shows and hides by toggling `hidden`, so it wins. */
[hidden] {
  display: none !important;
}

/* The header line (#327): one line on every admin page — the site name as
   plain text, the sections with the current one marked, and the signed-in
   line at the far end. Markup is duplicated per page; a shared chrome script
   is #330's first move. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e4e7eb;
}

.site-name {
  font-weight: 600;
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
}

.site-nav-account {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.75;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

input[type="search"] {
  padding: 0.5rem;
  font-size: 1rem;
  min-width: 16rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.show-retired,
.only-unfilled {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}

.button-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd2d9;
  border-radius: 4px;
  background: #f5f7fa;
}

.button-link:hover {
  background: #e4e7eb;
  text-decoration: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e4e7eb;
}

.thumbnail {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

/* Retired-row treatment (#271): muted, never struck through or coloured like
   an error — a retired bird is a real bird the owner took out of learners'
   way, and the marker beside its name is what says so. */
tr.retired {
  color: #616e7c;
}

tr.retired .thumbnail {
  opacity: 0.6;
}

/* The admin marker on the users list (#327) reuses the retired marker's
   shape: a quiet pill beside the name, never a colour that reads as a state. */
.retired-marker,
.admin-marker {
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid #cbd2d9;
  border-radius: 999px;
  background: #f5f7fa;
  font-size: 0.875rem;
}

.restore-button {
  margin-left: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
}

/* The retire confirm (#271) is an inline step, not a modal — the page stays
   readable and usable behind it, which is the whole point of asking lightly.
   The role confirm on the user page (#329) is the same step. */
.retire-confirm,
.role-confirm {
  max-width: 28rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid #e4e7eb;
  border-radius: 4px;
}

.retire-confirm p,
.role-confirm p {
  margin: 0;
}

.retire-confirm button,
.role-confirm button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.error button {
  margin-top: 0.5rem;
}

.back-link {
  display: inline-block;
}

.detail-image {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* The user detail page (#328): the account's fields as a definition list,
   label and value on one row. Nothing else in this file laid out a dt/dd
   pair. */
.detail-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  max-width: 28rem;
  margin: 0 0 1.5rem;
}

.detail-list dt {
  font-weight: 600;
}

.detail-list dd {
  margin: 0;
}

.bird-heading-row,
.user-heading-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 28rem;
  margin: 0 0 1.5rem;
  padding: 1rem;
  border: 1px solid #e4e7eb;
  border-radius: 4px;
}

.detail-form label {
  font-weight: 600;
}

.detail-form input[type="text"],
.detail-form input[type="file"],
.detail-form select {
  padding: 0.5rem;
  font-size: 1rem;
}

.detail-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.detail-form legend {
  font-weight: 600;
  padding: 0;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.name-row .name-lang {
  width: 4rem;
}

.name-row .name-common {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-actions button,
#add-name,
#attach-image-button,
#attach-audio-button,
.name-row button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

.audio-clip,
.asset-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.audio-clip-label,
.asset-row-label {
  min-width: 4rem;
  font-weight: 600;
}

.audio-clip button,
.asset-row button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

/* Neutral, not an error state (#269, was .no-audio): 39 of 49 birds have no
   audio today and most have no images beyond the default artwork, so an
   empty asset list is the majority case and must never read as broken. */
.empty-state {
  color: #616e7c;
  background: #f5f7fa;
  border: 1px solid #e4e7eb;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  display: inline-block;
}

/* Login gate (#216): names the gate itself, not the one admin feature it
   happens to guard today, so the heading needs no rewrite when the admin
   surface grows beyond the birds pages. */
.login-gate {
  max-width: 20rem;
  margin: 4rem auto;
}

.login-gate form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-gate label {
  font-weight: 600;
}

.login-gate input {
  padding: 0.5rem;
  font-size: 1rem;
}

.login-gate button {
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
}

.hint {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* Related birds (#297): a plain list, the score and what scored beside each
   name — the panel reads what the lesson generator sees and never edits it. */
.related-list {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.related-list li {
  margin-bottom: 0.25rem;
}

.related-score {
  margin-left: 0.5rem;
  font-weight: 600;
}

.related-components {
  margin-left: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.7;
}

.region-tags {
  margin-left: 0.75rem;
  font-size: 0.7em;
  font-weight: normal;
  opacity: 0.7;
}
