/* Admin forms: fields, filters, checkboxes, inline row forms, setup QR. */

/* Form fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field label,
.field-label {
  font-weight: 700;
}

.field input:not([type='checkbox']):not([type='radio']),
.field select,
.field textarea {
  inline-size: 100%;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 3px solid var(--border-ink);
}

.field textarea {
  min-block-size: 6rem;
  resize: vertical;
}

.field [aria-invalid='true'] {
  border-color: var(--pastel-coral);
}

.field-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.field-error {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--pastel-coral);
}

form.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

form.filters .field {
  flex: 1 1 11rem;
}

form.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Checkbox with its label on one line */
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.check input {
  inline-size: 1.125rem;
  block-size: 1.125rem;
  accent-color: var(--pastel-yellow);
}

/* QR stays black on white in both themes so phones can scan it. */
.qr {
  inline-size: fit-content;
  padding: 0.75rem;
  background: #fff;
  border: 3px solid var(--border-ink);
  box-shadow: var(--shadow-md);
}

.qr svg {
  display: block;
}

/* Small forms inside table cells */
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-form select,
.inline-form input {
  padding: 0.25rem 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 2px solid var(--border-ink);
}

.inline-form input {
  inline-size: 10rem;
}

/* Buttons inside tables are compact so a row stays on one line. */
.table .btn {
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
  white-space: nowrap;
  border-width: 2px;
  box-shadow: var(--shadow-sm);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.badge,
.nowrap {
  white-space: nowrap;
}

/* One-time credentials box after creating an admin or a password reset */
.credentials-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 0.5rem 1rem;
}

.credentials-list dt {
  font-weight: 700;
}

.credentials-list dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.credentials-list code {
  font-size: 1.125rem;
  font-weight: 700;
  user-select: all;
}

/* Search box with its button on one line */
.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.search-field {
  flex: 1 1 18rem;
}

/* Filter chips: links that keep the search and change one filter */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.25rem 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-sm);
}

.chip.active {
  color: #000;
  background: var(--pastel-yellow);
}
