.system-admin-panel {
  display: grid;
  gap: 18px;
}

.filter-section {
  padding-bottom: 20px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 0;
}

.filter-grid label {
  display: grid;
  gap: 7px;
}

.filter-grid span {
  color: var(--th-color-slate-500);
  font-size: 12px;
  font-weight: 700;
}

.filter-grid input,
.filter-grid select,
.form-grid input,
.form-grid select,
.stacked-form input,
.stacked-form select {
  min-height: 38px;
  min-width: 0;
  border: 1px solid var(--th-color-slate-200);
  border-radius: var(--th-radius-sm);
  background: var(--th-color-white);
  color: var(--th-color-slate-900);
  padding: 8px 10px;
}

.filter-grid select[multiple],
.form-grid select[multiple],
.stacked-form select[multiple] {
  min-height: 96px;
}

.action-section {
  padding-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px 0;
}

.form-grid label,
.stacked-form label {
  display: grid;
  gap: 7px;
}

.form-grid span,
.stacked-form span {
  color: var(--th-color-slate-500);
  font-size: 12px;
  font-weight: 800;
}

.stacked-form {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--th-color-slate-200);
  padding-top: 14px;
}

.form-message {
  margin: 0;
  color: var(--th-color-slate-500);
  font-size: 12px;
  font-weight: 700;
}

.system-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.text-button,
.row-action {
  border: 0;
  background: transparent;
  color: var(--th-color-blue-600);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 0;
  text-decoration: none;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--th-color-slate-500);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.empty-state--compact {
  min-height: 160px;
}

.empty-state--error {
  color: var(--th-color-danger);
}

.table-section {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  padding: 14px 20px 20px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--th-color-slate-200);
  padding: 14px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--th-color-slate-500);
  font-size: 12px;
  font-weight: 800;
}

td {
  color: var(--th-color-slate-900);
  font-size: 13px;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 4px;
  color: var(--th-color-slate-500);
  font-size: 12px;
}

.status-pill,
.code-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  border-radius: var(--th-radius-sm);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.status-pill {
  background: var(--th-color-slate-100);
  color: var(--th-color-slate-700);
}

.code-chip {
  overflow-wrap: anywhere;
  background: var(--th-color-blue-50);
  color: var(--th-color-blue-700);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--th-color-slate-200);
  padding: 14px 20px 18px;
}

.page-size-control,
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-size-control span,
.pagination-actions span {
  color: var(--th-color-slate-500);
  font-size: 12px;
  font-weight: 800;
}

.page-size-control select {
  min-height: 34px;
  border: 1px solid var(--th-color-slate-200);
  border-radius: var(--th-radius-sm);
  background: var(--th-color-white);
  color: var(--th-color-slate-900);
  padding: 6px 8px;
}

.primary-button,
.secondary-button {
  min-height: 34px;
  border: 1px solid var(--th-color-slate-200);
  border-radius: var(--th-radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
}

.primary-button {
  align-self: end;
  background: var(--th-color-blue-600);
  border-color: var(--th-color-blue-600);
  color: var(--th-color-white);
}

.secondary-button {
  background: var(--th-color-white);
  color: var(--th-color-slate-700);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.detail-panel {
  align-self: start;
  overflow: hidden;
}

.detail-list {
  display: grid;
  gap: 14px;
  padding: 16px 20px 20px;
}

.detail-list div {
  display: grid;
  gap: 5px;
}

.detail-list span {
  color: var(--th-color-slate-500);
  font-size: 12px;
  font-weight: 800;
}

.detail-list strong {
  color: var(--th-color-slate-900);
  font-size: 13px;
}

.detail-list small {
  color: var(--th-color-slate-500);
  font-size: 12px;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 980px) {
  .system-admin-grid {
    grid-template-columns: 1fr;
  }
}

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

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

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}
