.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stats div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 6px;
  background: #eef4ff;
}

.admin-stats span {
  color: var(--muted);
  font-size: 13px;
}

.admin-stats strong {
  color: var(--blue);
  font-size: 28px;
  line-height: 1.2;
}

.search-row {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.grant-form {
  display: grid;
  grid-template-columns: minmax(180px, 320px) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}

.grant-form label {
  display: grid;
  gap: 8px;
}

.grant-form input {
  min-width: 0;
}

.admin-table-wrap {
  overflow-x: auto;
}

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

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

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-code {
  font: 700 18px/1.5 Consolas, "Courier New", monospace;
  white-space: nowrap;
}

.uploader-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.uploader-list li {
  font: 13px/1.5 Consolas, "Courier New", monospace;
  white-space: nowrap;
}

.history-only {
  color: var(--muted);
  font-size: 13px;
}

.danger {
  border-color: #d92d20;
  color: #b42318;
}

.batch-delete-form {
  display: grid;
  gap: 9px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #f0b8b4;
  border-radius: 6px;
  background: #fff8f7;
}

.batch-delete-form > label {
  font-weight: 700;
}

.batch-delete-form > p {
  color: var(--muted);
  font-size: 13px;
}

.batch-delete-form textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  font: 16px/1.6 Consolas, "Courier New", monospace;
  letter-spacing: 1px;
}

.batch-delete-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#admin-delete-count {
  color: var(--muted);
  font-size: 13px;
}

#admin-delete-count.error {
  color: #b42318;
}

.button.bulk-delete {
  border-color: #b42318;
  color: #fff;
  background: #b42318;
  font-weight: 600;
}

.button.bulk-delete:hover:not(:disabled) {
  border-color: #912018;
  background: #912018;
}

.load-more {
  margin-top: 12px;
}

@media (max-width: 620px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-stats div {
    padding: 10px;
  }

  .admin-stats strong {
    font-size: 22px;
  }

  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) {
    display: none;
  }

  .grant-form {
    grid-template-columns: 1fr;
  }

  .batch-delete-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
