/* =========================================================================
   Back office. Its own frame, built from the same tokens as the app so it
   never drifts into looking like a different product.

   Every control in here is a link or a form button. Nothing depends on
   JavaScript, because the person using it is usually on a phone.
   ========================================================================= */

.adm { min-height: 100vh; background: var(--bg); }

.admbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--s3);
  padding: 10px var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.admbrand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; color: var(--ink); flex: none;
}
.admbrand:hover { text-decoration: none; color: var(--ink); }
.admwho {
  margin-left: auto;
  display: flex; align-items: center; gap: var(--s2);
  min-width: 0;
}
.admwho .muted {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch;
}

/* The nav scrolls sideways only here, where there are seven fixed items and
   the labels are always visible. That is a different thing from hiding a
   module menu behind unlabelled icons. */
.admnav {
  display: flex; gap: 2px;
  padding: 0 var(--s3);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.admnav::-webkit-scrollbar { display: none; }
.admtab {
  flex: none;
  padding: 12px var(--s3);
  font-size: 14px; font-weight: 600;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  min-height: 44px;
  display: flex; align-items: center;
}
.admtab:hover { color: var(--ink); text-decoration: none; }
.admtab.on { color: var(--brand); border-bottom-color: var(--brand); }
.admtab.soon { opacity: .55; }
.admtab .tag {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  padding: 1px 6px; margin-left: 6px;
}

.admbody {
  max-width: 1040px; margin: 0 auto;
  padding: var(--s5) var(--s4) 96px;
}

.admrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }

/* Filter chips, search and pager: the three things every list screen needs. */
.admchips { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.admchips .pill { text-decoration: none; }

.admsearch {
  display: flex; gap: var(--s2); flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.admsearch input[type=search] {
  flex: 1 1 240px;
  padding: 9px 11px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: var(--field); border: 1px solid var(--field-line);
  border-radius: var(--r-sm);
}
.admsearch input[type=search]:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}

.admpager {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap;
  margin: var(--s3) 0 var(--s5);
}

/* Several one-button forms sit on a row together and must not stack. */
form.inline { display: inline; }
.btnrow form.inline { display: inline-flex; }

/* "View as" hides its reason box until asked for, with no script. */
.impdrop > summary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 8px 13px;
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--field-line); border-radius: var(--r-sm);
  color: var(--ink-2); cursor: pointer; list-style: none;
}
.impdrop > summary::-webkit-details-marker { display: none; }
.impdrop[open] > summary { background: var(--sunken); color: var(--ink); }
.impdrop form {
  margin-top: var(--s3); padding: var(--s3);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--sunken);
  min-width: 260px;
}

/* The band that says whose eyes you are looking through. Deliberately loud:
   an admin who forgets they are impersonating is the whole risk. */
.impbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); flex-wrap: wrap;
  padding: 10px var(--s4);
  background: var(--warn-wash);
  color: var(--warn);
  border-bottom: 1px solid var(--warn);
  font-size: 13.5px; font-weight: 600;
}
.impbar span { display: flex; align-items: center; gap: 8px; }
.impbar form { margin: 0; }
.impbar .i { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .admbody { padding: var(--s4) var(--s4) 88px; }
  .admwho .muted { max-width: 16ch; }
  .admbar { padding: 8px var(--s3); }
  .admsearch input[type=search] { font-size: 16px; min-height: 44px; }
}
