/* ---------------------------------------------------------------------------
   admin.css — the data administration screen.

   Loaded on every page but scoped entirely under .admin, because the console
   is one route and nothing else should inherit its density. It reuses the
   site's tokens, panels and buttons; what is here is the table, the editor
   and the sign-in card.
   --------------------------------------------------------------------------- */

.admin__layout {
  display: grid;
  grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 860px) {
  .admin__layout { grid-template-columns: 1fr; }
}

/* ---- Resource list ------------------------------------------------------- */

.admin__nav {
  position: sticky;
  top: var(--space-4);
  max-height: calc(100vh - var(--space-7));
  overflow-y: auto;
  padding: var(--space-3);
}

@media (max-width: 860px) {
  .admin__nav { position: static; max-height: 320px; }
}

.admin__nav-group {
  font-size: var(--step--1);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-secondary);
  margin: var(--space-3) 0 var(--space-2);
}
.admin__nav-group:first-child { margin-top: 0; }

.admin__nav-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: var(--step--1);
  color: var(--ink-primary);
}
.admin__nav-item:hover { background: var(--surface-sunken); }
.admin__nav-item[aria-current="true"] {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
}
.admin__nav-item[aria-current="true"] .admin__count { color: rgba(255, 255, 255, .8); }

.admin__count { color: var(--ink-secondary); font-variant-numeric: tabular-nums; }

/* ---- Table --------------------------------------------------------------- */

.admin__tablewrap { overflow-x: auto; }

.admin__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  white-space: nowrap;
}

.admin__table th,
.admin__table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-hairline);
  text-align: left;
  vertical-align: top;
}

.admin__table th {
  font-weight: 800;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-secondary);
  position: sticky;
  top: 0;
  background: var(--surface-raised);
}

.admin__table tbody tr:hover { background: var(--surface-sunken); }

/* A long quote or an SVG path must not stretch the table to the width of the
   page; the full value is in the editor. */
.admin__cell {
  display: inline-block;
  max-width: 34ch;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.admin__num { font-variant-numeric: tabular-nums; text-align: right; }

.admin__actions { display: flex; gap: var(--space-2); }

/* ---- Provenance ---------------------------------------------------------- */

.admin__prov {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 700;
}
.admin__prov--published    { background: #DCFCE7; color: #14532D; }
.admin__prov--illustrative { background: #FEF3C7; color: #78350F; }
.admin__prov--derived      { background: #E0E7FF; color: #312E81; }

/* ---- Editor -------------------------------------------------------------- */

.admin__field { margin-bottom: var(--space-3); }

.admin__label {
  display: block;
  font-size: var(--step--1);
  font-weight: 700;
  margin-bottom: 4px;
}

.admin__hint { font-weight: 400; color: var(--ink-secondary); }

.admin__input,
.admin__textarea,
.admin__select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-hairline);
  border-radius: 7px;
  font: inherit;
  font-size: var(--step--1);
  background: var(--surface-raised);
  color: var(--ink-primary);
}

.admin__textarea { min-height: 7rem; resize: vertical; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.admin__input:focus-visible,
.admin__textarea:focus-visible,
.admin__select:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 1px; }

.admin__checkbox { display: flex; align-items: center; gap: var(--space-2); font-size: var(--step--1); }
.admin__checkbox input { width: 1rem; height: 1rem; }

/* ---- Sign in ------------------------------------------------------------- */

.admin__signin { max-width: 26rem; margin: var(--space-6) auto; }

.admin__error {
  margin-top: var(--space-3);
  padding: 10px 12px;
  border-radius: 7px;
  border-left: 3px solid var(--band-atrisk);
  background: #FEF2F2;
  color: #7F1D1D;
  font-size: var(--step--1);
}

.admin__notice {
  padding: 10px 12px;
  border-radius: 7px;
  border-left: 3px solid var(--comp-c);
  background: var(--surface-sunken);
  font-size: var(--step--1);
  margin-bottom: var(--space-4);
}

.admin__busy { opacity: .55; pointer-events: none; }
